-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: use new window * use query param * fix data sharing agreement text * genericize * rename
- Loading branch information
JP
authored
Nov 3, 2023
1 parent
5acb85c
commit b9f8294
Showing
6 changed files
with
192 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
centrifuge-app/src/pages/Onboarding/CompleteExternalOnboarding.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import { Button } from '@centrifuge/fabric' | ||
import * as React from 'react' | ||
import { ActionBar, Container, Content, ContentHeader, Header, Layout, PoolBranding } from '../../components/Onboarding' | ||
import { useOnboarding } from '../../components/OnboardingProvider' | ||
|
||
type Props = { | ||
openNewTab: () => void | ||
poolId: string | null | ||
poolSymbol?: string | ||
} | ||
|
||
export const CompleteExternalOnboarding = ({ openNewTab, poolId, poolSymbol }: Props) => { | ||
const { refetchOnboardingUser, isOnboardingExternally } = useOnboarding() | ||
|
||
const onFocus = () => { | ||
refetchOnboardingUser() | ||
} | ||
|
||
React.useEffect(() => { | ||
window.addEventListener('focus', onFocus) | ||
|
||
return () => { | ||
window.removeEventListener('focus', onFocus) | ||
} | ||
// eslint-disable-next-line react-hooks/exhaustive-deps | ||
}, []) | ||
|
||
return ( | ||
<Layout> | ||
<Header walletMenu={!isOnboardingExternally}> | ||
{!!poolId && <PoolBranding poolId={poolId} symbol={poolSymbol} />} | ||
</Header> | ||
|
||
<Container> | ||
<> | ||
<Content> | ||
<ContentHeader | ||
title="Complete your onboarding in new tab" | ||
body={'Once you are done, return back to this page.'} | ||
/> | ||
</Content> | ||
<ActionBar> | ||
<Button onClick={openNewTab}>Open in new tab</Button> | ||
</ActionBar> | ||
</> | ||
</Container> | ||
</Layout> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.