hide profile page from onboarding until its farther along
This commit is contained in:
parent
581c02d0c6
commit
72191f62ef
|
@ -53,6 +53,8 @@ const Layout = ({ children }: { children: ReactNode }) => {
|
|||
useEffect(() => {
|
||||
if (connected && isOnboarded && !loadingMangoAccount && !mangoAccount) {
|
||||
setShowFirstAccountModal(true)
|
||||
} else {
|
||||
setShowFirstAccountModal(false)
|
||||
}
|
||||
}, [connected, isOnboarded, loadingMangoAccount, mangoAccount])
|
||||
|
||||
|
|
|
@ -31,10 +31,8 @@ const CloseAccountModal = ({ isOpen, onClose }: ModalProps) => {
|
|||
txid: tx,
|
||||
})
|
||||
set((state) => {
|
||||
state.mangoAccount.loading = true
|
||||
state.mangoAccount.current = undefined
|
||||
})
|
||||
setTimeout(() => wallet?.adapter?.disconnect(), 1000)
|
||||
}
|
||||
} catch (e) {
|
||||
setLoading(false)
|
||||
|
|
|
@ -29,8 +29,8 @@ const UserSetupModal = ({ isOpen, onClose }: ModalProps) => {
|
|||
const mangoAccountLoading = mangoStore((s) => s.mangoAccount.loading)
|
||||
const [accountName, setAccountName] = useState('')
|
||||
const [loadingAccount, setLoadingAccount] = useState(false)
|
||||
const [profileName, setProfileName] = useState('')
|
||||
const [profileCategory, setProfileCategory] = useState('')
|
||||
// const [profileName, setProfileName] = useState('')
|
||||
// const [profileCategory, setProfileCategory] = useState('')
|
||||
const [showSetupStep, setShowSetupStep] = useState(0)
|
||||
// const [acceptRisks, setAcceptRisks] = useState(false)
|
||||
const [depositToken, setDepositToken] = useState('')
|
||||
|
@ -44,7 +44,6 @@ const UserSetupModal = ({ isOpen, onClose }: ModalProps) => {
|
|||
|
||||
const handleSaveProfile = () => {
|
||||
// save profile details to db then:
|
||||
|
||||
setShowSetupStep(2)
|
||||
}
|
||||
|
||||
|
@ -75,7 +74,7 @@ const UserSetupModal = ({ isOpen, onClose }: ModalProps) => {
|
|||
// actions.fetchMangoAccounts(wallet!.adapter as unknown as Wallet)
|
||||
if (tx) {
|
||||
setLoadingAccount(false)
|
||||
setShowSetupStep(4)
|
||||
setShowSetupStep(3)
|
||||
notify({
|
||||
title: t('new-account-success'),
|
||||
type: 'success',
|
||||
|
@ -231,7 +230,7 @@ const UserSetupModal = ({ isOpen, onClose }: ModalProps) => {
|
|||
}}
|
||||
key={w.adapter.name}
|
||||
>
|
||||
<div className="flex items-center">
|
||||
<div className="flex items-center text-th-fgd-4">
|
||||
<img
|
||||
src={w.adapter.icon}
|
||||
className="mr-2 h-5 w-5"
|
||||
|
@ -249,7 +248,7 @@ const UserSetupModal = ({ isOpen, onClose }: ModalProps) => {
|
|||
</div>
|
||||
)}
|
||||
</EnterRightExitLeft>
|
||||
<EnterRightExitLeft
|
||||
{/* <EnterRightExitLeft
|
||||
className="absolute top-0.5 left-0 z-20 w-full bg-th-bkg-1 p-6"
|
||||
show={showSetupStep === 2}
|
||||
style={{ height: 'calc(100% - 12px)' }}
|
||||
|
@ -296,10 +295,10 @@ const UserSetupModal = ({ isOpen, onClose }: ModalProps) => {
|
|||
<LinkButton onClick={handleNextStep}>Skip for now</LinkButton>
|
||||
</div>
|
||||
</div>
|
||||
</EnterRightExitLeft>
|
||||
</EnterRightExitLeft> */}
|
||||
<EnterRightExitLeft
|
||||
className="absolute top-0.5 left-0 z-20 w-full bg-th-bkg-1 p-6"
|
||||
show={showSetupStep === 3}
|
||||
show={showSetupStep === 2}
|
||||
style={{ height: 'calc(100% - 12px)' }}
|
||||
>
|
||||
{loadingAccount ? (
|
||||
|
@ -342,7 +341,7 @@ const UserSetupModal = ({ isOpen, onClose }: ModalProps) => {
|
|||
</EnterRightExitLeft>
|
||||
<EnterRightExitLeft
|
||||
className="absolute top-0.5 left-0 z-20 w-full bg-th-bkg-1 p-6"
|
||||
show={showSetupStep === 4}
|
||||
show={showSetupStep === 3}
|
||||
style={{ height: 'calc(100% - 12px)' }}
|
||||
>
|
||||
{submitDeposit ? (
|
||||
|
|
|
@ -6,6 +6,7 @@ import { useTranslation } from 'next-i18next'
|
|||
import uniqBy from 'lodash/uniqBy'
|
||||
import { notify } from '../../utils/notifications'
|
||||
import WalletSelect from './WalletSelect'
|
||||
import mangoStore from '../../store/state'
|
||||
|
||||
export const handleWalletConnect = (wallet: Wallet) => {
|
||||
if (!wallet) {
|
||||
|
@ -47,7 +48,11 @@ export const ConnectWalletButton: React.FC = () => {
|
|||
}, [wallets, installedWallets])
|
||||
|
||||
const handleConnect = useCallback(() => {
|
||||
const set = mangoStore.getState().set
|
||||
if (wallet) {
|
||||
set((state) => {
|
||||
state.mangoAccount.loading = true
|
||||
})
|
||||
handleWalletConnect(wallet)
|
||||
}
|
||||
}, [wallet])
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
|
||||
"@blockworks-foundation/mango-v4@git+https://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:x-oauth-basic@github.com/blockworks-foundation/mango-v4.git#main":
|
||||
version "0.0.1-beta.1"
|
||||
resolved "git+https://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:x-oauth-basic@github.com/blockworks-foundation/mango-v4.git#a9c4f549171395bb8d32659e2c6803e43f1664d5"
|
||||
resolved "git+https://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:x-oauth-basic@github.com/blockworks-foundation/mango-v4.git#3c06b718c6faaee861fdbc734399aa72547e8a5c"
|
||||
dependencies:
|
||||
"@project-serum/anchor" "^0.25.0"
|
||||
"@project-serum/serum" "^0.13.65"
|
||||
|
|
Loading…
Reference in New Issue