show create account message and hide tips

This commit is contained in:
saml33 2022-06-22 21:45:43 +10:00
parent 2942b7ad7d
commit 9ce2e1aa83
6 changed files with 51 additions and 27 deletions

View File

@ -5,9 +5,9 @@ import Button from './Button'
import useLocalStorageState from '../hooks/useLocalStorageState' import useLocalStorageState from '../hooks/useLocalStorageState'
import { useTranslation } from 'next-i18next' import { useTranslation } from 'next-i18next'
import Checkbox from './Checkbox' import Checkbox from './Checkbox'
import { SHOW_TOUR_KEY } from './IntroTips' // import { SHOW_TOUR_KEY } from './IntroTips'
import { useViewport } from '../hooks/useViewport' // import { useViewport } from '../hooks/useViewport'
import { breakpoints } from './TradePageGrid' // import { breakpoints } from './TradePageGrid'
import { useRouter } from 'next/router' import { useRouter } from 'next/router'
import { LANGS } from './SettingsModal' import { LANGS } from './SettingsModal'
import { RadioGroup } from '@headlessui/react' import { RadioGroup } from '@headlessui/react'
@ -24,13 +24,13 @@ const AlphaModal = ({
const { t } = useTranslation('common') const { t } = useTranslation('common')
const [acceptRisks, setAcceptRisks] = useState(false) const [acceptRisks, setAcceptRisks] = useState(false)
const [, setAlphaAccepted] = useLocalStorageState(ALPHA_MODAL_KEY, false) const [, setAlphaAccepted] = useLocalStorageState(ALPHA_MODAL_KEY, false)
const [, setShowTips] = useLocalStorageState(SHOW_TOUR_KEY, false) // const [, setShowTips] = useLocalStorageState(SHOW_TOUR_KEY, false)
const [savedLanguage, setSavedLanguage] = useLocalStorageState('language', '') const [savedLanguage, setSavedLanguage] = useLocalStorageState('language', '')
const [language, setLanguage] = useState('en') const [language, setLanguage] = useState('en')
const router = useRouter() const router = useRouter()
const { pathname, asPath, query } = router const { pathname, asPath, query } = router
const { width } = useViewport() // const { width } = useViewport()
const hideTips = width ? width < breakpoints.md : false // const hideTips = width ? width < breakpoints.md : false
const handleLanguageSelect = () => { const handleLanguageSelect = () => {
setSavedLanguage(language) setSavedLanguage(language)
@ -41,10 +41,10 @@ const AlphaModal = ({
setAlphaAccepted(true) setAlphaAccepted(true)
} }
const handleTakeTour = () => { // const handleTakeTour = () => {
setAlphaAccepted(true) // setAlphaAccepted(true)
setShowTips(true) // setShowTips(true)
} // }
return ( return (
<Modal isOpen={isOpen} onClose={onClose} hideClose> <Modal isOpen={isOpen} onClose={onClose} hideClose>
@ -104,7 +104,7 @@ const AlphaModal = ({
> >
{t('get-started')} {t('get-started')}
</Button> </Button>
{!hideTips ? ( {/* {!hideTips ? (
<Button <Button
className="w-40" className="w-40"
disabled={!acceptRisks} disabled={!acceptRisks}
@ -112,7 +112,7 @@ const AlphaModal = ({
> >
{t('show-tips')} {t('show-tips')}
</Button> </Button>
) : null} ) : null} */}
</div> </div>
</> </>
) : ( ) : (

View File

@ -88,33 +88,49 @@ const Layout = ({ children }) => {
: abbreviateAddress(mangoAccount.publicKey) : abbreviateAddress(mangoAccount.publicKey)
}`} }`}
</span> </span>
) : null ) : (
<span className="flex items-center text-th-fgd-3">
{t('create-account-helper')}
<ArrowRightIcon className="sideways-bounce ml-2 h-5 w-5 text-th-fgd-1" />
</span>
)
) : ( ) : (
<div className="h-4 w-28 animate-pulse rounded bg-th-bkg-3" /> <div className="h-4 w-28 animate-pulse rounded bg-th-bkg-3" />
) )
) : !isMobile ? ( ) : !isMobile ? (
<span className="flex items-center text-th-fgd-3"> <span className="flex items-center text-th-fgd-3">
Connect to get started {t('connect-helper')}
<ArrowRightIcon className="sideways-bounce ml-2 h-5 w-5 text-th-fgd-1" /> <ArrowRightIcon className="sideways-bounce ml-2 h-5 w-5 text-th-fgd-1" />
</span> </span>
) : null} ) : null}
</div> </div>
)} )}
<div className="flex items-center space-x-4"> <div className="flex items-center space-x-4">
{mangoAccount && canWithdraw && !isMobile ? ( {!isMobile && connected && !initialLoad ? (
<div className="flex space-x-2"> <div className="flex space-x-2">
{mangoAccount ? (
<Button <Button
className="flex h-8 w-24 items-center justify-center pl-3 pr-3 text-xs" className="flex h-8 w-24 items-center justify-center pl-3 pr-3 text-xs"
onClick={() => setShowDepositModal(true)} onClick={() => setShowDepositModal(true)}
> >
{t('deposit')} {t('deposit')}
</Button> </Button>
) : (
<Button <Button
className="flex h-8 w-24 items-center justify-center border border-th-fgd-4 bg-transparent pl-3 pr-3 text-xs" className="flex h-8 w-32 items-center justify-center pl-3 pr-3 text-xs"
onClick={() => setShowAccountsModal(true)}
>
{t('create-account')}
</Button>
)}
{canWithdraw ? (
<Button
className="flex h-8 items-center justify-center border border-th-fgd-4 bg-transparent pl-3 pr-3 text-xs"
onClick={() => setShowWithdrawModal(true)} onClick={() => setShowWithdrawModal(true)}
> >
{t('withdraw')} {t('withdraw')}
</Button> </Button>
) : null}
</div> </div>
) : null} ) : null}
<IconButton <IconButton

View File

@ -83,6 +83,7 @@
"confirm-withdraw": "Confirm Withdraw", "confirm-withdraw": "Confirm Withdraw",
"confirming-transaction": "Confirming Transaction", "confirming-transaction": "Confirming Transaction",
"connect": "Connect", "connect": "Connect",
"connect-helper": "Connect to get started",
"connect-view": "Connect a wallet to view your account", "connect-view": "Connect a wallet to view your account",
"connect-wallet": "Connect Wallet", "connect-wallet": "Connect Wallet",
"connect-wallet-tip-desc": "We'll show you around...", "connect-wallet-tip-desc": "We'll show you around...",
@ -92,6 +93,7 @@
"country-not-allowed": "Country {{country}} Not Allowed", "country-not-allowed": "Country {{country}} Not Allowed",
"country-not-allowed-tooltip": "You are using an open-source frontend facilitated by the Mango DAO. As such, it restricts access to certain regions out of an abundance of caution, due to regulatory uncertainty.", "country-not-allowed-tooltip": "You are using an open-source frontend facilitated by the Mango DAO. As such, it restricts access to certain regions out of an abundance of caution, due to regulatory uncertainty.",
"create-account": "Create Account", "create-account": "Create Account",
"create-account-helper": "Create an account to start trading",
"current-stats": "Current Stats", "current-stats": "Current Stats",
"custom": "Custom", "custom": "Custom",
"daily-change": "Daily Change", "daily-change": "Daily Change",

View File

@ -83,6 +83,7 @@
"confirm-withdraw": "Confirmar retiro", "confirm-withdraw": "Confirmar retiro",
"confirming-transaction": "Confirmando transacción", "confirming-transaction": "Confirmando transacción",
"connect": "Conectar", "connect": "Conectar",
"connect-helper": "Connect to get started",
"connect-view": "Conecte una billetera para ver su cuenta", "connect-view": "Conecte una billetera para ver su cuenta",
"connect-wallet": "Conecte una billetera", "connect-wallet": "Conecte una billetera",
"connect-wallet-tip-desc": "Te mostraremos los alrededores...", "connect-wallet-tip-desc": "Te mostraremos los alrededores...",
@ -92,6 +93,7 @@
"country-not-allowed": "País no permitido", "country-not-allowed": "País no permitido",
"country-not-allowed-tooltip": "Está utilizando una interfaz de código abierto facilitada por Mango DAO. Como tal, restringe el acceso a ciertas regiones por precaución, debido a la incertidumbre regulatoria.", "country-not-allowed-tooltip": "Está utilizando una interfaz de código abierto facilitada por Mango DAO. Como tal, restringe el acceso a ciertas regiones por precaución, debido a la incertidumbre regulatoria.",
"create-account": "Crear cuenta", "create-account": "Crear cuenta",
"create-account-helper": "Create an account to start trading",
"current-stats": "Estadísticas actuales", "current-stats": "Estadísticas actuales",
"custom": "Personalizada", "custom": "Personalizada",
"daily-change": "Cambio diario", "daily-change": "Cambio diario",

View File

@ -83,6 +83,7 @@
"confirm-withdraw": "确认取款", "confirm-withdraw": "确认取款",
"confirming-transaction": "正在确认交易...", "confirming-transaction": "正在确认交易...",
"connect": "连结", "connect": "连结",
"connect-helper": "Connect to get started",
"connect-view": "连结钱包而看帐户状态", "connect-view": "连结钱包而看帐户状态",
"connect-wallet": "连结钱包", "connect-wallet": "连结钱包",
"connect-wallet-tip-desc": "我们会带你四处看看...", "connect-wallet-tip-desc": "我们会带你四处看看...",
@ -92,6 +93,7 @@
"country-not-allowed": "您的国家{{country}}不允许", "country-not-allowed": "您的国家{{country}}不允许",
"country-not-allowed-tooltip": "您正在使用MangoDAO提供的开源介面。由于监管的不确定性因此处于谋些地区的人的行动会受到限制。", "country-not-allowed-tooltip": "您正在使用MangoDAO提供的开源介面。由于监管的不确定性因此处于谋些地区的人的行动会受到限制。",
"create-account": "创建帐户", "create-account": "创建帐户",
"create-account-helper": "Create an account to start trading",
"current-stats": "当前统计", "current-stats": "当前统计",
"custom": "自定义", "custom": "自定义",
"daily-change": "一日间变动", "daily-change": "一日间变动",

View File

@ -83,6 +83,7 @@
"confirm-withdraw": "確認取款", "confirm-withdraw": "確認取款",
"confirming-transaction": "正在確認交易...", "confirming-transaction": "正在確認交易...",
"connect": "連結", "connect": "連結",
"connect-helper": "Connect to get started",
"connect-view": "連結錢包而看帳戶狀態", "connect-view": "連結錢包而看帳戶狀態",
"connect-wallet": "連結錢包", "connect-wallet": "連結錢包",
"connect-wallet-tip-desc": "我們會帶你四處看看...", "connect-wallet-tip-desc": "我們會帶你四處看看...",
@ -92,6 +93,7 @@
"country-not-allowed": "您的國家{{country}}不允許", "country-not-allowed": "您的國家{{country}}不允許",
"country-not-allowed-tooltip": "您正在使用MangoDAO提供的開源介面。由於監管的不確定性因此處於謀些地區的人的行動會受到限制。", "country-not-allowed-tooltip": "您正在使用MangoDAO提供的開源介面。由於監管的不確定性因此處於謀些地區的人的行動會受到限制。",
"create-account": "創建帳戶", "create-account": "創建帳戶",
"create-account-helper": "Create an account to start trading",
"current-stats": "當前統計", "current-stats": "當前統計",
"custom": "自定義", "custom": "自定義",
"daily-change": "一日間變動", "daily-change": "一日間變動",