From 371397b72ef4d6ab7a4ea2bed1593f27d22c12ca Mon Sep 17 00:00:00 2001 From: Bill He Date: Mon, 2 Oct 2023 10:50:05 -0400 Subject: [PATCH] Comment out migration work --- src/constants/dialogs.ts | 2 +- src/layout/DialogManager.tsx | 4 +- src/pages/rewards/RewardsPage.tsx | 46 ++++++------- src/views/dialogs/KeplrDialog.tsx | 107 ------------------------------ 4 files changed, 26 insertions(+), 133 deletions(-) delete mode 100644 src/views/dialogs/KeplrDialog.tsx diff --git a/src/constants/dialogs.ts b/src/constants/dialogs.ts index 1ab8e47..c14c0fb 100644 --- a/src/constants/dialogs.ts +++ b/src/constants/dialogs.ts @@ -5,7 +5,7 @@ export enum DialogTypes { ExchangeOffline = 'ExchangeOffline', FillDetails = 'FillDetails', Help = 'Help', - Keplr = 'Keplr', + ExternalNavKeplr = 'ExternalNavKeplr', MnemonicExport = 'MnemonicExport', MobileSignIn = 'MobileSignIn', Onboarding = 'Onboarding', diff --git a/src/layout/DialogManager.tsx b/src/layout/DialogManager.tsx index 904a02d..4a7d0f0 100644 --- a/src/layout/DialogManager.tsx +++ b/src/layout/DialogManager.tsx @@ -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]: , [DialogTypes.FillDetails]: , [DialogTypes.Help]: , - [DialogTypes.Keplr]: , + [DialogTypes.ExternalNavKeplr]: , [DialogTypes.MnemonicExport]: , [DialogTypes.MobileSignIn]: , [DialogTypes.Onboarding]: , diff --git a/src/pages/rewards/RewardsPage.tsx b/src/pages/rewards/RewardsPage.tsx index 71b69e5..16ea531 100644 --- a/src/pages/rewards/RewardsPage.tsx +++ b/src/pages/rewards/RewardsPage.tsx @@ -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 ( - {isNotTablet ? ( + {/* {isNotTablet ? (
@@ -60,8 +61,7 @@ export const RewardsPage = () => { {stringGetter({ key: STRING_KEYS.MIGRATE })} - 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 })} {stringGetter({ key: STRING_KEYS.LEARN_MORE })} → @@ -130,7 +130,7 @@ export const RewardsPage = () => { {stringGetter({ key: STRING_KEYS.CLICK_HERE })} - )} + )} */} {isTablet && ( @@ -152,7 +152,7 @@ export const RewardsPage = () => { dispatch(openDialog({ type: DialogTypes.Keplr }))} + onClick={() => dispatch(openDialog({ type: DialogTypes.ExternalNavKeplr }))} size={ButtonSize.Small} /> @@ -169,7 +169,7 @@ export const RewardsPage = () => { dispatch(openDialog({ type: DialogTypes.Keplr }))} + onClick={() => dispatch(openDialog({ type: DialogTypes.ExternalNavKeplr }))} size={ButtonSize.Small} /> @@ -325,4 +325,4 @@ Styled.LearnMore = styled(Styled.Description)` Styled.IconButton = styled(IconButton)` color: var(--color-text-0); -`; \ No newline at end of file +`; diff --git a/src/views/dialogs/KeplrDialog.tsx b/src/views/dialogs/KeplrDialog.tsx deleted file mode 100644 index ab81f6e..0000000 --- a/src/views/dialogs/KeplrDialog.tsx +++ /dev/null @@ -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 ( - - - - - {stringGetter({ - key: STRING_KEYS.NAVIGATE_TO_KEPLR, - params: { - STRONG_YES: {stringGetter({ key: STRING_KEYS.YES })}, - }, - })} - - - - - - - - {stringGetter({ - key: STRING_KEYS.LEARN_TO_EXPORT, - params: { - STRONG_NO: {stringGetter({ key: STRING_KEYS.NO })}, - }, - })} - - - - - - - ); -}; - -const Styled: Record = {}; - -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); -`;