Skip to content

Commit

Permalink
fix: connect social network (#8900)
Browse files Browse the repository at this point in the history
  • Loading branch information
guanbinrui committed Mar 4, 2023
1 parent 6f6f3ca commit 77d073d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 19 deletions.
17 changes: 5 additions & 12 deletions packages/dashboard/src/pages/SignUp/steps/ConnectSocialMedia.tsx
@@ -1,32 +1,25 @@
import { useEffect } from 'react'
import { useNavigate } from 'react-router-dom'
import { upperFirst } from 'lodash-es'
import { DashboardRoutes } from '@masknet/shared-base'
import { Button, Stack } from '@mui/material'
import { SOCIAL_MEDIA_ICON_MAPPING } from '@masknet/shared'
import {
Body,
ColumnContentLayout,
Footer,
PersonaLogoBox,
SignUpAccountLogo,
} from '../../../components/RegisterFrame/ColumnContentLayout.js'
import { useNavigate } from 'react-router-dom'
import { DashboardRoutes } from '@masknet/shared-base'
import { Header } from '../../../components/RegisterFrame/ColumnContentHeader.js'
import { useDashboardI18N } from '../../../locales/index.js'
import { PersonaContext } from '../../Personas/hooks/usePersonaContext.js'
import { upperFirst } from 'lodash-es'
import { Button, Stack } from '@mui/material'
import { SOCIAL_MEDIA_ICON_MAPPING } from '@masknet/shared'
import { ActionCard } from '../../../components/ActionCard/index.js'

export const ConnectSocialMedia = () => {
const navigate = useNavigate()
const t = useDashboardI18N()
const { currentPersona, connectPersona, definedSocialNetworks } = PersonaContext.useContainer()

useEffect(() => {
if (currentPersona && currentPersona?.linkedProfiles.length > 0) {
navigate(DashboardRoutes.Personas, { replace: true })
}
}, [currentPersona])

const handleConnect = async (networkIdentifier: string) => {
if (currentPersona) {
await connectPersona(currentPersona.identifier, networkIdentifier)
Expand Down
Expand Up @@ -60,17 +60,12 @@ export const MnemonicRevealForm = memo(() => {
}

const onConfirm = async () => {
if (!id) {
await create()
}

if (!id) await create()
navigate(`${DashboardRoutes.SignUp}/${SignUpRoutePath.ConnectSocialMedia}`)
}

const onPreview = async (type: 'print' | 'download') => {
if (!id) {
await create()
}
if (!id) await create()

setPreview({
open: true,
Expand Down

0 comments on commit 77d073d

Please sign in to comment.