Comment out migration work

This commit is contained in:
Bill He 2023-10-02 10:50:05 -04:00
parent 895fbeb573
commit 371397b72e
No known key found for this signature in database
GPG Key ID: 73AEEF9D79E5BBF8
4 changed files with 26 additions and 133 deletions

View File

@ -5,7 +5,7 @@ export enum DialogTypes {
ExchangeOffline = 'ExchangeOffline',
FillDetails = 'FillDetails',
Help = 'Help',
Keplr = 'Keplr',
ExternalNavKeplr = 'ExternalNavKeplr',
MnemonicExport = 'MnemonicExport',
MobileSignIn = 'MobileSignIn',
Onboarding = 'Onboarding',

View File

@ -11,7 +11,7 @@ import { DepositDialog } from '@/views/dialogs/DepositDialog';
import { DisconnectDialog } from '@/views/dialogs/DisconnectDialog';
import { ExchangeOfflineDialog } from '@/views/dialogs/ExchangeOfflineDialog';
import { HelpDialog } from '@/views/dialogs/HelpDialog';
import { KeplrDialog } from '@/views/dialogs/KeplrDialog';
import { ExternalNavKeplrDialog } from '@/views/dialogs/ExternalNavKeplrDialog';
import { MnemonicExportDialog } from '@/views/dialogs/MnemonicExportDialog';
import { MobileSignInDialog } from '@/views/dialogs/MobileSignInDialog';
import { OnboardingDialog } from '@/views/dialogs/OnboardingDialog';
@ -48,7 +48,7 @@ export const DialogManager = () => {
[DialogTypes.ExchangeOffline]: <ExchangeOfflineDialog {...modalProps} />,
[DialogTypes.FillDetails]: <FillDetailsDialog {...modalProps} />,
[DialogTypes.Help]: <HelpDialog {...modalProps} />,
[DialogTypes.Keplr]: <KeplrDialog {...modalProps} />,
[DialogTypes.ExternalNavKeplr]: <ExternalNavKeplrDialog {...modalProps} />,
[DialogTypes.MnemonicExport]: <MnemonicExportDialog {...modalProps} />,
[DialogTypes.MobileSignIn]: <MobileSignInDialog {...modalProps} />,
[DialogTypes.Onboarding]: <OnboardingDialog {...modalProps} />,

View File

@ -16,6 +16,7 @@ import { Panel } from '@/components/Panel';
import { IconName } from '@/components/Icon';
import { Button } from '@/components/Button';
import { IconButton } from '@/components/IconButton';
import { Link } from '@/components/Link';
import { Output, OutputType } from '@/components/Output';
import { VerticalSeparator } from '@/components/Separator';
import { WithReceipt } from '@/components/WithReceipt';
@ -24,35 +25,35 @@ import { openDialog } from '@/state/dialogs';
import { getSelectedNetwork } from '@/state/appSelectors';
import { DYDXBalancePanel } from './DYDXBalancePanel';
import { Link } from '@/components/Link';
// TODO: replace placeholder URL with real URLs when avaialble
const GOVERNANCE_HELP_URL = 'https://help.dydx.exchange/';
const STAKING_HELP_URL = 'https://help.dydx.exchange/';
// const MIGRATE_HELP_URL = 'https://help.dydx.exchange/';
// const BRIDGE_URL = 'https://bridge.dydx.exchange/';
export const RewardsPage = () => {
const dispatch = useDispatch();
const stringGetter = useStringGetter();
const selectedNetwork = useSelector(getSelectedNetwork);
const { isTablet, isNotTablet } = useBreakpoints();
const chainId = Number(CLIENT_NETWORK_CONFIGS[selectedNetwork].ethereumChainId);
const selectedNetwork = useSelector(getSelectedNetwork);
const { balance } = useAccountBalance({
addressOrDenom: import.meta.env.VITE_V3_TOKEN_ADDRESS,
assetSymbol: 'DYDX',
chainId,
isCosmosChain: false,
});
// const chainId = Number(CLIENT_NETWORK_CONFIGS[selectedNetwork].ethereumChainId);
const tokenBalance = import.meta.env.VITE_V3_TOKEN_ADDRESS ? balance : 0;
// const { balance } = useAccountBalance({
// addressOrDenom: import.meta.env.VITE_V3_TOKEN_ADDRESS,
// assetSymbol: 'DYDX',
// chainId,
// isCosmosChain: false,
// });
// const tokenBalance = import.meta.env.VITE_V3_TOKEN_ADDRESS ? balance : 0;
// TODO: replace placeholder URL with real URLs when avaialble
const MIGRATE_HELP_URL = 'https://help.dydx.exchange/';
const GOVERNANCE_HELP_URL = 'https://help.dydx.exchange/';
const STAKING_HELP_URL = 'https://help.dydx.exchange/';
// const BRIDGE_URL = 'https://bridge.dydx.exchange/';
return (
<Styled.Page>
{isNotTablet ? (
{/* {isNotTablet ? (
<Styled.Migrate>
<Styled.TwoItemRow>
<div>
@ -60,8 +61,7 @@ export const RewardsPage = () => {
{stringGetter({ key: STRING_KEYS.MIGRATE })}
</Styled.MigrateTitle>
<Styled.Description>
Migrate your tokens from Ethereum to dYdX Chain. This will enable you to participate in governance. You will also be able to stake your tokens.
{/* {stringGetter({ key: STRING_KEYS.MIGRATE_DESCRIPTION })} */}
{stringGetter({ key: STRING_KEYS.MIGRATE_DESCRIPTION })}
<Link href={MIGRATE_HELP_URL}>
{stringGetter({ key: STRING_KEYS.LEARN_MORE })}
</Link>
@ -130,7 +130,7 @@ export const RewardsPage = () => {
<Link href={MIGRATE_HELP_URL}>{stringGetter({ key: STRING_KEYS.CLICK_HERE })}</Link>
</Styled.LearnMore>
</Styled.MobileMigrateCard>
)}
)} */}
<Styled.PanelRow>
{isTablet && (
@ -152,7 +152,7 @@ export const RewardsPage = () => {
<Styled.IconButton
action={ButtonAction.Base}
iconName={IconName.Arrow}
onClick={() => dispatch(openDialog({ type: DialogTypes.Keplr }))}
onClick={() => dispatch(openDialog({ type: DialogTypes.ExternalNavKeplr }))}
size={ButtonSize.Small}
/>
</Styled.Row>
@ -169,7 +169,7 @@ export const RewardsPage = () => {
<Styled.IconButton
action={ButtonAction.Base}
iconName={IconName.Arrow}
onClick={() => dispatch(openDialog({ type: DialogTypes.Keplr }))}
onClick={() => dispatch(openDialog({ type: DialogTypes.ExternalNavKeplr }))}
size={ButtonSize.Small}
/>
</Styled.Row>
@ -325,4 +325,4 @@ Styled.LearnMore = styled(Styled.Description)`
Styled.IconButton = styled(IconButton)`
color: var(--color-text-0);
`;
`;

View File

@ -1,107 +0,0 @@
import styled, { type AnyStyledComponent } from 'styled-components';
import { ButtonAction, ButtonSize, ButtonType } from '@/constants/buttons';
import { STRING_KEYS } from '@/constants/localization';
import { useBreakpoints, useStringGetter } from '@/hooks';
import { Button } from '@/components/Button';
import { Dialog, DialogPlacement } from '@/components/Dialog';
import { IconName } from '@/components/Icon';
import { IconButton } from '@/components/IconButton';
import { layoutMixins } from '@/styles/layoutMixins';
type ElementProps = {
setIsOpen: (open: boolean) => void;
};
// TODO: replace placeholder URL with real URLs when avaialble
const KEPLR_DASHBOARD_URL = 'https://testnet.keplr.app/';
const HELP_URL = 'https://help.dydx.exchange/en/articles/2921366-how-do-i-create-an-account-or-sign-up';
export const KeplrDialog = ({ setIsOpen }: ElementProps) => {
const stringGetter = useStringGetter();
const { isTablet } = useBreakpoints();
return (
<Dialog
isOpen
setIsOpen={setIsOpen}
title={stringGetter({ key: STRING_KEYS.HAVE_YOU_EXPORTED })}
placement={isTablet ? DialogPlacement.FullScreen : DialogPlacement.Default}
>
<Styled.Content>
<Styled.Button type={ButtonType.Link} size={ButtonSize.XLarge} href={KEPLR_DASHBOARD_URL}>
<span>
{stringGetter({
key: STRING_KEYS.NAVIGATE_TO_KEPLR,
params: {
STRONG_YES: <strong>{stringGetter({ key: STRING_KEYS.YES })}</strong>,
},
})}
</span>
<Styled.IconButton
action={ButtonAction.Base}
iconName={IconName.Arrow}
size={ButtonSize.XSmall}
/>
</Styled.Button>
<Styled.Button type={ButtonType.Link} size={ButtonSize.XLarge} href={HELP_URL}>
<span>
{stringGetter({
key: STRING_KEYS.LEARN_TO_EXPORT,
params: {
STRONG_NO: <strong>{stringGetter({ key: STRING_KEYS.NO })}</strong>,
},
})}
</span>
<Styled.IconButton
action={ButtonAction.Base}
iconName={IconName.Arrow}
size={ButtonSize.XSmall}
/>
</Styled.Button>
</Styled.Content>
</Dialog>
);
};
const Styled: Record<string, AnyStyledComponent> = {};
Styled.TextToggle = styled.div`
${layoutMixins.stickyFooter}
color: var(--color-accent);
cursor: pointer;
margin-top: auto;
&:hover {
text-decoration: underline;
}
`;
Styled.Content = styled.div`
${layoutMixins.stickyArea0}
--stickyArea0-bottomHeight: 2rem;
--stickyArea0-bottomGap: 1rem;
--stickyArea0-totalInsetBottom: 0.5rem;
${layoutMixins.flexColumn}
gap: 1rem;
`;
Styled.Button = styled(Button)`
--button-font: var(--font-base-book);
--button-padding: 0 1.5rem;
gap: 0;
justify-content: space-between;
`;
Styled.IconButton = styled(IconButton)`
color: var(--color-text-0);
`;