Skip to content

Commit

Permalink
feat: update view of print
Browse files Browse the repository at this point in the history
  • Loading branch information
mnindrazaka committed Nov 19, 2024
1 parent 452e096 commit e828037
Showing 1 changed file with 16 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { H4, H5, Paragraph, XStack, YStack } from 'tamagui';
import { H4, H6, Paragraph, XStack, YStack } from 'tamagui';
import { Transaction } from '../../../../../domain';
import dayjs from 'dayjs';

Expand All @@ -14,7 +14,7 @@ export const TransactionPrintView = ({
transactionItems,
}: TransactionPrintViewProps) => {
return (
<YStack gap="$3" padding="$3">
<YStack gap="$3">
<H4>Gatherloop Cafe & Community</H4>
<Paragraph>
New Kraksaan Land, Blok G16, Karang Asem, Kebonagung, Kec. Kraksaan
Expand All @@ -23,19 +23,26 @@ export const TransactionPrintView = ({
<Paragraph>
Waktu : {dayjs(createdAt).format('DD/MM/YYYY HH:mm')}
</Paragraph>
<YStack gap="$3">
<YStack gap="$2">
{transactionItems.map(({ id, product, amount, subtotal }) => (
<XStack gap="$3" key={id}>
<Paragraph flex={1}>{product.name}</Paragraph>
<Paragraph flex={1}>
<XStack gap="$2" key={id}>
<Paragraph size="$3" flexBasis="30%">
{product.name}
</Paragraph>
<Paragraph size="$3" flexBasis="25%">
Rp. {product.price.toLocaleString('id')}
</Paragraph>
<Paragraph flex={1}>{amount}</Paragraph>
<Paragraph flex={1}>Rp. {subtotal.toLocaleString('id')}</Paragraph>
<Paragraph size="$3" flexBasis="5%">
{amount}
</Paragraph>
<Paragraph size="$3" flexBasis="25%">
Rp. {subtotal.toLocaleString('id')}
</Paragraph>
</XStack>
))}
<H5>Total Rp. {total.toLocaleString('id')}</H5>
<H6 textAlign="right">Total Rp. {total.toLocaleString('id')}</H6>
</YStack>
<H4 marginBottom="$5">Terimakasih</H4>
</YStack>
);
};

0 comments on commit e828037

Please sign in to comment.