Skip to content

Commit

Permalink
Clean up onboarding UI after redesign
Browse files Browse the repository at this point in the history
  • Loading branch information
sophialittlejohn committed Oct 7, 2024
1 parent 7b8b609 commit 97b942f
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 38 deletions.
22 changes: 2 additions & 20 deletions centrifuge-app/src/components/Onboarding/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,34 +1,16 @@
import { WalletMenu } from '@centrifuge/centrifuge-react'
import { Box, Shelf } from '@centrifuge/fabric'
import { Shelf } from '@centrifuge/fabric'
import * as React from 'react'
import { Link } from 'react-router-dom'
import { config } from '../../config'
import { OnboardingStatus } from '../OnboardingStatus'

type HeaderProps = {
children?: React.ReactNode
walletMenu?: boolean
}

// eslint-disable-next-line @typescript-eslint/no-unused-vars
const [_, WordMark] = config.logo

export function Header({ children, walletMenu = true }: HeaderProps) {
export function Header({ children }: HeaderProps) {
return (
<Shelf as="header" justifyContent="space-between" gap={2} p={3}>
<Shelf alignItems="center" gap={3}>
<Box as={Link} to="/" width={110}>
<WordMark />
</Box>

{children}
</Shelf>

{walletMenu && (
<Box width="300px">
<WalletMenu menuItems={[<OnboardingStatus />]} />
</Box>
)}
</Shelf>
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ export const CompleteExternalOnboarding = ({ openNewTab, poolId, poolSymbol }: P

return (
<Layout>
<Header walletMenu={!isOnboardingExternally}>
{!!poolId && <PoolBranding poolId={poolId} symbol={poolSymbol} />}
</Header>
<Header>{!!poolId && <PoolBranding poolId={poolId} symbol={poolSymbol} />}</Header>

<Container>
<>
Expand Down
2 changes: 1 addition & 1 deletion centrifuge-app/src/pages/Onboarding/EmailVerified.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default function EmailVerified() {

return (
<Layout>
<Header walletMenu={false} />
<Header />

<Container closeable={false}>
<Content>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default function UpdateInvestorStatus() {
: null
return (
<Layout>
<Header walletMenu={false} />
<Header />
<Container closeable={false}>
<Content>
{data && poolMetadata && data && token ? (
Expand Down
6 changes: 2 additions & 4 deletions centrifuge-app/src/pages/Onboarding/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export default function OnboardingPage() {
}

setPool(null)
return navigate('/onboarding')
return navigate('#/onboarding')
}, [
poolId,
setPool,
Expand Down Expand Up @@ -118,9 +118,7 @@ export default function OnboardingPage() {

return (
<Layout>
<Header walletMenu={!isOnboardingExternally}>
{!!poolId && <PoolBranding poolId={poolId} symbol={pool?.symbol} />}
</Header>
<Header>{!!poolId && <PoolBranding poolId={poolId} symbol={pool?.symbol} />}</Header>

<Container
closeable={!isOnboardingExternally}
Expand Down
6 changes: 3 additions & 3 deletions onboarding-api/src/controllers/kyb/verifyBusiness.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Request, Response } from 'express'
import { bool, InferType, object, string } from 'yup'
import { InferType, bool, object, string } from 'yup'
import { EntityUser, OnboardingUser, validateAndWriteToFirestore } from '../../database'
import { sendVerifyEmailMessage } from '../../emails/sendVerifyEmailMessage'
import { fetchUser } from '../../utils/fetchUser'
Expand Down Expand Up @@ -160,8 +160,8 @@ const startManualKyb = async (req: Request, res: Response, user: EntityUser) =>
reference: MANUAL_KYB_REFERENCE,
email: body.email,
country: body.jurisdictionCode,
redirect_url: `${origin}/manual-kyb-redirect.html`,
callback_url: `${callbackBaseUrl}/manualKybCallback?${searchParams}`,
redirect_url: `${origin}#/manual-kyb-redirect.html`,
callback_url: `${callbackBaseUrl}#/manualKybCallback?${searchParams}`,
}

const manualKyb = await shuftiProRequest(payloadmanualKYB)
Expand Down
2 changes: 1 addition & 1 deletion onboarding-api/src/emails/sendApproveInvestorMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const sendApproveInvestorMessage = async (
],
dynamic_template_data: {
trancheName: tranche?.currency.name,
poolUrl: `${process.env.REDIRECT_URL}/pools/${poolId}`,
poolUrl: `${process.env.REDIRECT_URL}#/pools/${poolId}`,
},
},
],
Expand Down
6 changes: 3 additions & 3 deletions onboarding-api/src/emails/sendDocumentsMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@ export const sendDocumentsMessage = async (
},
],
dynamic_template_data: {
rejectLink: `${process.env.REDIRECT_URL}/onboarding/updateInvestorStatus?token=${encodeURIComponent(
rejectLink: `${process.env.REDIRECT_URL}#/onboarding/updateInvestorStatus?token=${encodeURIComponent(
token
)}&status=rejected&metadata=${pool?.metadata}`,
approveLink: `${process.env.REDIRECT_URL}/onboarding/updateInvestorStatus?token=${encodeURIComponent(
approveLink: `${process.env.REDIRECT_URL}#/onboarding/updateInvestorStatus?token=${encodeURIComponent(
token
)}&status=approved&metadata=${pool?.metadata}&network=${wallet.network}`,
disclaimerLink: `${process.env.REDIRECT_URL}/disclaimer`,
disclaimerLink: `${process.env.REDIRECT_URL}#/disclaimer`,
trancheName: tranche?.currency.name,
investorEmail,
},
Expand Down
4 changes: 2 additions & 2 deletions onboarding-api/src/emails/sendVerifyEmailMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ export const sendVerifyEmailMessage = async (user: OnboardingUser, wallet: Reque
},
],
dynamic_template_data: {
verifyLink: `${process.env.REDIRECT_URL}/onboarding/verifyEmail?token=${encodeURIComponent(token)}`,
disclaimerLink: `${process.env.REDIRECT_URL}/disclaimer`,
verifyLink: `${process.env.REDIRECT_URL}#/onboarding/verifyEmail?token=${encodeURIComponent(token)}`,
disclaimerLink: `${process.env.REDIRECT_URL}#/disclaimer`,
},
},
],
Expand Down

0 comments on commit 97b942f

Please sign in to comment.