feat: style tweaks in the public payment page

This commit is contained in:
Ahmed Bouhuolia
2024-09-19 11:28:40 +02:00
parent 2ebb4595a8
commit 809973730f
5 changed files with 98 additions and 72 deletions

View File

@@ -1,8 +1,8 @@
import { Knex } from 'knex';
import { Service, Inject } from 'typedi'; import { Service, Inject } from 'typedi';
import JournalPoster from '@/services/Accounting/JournalPoster'; import JournalPoster from '@/services/Accounting/JournalPoster';
import TenancyService from '@/services/Tenancy/TenancyService'; import TenancyService from '@/services/Tenancy/TenancyService';
import JournalCommands from '@/services/Accounting/JournalCommands'; import JournalCommands from '@/services/Accounting/JournalCommands';
import Knex from 'knex';
@Service() @Service()
export default class JournalPosterService { export default class JournalPosterService {

View File

@@ -3,23 +3,31 @@
height: 50px; height: 50px;
width :50px; width :50px;
border-radius: 50px; border-radius: 50px;
background-color: #fff; background-color: #dfdfdf;
background: #dfdfdf; background-image: url('https://pbs.twimg.com/profile_images/1381635804397703182/x5chIdsO_400x400.png');
background-position: center center;
background-size: cover;
background-repeat: no-repeat;
border: 1px solid #e8e8e8;
}
.rootBodyPage {
background: #181a30;
} }
.root { .root {
border-radius: 8px; border-radius: 10px;
box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.1); box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.1);
width: 600px; width: 600px;
margin: 40px auto; margin: 40px auto;
color: #000; color: #222;
background-color: #fff; background-color: #fff;
} }
.bigTitle{ .bigTitle{
margin: 0; margin: 0;
font-weight: 500; font-weight: 500;
color: #111; color: #222;
font-size: 26px; font-size: 26px;
} }
@@ -28,16 +36,17 @@
} }
.invoiceNumber { .invoiceNumber {
font-size: 18px; font-size: 16px;
color: #333; color: #333;
font-weight: 600;
} }
.body { .body {
padding: 30px; padding: 30px 26px;
} }
.footer{ .footer{
padding: 20px 30px; padding: 20px 26px;
background-color: #FAFAFA; background-color: #FAFAFA;
border-top: 1px solid #DCE0E5; border-top: 1px solid #DCE0E5;
border-radius: 0 0 8px 8px; border-radius: 0 0 8px 8px;
@@ -50,7 +59,7 @@
font-weight: 600; font-weight: 600;
} }
.totals { .totals {
color: #000;
} }
.totalItem { .totalItem {
@@ -64,6 +73,10 @@
} }
} }
.footerButtons{
margin-top: 20px;
}
.footerButton{ .footerButton{
height: 40px; height: 40px;
line-height: 40px; line-height: 40px;
@@ -84,5 +97,6 @@
} }
.buyNote{ .buyNote{
margin-top: 16px;
font-size: 12px; font-size: 12px;
} }

View File

@@ -9,8 +9,9 @@ export function PaymentPortal() {
return ( return (
<Box className={styles.root}> <Box className={styles.root}>
<Stack className={styles.body}> <Stack spacing={0} className={styles.body}>
<Group spacing={8}> <Stack>
<Group spacing={10}>
<Box className={styles.companyLogoWrap}></Box> <Box className={styles.companyLogoWrap}></Box>
<Text>{sharableLinkMeta?.companyName}</Text> <Text>{sharableLinkMeta?.companyName}</Text>
</Group> </Group>
@@ -26,7 +27,9 @@ export function PaymentPortal() {
</Stack> </Stack>
<Stack spacing={2}> <Stack spacing={2}>
<Box className={styles.customerName}>{sharableLinkMeta?.customerName}</Box> <Box className={styles.customerName}>
{sharableLinkMeta?.customerName}
</Box>
<Box>Bigcapital Technology, Inc.</Box> <Box>Bigcapital Technology, Inc.</Box>
<Box>131 Continental Dr Suite 305 Newark,</Box> <Box>131 Continental Dr Suite 305 Newark,</Box>
<Box>Delaware 19713</Box> <Box>Delaware 19713</Box>
@@ -56,7 +59,7 @@ export function PaymentPortal() {
<Group <Group
position={'apart'} position={'apart'}
className={clsx(styles.totalItem, styles.borderBottomDark)} className={clsx(styles.totalItem, styles.borderBottomGray)}
> >
<Text>Paid Amount (-)</Text> <Text>Paid Amount (-)</Text>
<Text>{sharableLinkMeta?.paymentAmountFormatted}</Text> <Text>{sharableLinkMeta?.paymentAmountFormatted}</Text>
@@ -72,8 +75,9 @@ export function PaymentPortal() {
</Text> </Text>
</Group> </Group>
</Stack> </Stack>
</Stack>
<Stack spacing={8}> <Stack spacing={8} className={styles.footerButtons}>
<Button <Button
minimal minimal
className={clsx(styles.footerButton, styles.downloadInvoiceButton)} className={clsx(styles.footerButton, styles.downloadInvoiceButton)}
@@ -100,7 +104,7 @@ export function PaymentPortal() {
</Text> </Text>
</Stack> </Stack>
<Stack className={styles.footer}> <Stack spacing={18} className={styles.footer}>
<Stack spacing={0}> <Stack spacing={0}>
<Box> <Box>
<strong>Bigcapital Technology, Inc.</strong> <strong>Bigcapital Technology, Inc.</strong>

View File

@@ -3,6 +3,7 @@ import {
GetSharableLinkMetaResponse, GetSharableLinkMetaResponse,
useGetSharableLinkMeta, useGetSharableLinkMeta,
} from '@/hooks/query/payment-link'; } from '@/hooks/query/payment-link';
import { Spinner } from '@blueprintjs/core';
interface PaymentPortalContextType { interface PaymentPortalContextType {
sharableLinkMeta: GetSharableLinkMetaResponse | undefined; sharableLinkMeta: GetSharableLinkMetaResponse | undefined;
@@ -29,6 +30,9 @@ export const PaymentPortalBoot: React.FC<PaymentPortalBootProps> = ({
sharableLinkMeta, sharableLinkMeta,
isSharableLinkMetaLoading, isSharableLinkMetaLoading,
}; };
if (isSharableLinkMetaLoading) {
return <Spinner size={20} />;
}
return ( return (
<PaymentPortalContext.Provider value={value}> <PaymentPortalContext.Provider value={value}>

View File

@@ -1,13 +1,17 @@
import { useParams } from 'react-router-dom'; import { useParams } from 'react-router-dom';
import { PaymentPortal } from './PaymentPortal'; import { PaymentPortal } from './PaymentPortal';
import { PaymentPortalBoot } from './PaymentPortalBoot'; import { PaymentPortalBoot } from './PaymentPortalBoot';
import BodyClassName from 'react-body-classname';
import styles from './PaymentPortal.module.scss';
export default function PaymentPortalPage() { export default function PaymentPortalPage() {
const { linkId } = useParams<{ linkId: string }>(); const { linkId } = useParams<{ linkId: string }>();
return ( return (
<BodyClassName className={styles.rootBodyPage}>
<PaymentPortalBoot linkId={linkId}> <PaymentPortalBoot linkId={linkId}>
<PaymentPortal /> <PaymentPortal />
</PaymentPortalBoot> </PaymentPortalBoot>
</BodyClassName>
); );
} }