Skip to content

Commit 810b07d

Browse files
committed
feat: update copy for payment method for self onboarding
1 parent a4b9aa3 commit 810b07d

File tree

6 files changed

+18
-10
lines changed

6 files changed

+18
-10
lines changed

docs/workflows-overview/employee-onboarding/employee-onboarding.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -241,10 +241,11 @@ function MyComponent() {
241241

242242
#### Props
243243

244-
| Name | Type | Description |
245-
| ------------------- | ------ | -------------------------------------- |
246-
| employeeId Required | string | The associated employee identifier. |
247-
| onEvent Required | | See events table for available events. |
244+
| Name | Type | Description |
245+
| ------------------- | ------ | ---------------------------------------------------------------------------------------------------- |
246+
| employeeId Required | string | The associated employee identifier. |
247+
| onEvent Required | | See events table for available events. |
248+
| isAdmin | | If the onboarding is being performed by an admin. When false it is configured to be self onboarding. |
248249

249250
#### Events
250251

src/components/Employee/PaymentMethod/PaymentMethod.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ import { useComponentDictionary } from '@/i18n/I18n'
3838
interface PaymentMethodProps extends CommonComponentInterface<'Employee.PaymentMethod'> {
3939
employeeId: string
4040
defaultValues?: never
41+
isAdmin?: boolean
4142
}
4243

4344
export function PaymentMethod(props: PaymentMethodProps & BaseComponentInterface) {
@@ -48,7 +49,7 @@ export function PaymentMethod(props: PaymentMethodProps & BaseComponentInterface
4849
)
4950
}
5051

51-
const Root = ({ employeeId, className, dictionary }: PaymentMethodProps) => {
52+
const Root = ({ employeeId, className, dictionary, isAdmin = false }: PaymentMethodProps) => {
5253
useI18n('Employee.PaymentMethod')
5354
useComponentDictionary('Employee.PaymentMethod', dictionary)
5455
const { baseSubmitHandler, onEvent } = useBase()
@@ -239,6 +240,7 @@ const Root = ({ employeeId, className, dictionary }: PaymentMethodProps) => {
239240
handleAdd,
240241
handleDelete,
241242
handleSplit,
243+
isAdmin,
242244
}}
243245
>
244246
<FormProvider {...formMethods}>
@@ -257,7 +259,7 @@ const Root = ({ employeeId, className, dictionary }: PaymentMethodProps) => {
257259
}
258260

259261
export const PaymentMethodContextual = () => {
260-
const { employeeId, onEvent } = useFlow<OnboardingContextInterface>()
262+
const { employeeId, onEvent, isAdmin } = useFlow<OnboardingContextInterface>()
261263
const { t } = useTranslation('common')
262264

263265
if (!employeeId) {
@@ -269,5 +271,5 @@ export const PaymentMethodContextual = () => {
269271
}),
270272
)
271273
}
272-
return <PaymentMethod employeeId={employeeId} onEvent={onEvent} />
274+
return <PaymentMethod employeeId={employeeId} onEvent={onEvent} isAdmin={isAdmin} />
273275
}

src/components/Employee/PaymentMethod/PaymentTypeForm.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export type PaymentTypeInputs = z.input<typeof PaymentTypeSchema>
1111
export type PaymentTypePayload = z.output<typeof PaymentTypeSchema>
1212

1313
export function PaymentTypeForm() {
14-
const { mode } = usePaymentMethod()
14+
const { mode, isAdmin } = usePaymentMethod()
1515
const { t } = useTranslation('Employee.PaymentMethod')
1616
if (mode !== 'INITIAL' && mode !== 'LIST') return
1717
return (
@@ -23,12 +23,12 @@ export function PaymentTypeForm() {
2323
{
2424
value: PAYMENT_METHODS.directDeposit,
2525
label: t('directDepositLabel'),
26-
description: t('directDepositDescription'),
26+
description: isAdmin ? t('directDepositDescription') : t('directDepositDescriptionSelf'),
2727
},
2828
{
2929
value: PAYMENT_METHODS.check,
3030
label: t('checkLabel'),
31-
description: t('checkDescription'),
31+
description: isAdmin ? t('checkDescription') : t('checkDescriptionSelf'),
3232
},
3333
]}
3434
/>

src/components/Employee/PaymentMethod/usePaymentMethod.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ type PaymentMethodContextType = {
6262
handleSplit: () => void
6363
handleCancel: () => void
6464
handleDelete: (uuid: string) => void
65+
isAdmin: boolean
6566
}
6667

6768
export type MODE = 'ADD' | 'LIST' | 'SPLIT' | 'INITIAL'

src/i18n/en/Employee.PaymentMethod.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@
1313
"saveCta": "Save",
1414
"cancelAddCta": "Cancel",
1515
"checkDescription": "If you select check as the payment method, you'll need to write a physical check to this employee each payday.",
16+
"checkDescriptionSelf": "If you select check as the payment method, you'll receive a physical check.",
1617
"checkLabel": "Check",
1718
"deleteBankAccountCTA": "Delete",
1819
"directDepositDescription": "We recommend direct deposit — we can deposit paychecks directly into your employees' bank accounts.",
20+
"directDepositDescriptionSelf": "We recommend direct deposit — we can deposit paychecks directly into your account.",
1921
"directDepositLabel": "Direct Deposit",
2022
"hamburgerTitle": "Bank account actions",
2123
"nameLabel": "Account nickname",

src/types/i18next.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -835,9 +835,11 @@ export interface EmployeePaymentMethod{
835835
"saveCta":string;
836836
"cancelAddCta":string;
837837
"checkDescription":string;
838+
"checkDescriptionSelf":string;
838839
"checkLabel":string;
839840
"deleteBankAccountCTA":string;
840841
"directDepositDescription":string;
842+
"directDepositDescriptionSelf":string;
841843
"directDepositLabel":string;
842844
"hamburgerTitle":string;
843845
"nameLabel":string;

0 commit comments

Comments
 (0)