Skip to content

Commit 6fc0cd6

Browse files
committed
fix: clean up css and use existing layout components
1 parent 161480d commit 6fc0cd6

File tree

2 files changed

+50
-73
lines changed

2 files changed

+50
-73
lines changed

src/components/Payroll/PayrollOverview/PayrollOverviewPresentation.module.scss

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,3 @@
66
container-type: inline-size;
77
width: 100%;
88
}
9-
10-
.paystubIconWrapper {
11-
display: flex;
12-
justify-content: flex-start;
13-
14-
@include container-query(map-get($global-breakpoints, 'small')) {
15-
justify-content: flex-end;
16-
}
17-
}
18-
19-
.actionsContainer {
20-
display: flex;
21-
flex-direction: column;
22-
gap: toRem(12);
23-
align-items: stretch;
24-
width: 100%;
25-
26-
@include container-query(map-get($global-breakpoints, 'small')) {
27-
flex-direction: row;
28-
align-items: center;
29-
width: auto;
30-
}
31-
}

src/components/Payroll/PayrollOverview/PayrollOverviewPresentation.tsx

Lines changed: 50 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import type { PayrollFlowAlert } from '../PayrollFlow/PayrollFlowComponents'
1212
import { calculateTotalPayroll } from '../helpers'
1313
import { FastAchSubmissionBlockerBanner, GenericBlocker } from './SubmissionBlockers'
1414
import styles from './PayrollOverviewPresentation.module.scss'
15-
import { ActionsLayout, DataView, Flex, PayrollLoading } from '@/components/Common'
15+
import { DataView, Flex, Grid, PayrollLoading } from '@/components/Common'
1616
import { useContainerBreakpoints } from '@/hooks/useContainerBreakpoints/useContainerBreakpoints'
1717
import { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'
1818
import { useI18n } from '@/i18n'
@@ -234,7 +234,7 @@ export const PayrollOverviewPresentation = ({
234234
key: 'paystubs',
235235
title: t('tableHeaders.paystub'),
236236
render: (employeeCompensations: EmployeeCompensations) => (
237-
<div className={styles.paystubIconWrapper}>
237+
<Flex justifyContent="flex-end">
238238
<ButtonIcon
239239
aria-label={t('downloadPaystubLabel')}
240240
variant="tertiary"
@@ -246,7 +246,7 @@ export const PayrollOverviewPresentation = ({
246246
>
247247
<DownloadIcon />
248248
</ButtonIcon>
249-
</div>
249+
</Flex>
250250
),
251251
})
252252
}
@@ -557,51 +557,43 @@ export const PayrollOverviewPresentation = ({
557557
},
558558
]
559559

560-
const actions = (
561-
<ActionsLayout justifyContent="end">
562-
<div className={styles.actionsContainer}>
563-
{isProcessed ? (
564-
<>
565-
<Button onClick={onPayrollReceipt} variant="secondary" isDisabled={isSubmitting}>
566-
{t('payrollReceiptCta')}
567-
</Button>
568-
<Button
569-
onClick={() => {
570-
setIsCancelDialogOpen(true)
571-
}}
572-
variant="error"
573-
isDisabled={isSubmitting}
574-
>
575-
{t('cancelCta')}
576-
</Button>
577-
</>
578-
) : (
579-
<>
580-
<Button onClick={onEdit} variant="secondary" isDisabled={isSubmitting}>
581-
{t('editCta')}
582-
</Button>
583-
<Button
584-
onClick={onSubmit}
585-
isDisabled={
586-
isSubmitting ||
587-
(submissionBlockers.length > 0 &&
588-
(submissionBlockers.some(
589-
blocker =>
590-
!PAYROLL_RESOLVABLE_SUBMISSION_BLOCKER_TYPES.includes(
591-
blocker.blockerType || '',
592-
),
593-
) ||
594-
submissionBlockers.some(
595-
blocker => !selectedUnblockOptions[blocker.blockerType || ''],
596-
)))
597-
}
598-
>
599-
{t('submitCta')}
600-
</Button>
601-
</>
602-
)}
603-
</div>
604-
</ActionsLayout>
560+
const actions = isProcessed ? (
561+
<>
562+
<Button onClick={onPayrollReceipt} variant="secondary" isDisabled={isSubmitting}>
563+
{t('payrollReceiptCta')}
564+
</Button>
565+
<Button
566+
onClick={() => {
567+
setIsCancelDialogOpen(true)
568+
}}
569+
variant="error"
570+
isDisabled={isSubmitting}
571+
>
572+
{t('cancelCta')}
573+
</Button>
574+
</>
575+
) : (
576+
<>
577+
<Button onClick={onEdit} variant="secondary" isDisabled={isSubmitting}>
578+
{t('editCta')}
579+
</Button>
580+
<Button
581+
onClick={onSubmit}
582+
isDisabled={
583+
isSubmitting ||
584+
(submissionBlockers.length > 0 &&
585+
(submissionBlockers.some(
586+
blocker =>
587+
!PAYROLL_RESOLVABLE_SUBMISSION_BLOCKER_TYPES.includes(blocker.blockerType || ''),
588+
) ||
589+
submissionBlockers.some(
590+
blocker => !selectedUnblockOptions[blocker.blockerType || ''],
591+
)))
592+
}
593+
>
594+
{t('submitCta')}
595+
</Button>
596+
</>
605597
)
606598

607599
return (
@@ -619,9 +611,17 @@ export const PayrollOverviewPresentation = ({
619611
/>
620612
</Text>
621613
</Flex>
622-
{isDesktop && actions}
614+
{isDesktop && (
615+
<Flex gap={8} justifyContent="flex-end">
616+
{actions}
617+
</Flex>
618+
)}
623619
</Flex>
624-
{!isDesktop && actions}
620+
{!isDesktop && (
621+
<Grid gridTemplateColumns="1fr" gap={8}>
622+
{actions}
623+
</Grid>
624+
)}
625625
{isSubmitting ? (
626626
<PayrollLoading title={t('loadingTitle')} description={t('loadingDescription')} />
627627
) : (

0 commit comments

Comments
 (0)