Compare commits

..
Author SHA1 Message Date
Bill He a4ef2b28fe fix nit 2023-10-20 10:45:30 -07:00
Bill He 7d65956cd0 update v4-client init in useDydxClient 2023-10-19 16:09:58 -07:00
4 changed files with 18 additions and 62 deletions
+1 -1
View File
@@ -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.32", "@dydxprotocol/v4-localization": "^0.1.30",
"@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",
+4 -4
View File
@@ -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.32 specifier: ^0.1.30
version: 0.1.32 version: 0.1.30
'@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.32: /@dydxprotocol/v4-localization@0.1.30:
resolution: {integrity: sha512-ZtXScxgFLjUt0Ag52RyFnQe9aEl1Aky5fp+vMGOBduVkFiCEMRMkSsSgg6grMdyw/x0AbnxOTRkhYoX2MsK9Ow==} resolution: {integrity: sha512-xTlQuQmPz7wfGkjd07giYMAxRrolDbJE3DryJSIMB6R1MBq1wLzAcwp/iR/nELRwilRX9c44Tap0gGt+oAajiQ==}
dev: false dev: false
/@dydxprotocol/v4-proto@0.4.1: /@dydxprotocol/v4-proto@0.4.1:
+4 -11
View File
@@ -37,7 +37,7 @@ export const OnboardingDialog = ({ setIsOpen }: ElementProps) => {
const stringGetter = useStringGetter(); const stringGetter = useStringGetter();
const { isMobile } = useBreakpoints(); const { isMobile } = useBreakpoints();
const { disconnect, walletType } = useAccounts(); const { walletType } = useAccounts();
const currentOnboardingStep = useSelector(calculateOnboardingStep); const currentOnboardingStep = useSelector(calculateOnboardingStep);
@@ -45,17 +45,10 @@ 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={setIsOpenFromDialog} setIsOpen={setIsOpen}
{...(currentOnboardingStep && {...(currentOnboardingStep &&
{ {
[OnboardingSteps.ChooseWallet]: { [OnboardingSteps.ChooseWallet]: {
@@ -94,10 +87,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 onClose={() => setIsOpenFromDialog?.(false)} /> <AcknowledgeTerms />
</Styled.Content> </Styled.Content>
), ),
width: '30rem', width: '20rem',
}, },
[OnboardingSteps.DepositFunds]: { [OnboardingSteps.DepositFunds]: {
title: stringGetter({ key: STRING_KEYS.DEPOSIT }), title: stringGetter({ key: STRING_KEYS.DEPOSIT }),
@@ -6,17 +6,14 @@ 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 = ({ onClose, onContinue }: ElementProps) => { export const AcknowledgeTerms = ({ onContinue }: ElementProps) => {
const stringGetter = useStringGetter(); const stringGetter = useStringGetter();
const { saveHasAcknowledgedTerms } = useAccounts(); const { saveHasAcknowledgedTerms } = useAccounts();
@@ -28,40 +25,26 @@ export const AcknowledgeTerms = ({ onClose, onContinue }: ElementProps) => {
return ( return (
<> <>
<p> <span>
{stringGetter({ {stringGetter({
key: STRING_KEYS.TOS_TITLE, key: STRING_KEYS.LEGAL_UPDATES_DESCRIPTION,
params: { params: {
TERMS_LINK: ( TOU: (
<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_LINK: ( PRIVACY_POLICY: (
<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>
), ),
}, },
})} })}
</p> </span>
<Styled.TOS> <Button onClick={onAcknowledgement} action={ButtonAction.Primary}>
<ul>
<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 })} {stringGetter({ key: STRING_KEYS.I_AGREE })}
</Styled.Button> </Button>
</Styled.Row>
</> </>
); );
}; };
@@ -76,23 +59,3 @@ 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;
`;