Compare commits
2 Commits
main
...
update-ack
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e1e817ea92 | ||
|
|
4b85ec7df0 |
@ -40,7 +40,7 @@
|
|||||||
"@cosmjs/tendermint-rpc": "^0.31.0",
|
"@cosmjs/tendermint-rpc": "^0.31.0",
|
||||||
"@dydxprotocol/v4-abacus": "^0.7.2",
|
"@dydxprotocol/v4-abacus": "^0.7.2",
|
||||||
"@dydxprotocol/v4-client-js": "^0.40.3",
|
"@dydxprotocol/v4-client-js": "^0.40.3",
|
||||||
"@dydxprotocol/v4-localization": "^0.1.30",
|
"@dydxprotocol/v4-localization": "^0.1.32",
|
||||||
"@ethersproject/providers": "^5.7.2",
|
"@ethersproject/providers": "^5.7.2",
|
||||||
"@js-joda/core": "^5.5.3",
|
"@js-joda/core": "^5.5.3",
|
||||||
"@radix-ui/react-collapsible": "^1.0.3",
|
"@radix-ui/react-collapsible": "^1.0.3",
|
||||||
|
|||||||
8
pnpm-lock.yaml
generated
8
pnpm-lock.yaml
generated
@ -33,8 +33,8 @@ dependencies:
|
|||||||
specifier: ^0.40.3
|
specifier: ^0.40.3
|
||||||
version: 0.40.3
|
version: 0.40.3
|
||||||
'@dydxprotocol/v4-localization':
|
'@dydxprotocol/v4-localization':
|
||||||
specifier: ^0.1.30
|
specifier: ^0.1.32
|
||||||
version: 0.1.30
|
version: 0.1.32
|
||||||
'@ethersproject/providers':
|
'@ethersproject/providers':
|
||||||
specifier: ^5.7.2
|
specifier: ^5.7.2
|
||||||
version: 5.7.2
|
version: 5.7.2
|
||||||
@ -1011,8 +1011,8 @@ packages:
|
|||||||
- utf-8-validate
|
- utf-8-validate
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/@dydxprotocol/v4-localization@0.1.30:
|
/@dydxprotocol/v4-localization@0.1.32:
|
||||||
resolution: {integrity: sha512-xTlQuQmPz7wfGkjd07giYMAxRrolDbJE3DryJSIMB6R1MBq1wLzAcwp/iR/nELRwilRX9c44Tap0gGt+oAajiQ==}
|
resolution: {integrity: sha512-ZtXScxgFLjUt0Ag52RyFnQe9aEl1Aky5fp+vMGOBduVkFiCEMRMkSsSgg6grMdyw/x0AbnxOTRkhYoX2MsK9Ow==}
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/@dydxprotocol/v4-proto@0.4.1:
|
/@dydxprotocol/v4-proto@0.4.1:
|
||||||
|
|||||||
@ -37,7 +37,7 @@ export const OnboardingDialog = ({ setIsOpen }: ElementProps) => {
|
|||||||
const stringGetter = useStringGetter();
|
const stringGetter = useStringGetter();
|
||||||
const { isMobile } = useBreakpoints();
|
const { isMobile } = useBreakpoints();
|
||||||
|
|
||||||
const { walletType } = useAccounts();
|
const { disconnect, walletType } = useAccounts();
|
||||||
|
|
||||||
const currentOnboardingStep = useSelector(calculateOnboardingStep);
|
const currentOnboardingStep = useSelector(calculateOnboardingStep);
|
||||||
|
|
||||||
@ -45,10 +45,17 @@ export const OnboardingDialog = ({ setIsOpen }: ElementProps) => {
|
|||||||
if (!currentOnboardingStep) setIsOpen?.(false);
|
if (!currentOnboardingStep) setIsOpen?.(false);
|
||||||
}, [currentOnboardingStep]);
|
}, [currentOnboardingStep]);
|
||||||
|
|
||||||
|
const setIsOpenFromDialog = (open: boolean) => {
|
||||||
|
if (!open && currentOnboardingStep === OnboardingSteps.AcknowledgeTerms) {
|
||||||
|
disconnect();
|
||||||
|
}
|
||||||
|
setIsOpen?.(open);
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Styled.Dialog
|
<Styled.Dialog
|
||||||
isOpen={Boolean(currentOnboardingStep)}
|
isOpen={Boolean(currentOnboardingStep)}
|
||||||
setIsOpen={setIsOpen}
|
setIsOpen={setIsOpenFromDialog}
|
||||||
{...(currentOnboardingStep &&
|
{...(currentOnboardingStep &&
|
||||||
{
|
{
|
||||||
[OnboardingSteps.ChooseWallet]: {
|
[OnboardingSteps.ChooseWallet]: {
|
||||||
@ -87,10 +94,10 @@ export const OnboardingDialog = ({ setIsOpen }: ElementProps) => {
|
|||||||
title: stringGetter({ key: STRING_KEYS.ACKNOWLEDGE_TERMS }),
|
title: stringGetter({ key: STRING_KEYS.ACKNOWLEDGE_TERMS }),
|
||||||
children: (
|
children: (
|
||||||
<Styled.Content>
|
<Styled.Content>
|
||||||
<AcknowledgeTerms />
|
<AcknowledgeTerms onClose={() => setIsOpenFromDialog?.(false)} />
|
||||||
</Styled.Content>
|
</Styled.Content>
|
||||||
),
|
),
|
||||||
width: '20rem',
|
width: '30rem',
|
||||||
},
|
},
|
||||||
[OnboardingSteps.DepositFunds]: {
|
[OnboardingSteps.DepositFunds]: {
|
||||||
title: stringGetter({ key: STRING_KEYS.DEPOSIT }),
|
title: stringGetter({ key: STRING_KEYS.DEPOSIT }),
|
||||||
|
|||||||
@ -6,14 +6,17 @@ import { AppRoute } from '@/constants/routes';
|
|||||||
import { STRING_KEYS } from '@/constants/localization';
|
import { STRING_KEYS } from '@/constants/localization';
|
||||||
import { ButtonAction } from '@/constants/buttons';
|
import { ButtonAction } from '@/constants/buttons';
|
||||||
|
|
||||||
|
import { layoutMixins } from '@/styles/layoutMixins';
|
||||||
|
|
||||||
import { Button } from '@/components/Button';
|
import { Button } from '@/components/Button';
|
||||||
import { Link } from '@/components/Link';
|
import { Link } from '@/components/Link';
|
||||||
|
|
||||||
type ElementProps = {
|
type ElementProps = {
|
||||||
|
onClose?: () => void;
|
||||||
onContinue?: () => void;
|
onContinue?: () => void;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const AcknowledgeTerms = ({ onContinue }: ElementProps) => {
|
export const AcknowledgeTerms = ({ onClose, onContinue }: ElementProps) => {
|
||||||
const stringGetter = useStringGetter();
|
const stringGetter = useStringGetter();
|
||||||
|
|
||||||
const { saveHasAcknowledgedTerms } = useAccounts();
|
const { saveHasAcknowledgedTerms } = useAccounts();
|
||||||
@ -25,26 +28,40 @@ export const AcknowledgeTerms = ({ onContinue }: ElementProps) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<span>
|
<p>
|
||||||
{stringGetter({
|
{stringGetter({
|
||||||
key: STRING_KEYS.LEGAL_UPDATES_DESCRIPTION,
|
key: STRING_KEYS.TOS_TITLE,
|
||||||
params: {
|
params: {
|
||||||
TOU: (
|
TERMS_LINK: (
|
||||||
<Styled.Link href={`/#${AppRoute.Terms}`}>
|
<Styled.Link href={`/#${AppRoute.Terms}`}>
|
||||||
{stringGetter({ key: STRING_KEYS.TERMS_OF_USE })}
|
{stringGetter({ key: STRING_KEYS.TERMS_OF_USE })}
|
||||||
</Styled.Link>
|
</Styled.Link>
|
||||||
),
|
),
|
||||||
PRIVACY_POLICY: (
|
PRIVACY_POLICY_LINK: (
|
||||||
<Styled.Link href={`/#${AppRoute.Privacy}`}>
|
<Styled.Link href={`/#${AppRoute.Privacy}`}>
|
||||||
{stringGetter({ key: STRING_KEYS.PRIVACY_POLICY })}
|
{stringGetter({ key: STRING_KEYS.PRIVACY_POLICY })}
|
||||||
</Styled.Link>
|
</Styled.Link>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
})}
|
})}
|
||||||
</span>
|
</p>
|
||||||
<Button onClick={onAcknowledgement} action={ButtonAction.Primary}>
|
<Styled.TOS>
|
||||||
{stringGetter({ key: STRING_KEYS.I_AGREE })}
|
<ul>
|
||||||
</Button>
|
<li>{stringGetter({ key: STRING_KEYS.TOS_LINE1 })}</li>
|
||||||
|
<li>{stringGetter({ key: STRING_KEYS.TOS_LINE2 })}</li>
|
||||||
|
<li>{stringGetter({ key: STRING_KEYS.TOS_LINE3 })}</li>
|
||||||
|
<li>{stringGetter({ key: STRING_KEYS.TOS_LINE4 })}</li>
|
||||||
|
<li>{stringGetter({ key: STRING_KEYS.TOS_LINE5 })}</li>
|
||||||
|
</ul>
|
||||||
|
</Styled.TOS>
|
||||||
|
<Styled.Row>
|
||||||
|
<Styled.Button onClick={onClose} action={ButtonAction.Base}>
|
||||||
|
{stringGetter({ key: STRING_KEYS.CLOSE })}
|
||||||
|
</Styled.Button>
|
||||||
|
<Styled.Button onClick={onAcknowledgement} action={ButtonAction.Primary}>
|
||||||
|
{stringGetter({ key: STRING_KEYS.I_AGREE })}
|
||||||
|
</Styled.Button>
|
||||||
|
</Styled.Row>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
@ -59,3 +76,23 @@ Styled.Link = styled(Link)`
|
|||||||
color: var(--color-accent);
|
color: var(--color-accent);
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
Styled.TOS = styled.section`
|
||||||
|
background-color: var(--color-layer-4);
|
||||||
|
padding: 1rem 1rem 1rem 2rem;
|
||||||
|
border-radius: 0.875rem;
|
||||||
|
> ul {
|
||||||
|
${layoutMixins.column};
|
||||||
|
gap: 1rem;
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
Styled.Row = styled.div`
|
||||||
|
${layoutMixins.row};
|
||||||
|
|
||||||
|
gap: 1rem;
|
||||||
|
`;
|
||||||
|
|
||||||
|
Styled.Button = styled(Button)`
|
||||||
|
flex-grow: 1;
|
||||||
|
`;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user