Skip to content

Commit 04b9ab7

Browse files
authored
feat(contractor-onboarding): add Remote Payments setup section (#700)
* feat(onboarding): add Remote Payments setup section to contractor review step * move remote payments block
1 parent bdc46d0 commit 04b9ab7

3 files changed

Lines changed: 47 additions & 7 deletions

File tree

example/src/ReviewContractorOnboardingStep.tsx

Lines changed: 44 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,53 @@
11
import {
22
ContractorOnboardingRenderProps,
33
NormalizedFieldError,
4+
useMagicLink,
45
} from '@remoteoss/remote-flows';
6+
import { Button } from '@remoteoss/remote-flows/internals';
7+
import { InfoIcon } from 'lucide-react';
58
import { InviteSection, ReviewMeta } from './ReviewOnboardingStep';
69
import { AlertError } from './AlertError';
710

11+
const RemotePaymentServicesSetUp = () => {
12+
const magicLink = useMagicLink();
13+
14+
const generateMagicLinkToPayments = async () => {
15+
const response = await magicLink.mutateAsync({
16+
path: `/dashboard/company-settings/payments`,
17+
user_id: import.meta.env.VITE_USER_ID,
18+
});
19+
20+
if (response.data) {
21+
window.open(response.data.data.url, '_blank', 'noopener,noreferrer');
22+
}
23+
};
24+
25+
return (
26+
<div className='flex items-center gap-4 rounded-lg border bg-card px-4 py-3'>
27+
<div className='flex h-10 w-10 shrink-0 items-center justify-center rounded-full'>
28+
<InfoIcon className='h-4 w-4' />
29+
</div>
30+
<div className='flex-1'>
31+
<h3 className='font-medium text-card-foreground'>
32+
Set up Remote Payments
33+
</h3>
34+
<p className='text-sm text-muted-foreground'>
35+
Gain access to additional payment methods and streamlined payment
36+
management.
37+
</p>
38+
</div>
39+
<Button
40+
className='bg-[#000000] text-white hover:bg-[#000000]/80'
41+
onClick={generateMagicLinkToPayments}
42+
>
43+
Set up now
44+
</Button>
45+
</div>
46+
);
47+
};
48+
49+
// ... existing code ...
50+
851
export const ReviewContractorOnboardingStep = ({
952
onboardingBag,
1053
components,
@@ -83,9 +126,7 @@ export const ReviewContractorOnboardingStep = ({
83126
has been invited to Remote. We’ll let you know once they complete
84127
their onboarding process
85128
</p>
86-
<div>
87-
<button type='submit'>Go to dashboard</button>
88-
</div>
129+
<RemotePaymentServicesSetUp />
89130
</div>
90131
)}
91132

src/styles/global.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
@layer theme, base, components, utilities;
2-
@import 'tailwindcss/theme.css' layer(theme);
3-
@import 'tailwindcss/utilities.css' layer(utilities);
1+
@import 'tailwindcss';
2+
3+
@source '../**/*.{tsx,ts,jsx,js}';
44

55
:root {
66
--background: oklch(1 0 0);

tailwind.config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,4 @@
22

33
export default {
44
darkMode: ['class'],
5-
content: ['./index.html', './src/**/*.{js,ts,jsx,tsx}'],
65
};

0 commit comments

Comments
 (0)