Skip to content

Commit b2e3aad

Browse files
authored
fix: mf-6639 the first connection or verification (#12140)
* fix: mf-6639 the first connection or verification * fix: run codegen --------- Co-authored-by: swkatmask <[email protected]>
1 parent 94f86fb commit b2e3aad

File tree

13 files changed

+158
-7
lines changed

13 files changed

+158
-7
lines changed

packages/mask/content-script/components/InjectedComponents/SetupGuide/AccountConnectStatus.tsx

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Icons } from '@masknet/icons'
22
import { BindingDialog, LoadingStatus, SOCIAL_MEDIA_ROUND_ICON_MAPPING, type BindingDialogProps } from '@masknet/shared'
3-
import { SOCIAL_MEDIA_NAME } from '@masknet/shared-base'
3+
import { Sniffings, SOCIAL_MEDIA_NAME } from '@masknet/shared-base'
44
import { makeStyles } from '@masknet/theme'
55
import { Box, Button, Typography } from '@mui/material'
66
import { memo } from 'react'
@@ -75,7 +75,7 @@ export const AccountConnectStatus = memo<Props>(function AccountConnectStatus({
7575
const site = activatedSiteAdaptorUI!.networkIdentifier
7676
const siteName = SOCIAL_MEDIA_NAME[site] || ''
7777

78-
const { connected } = SetupGuideContext.useContainer()
78+
const { connected, isFirstConnection, isFirstVerification } = SetupGuideContext.useContainer()
7979

8080
if (loading)
8181
return (
@@ -86,6 +86,35 @@ export const AccountConnectStatus = memo<Props>(function AccountConnectStatus({
8686
</Frame>
8787
)
8888

89+
if (isFirstConnection || isFirstVerification) {
90+
if (Sniffings.is_twitter_page) {
91+
return (
92+
<Frame {...rest}>
93+
<Typography className={classes.text}>
94+
<Trans>Sent verification post successfully.</Trans>
95+
</Typography>
96+
<Typography className={classes.text} mt="1.5em">
97+
<Trans>
98+
You could check the verification result on Mask Pop-up after few minutes. If failed, try
99+
sending verification post again.
100+
</Trans>
101+
</Typography>
102+
</Frame>
103+
)
104+
} else {
105+
return (
106+
<Frame {...rest}>
107+
<Typography className={classes.text}>
108+
<Trans>Connected successfully.</Trans>
109+
</Typography>
110+
<Typography className={classes.text} mt="1.5em">
111+
<Trans>Trying exploring more features powered by Mask Network.</Trans>
112+
</Typography>
113+
</Frame>
114+
)
115+
}
116+
}
117+
89118
if (connected)
90119
return (
91120
<Frame {...rest}>

packages/mask/content-script/components/InjectedComponents/SetupGuide/SetupGuideContext.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ export function useSetupGuideStepInfo(persona?: PersonaIdentifier) {
6363
}, [userId])
6464

6565
const [isFirstConnection, setIsFirstConnection] = useState(false)
66+
const [isFirstVerification, setIsFirstVerification] = useState(false)
6667
const step = useMemo(() => {
6768
if (!setupGuide.status) {
6869
// Should show pin extension when not set
@@ -98,6 +99,8 @@ export function useSetupGuideStepInfo(persona?: PersonaIdentifier) {
9899
personaInfo,
99100
isFirstConnection,
100101
setIsFirstConnection,
102+
isFirstVerification,
103+
setIsFirstVerification,
101104
checkingConnected,
102105
checkingVerified,
103106
verified,

packages/mask/content-script/components/InjectedComponents/SetupGuide/VerifyNextID.tsx

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1+
import { Trans } from '@lingui/react/macro'
12
import { Icons } from '@masknet/icons'
23
import { delay } from '@masknet/kit'
34
import {
45
BindingDialog,
56
EmojiAvatar,
6-
type BindingDialogProps,
7-
useVerifyContent,
87
useBaseUIRuntime,
8+
useVerifyContent,
99
useVerifyNextID,
10+
type BindingDialogProps,
1011
} from '@masknet/shared'
1112
import {
1213
MaskMessages,
@@ -27,7 +28,6 @@ import { AccountConnectStatus } from './AccountConnectStatus.js'
2728
import { SetupGuideContext } from './SetupGuideContext.js'
2829
import { useConnectPersona } from './hooks/useConnectPersona.js'
2930
import { useNotifyConnected } from './hooks/useNotifyConnected.js'
30-
import { Trans } from '@lingui/react/macro'
3131

3232
const useStyles = makeStyles()((theme) => ({
3333
body: {
@@ -157,8 +157,16 @@ export function VerifyNextID({ onClose }: VerifyNextIDProps) {
157157
const { classes, cx } = useStyles()
158158
const queryClient = useQueryClient()
159159

160-
const { userId, myIdentity, personaInfo, checkingVerified, verified, loadingCurrentUserId, currentUserId } =
161-
SetupGuideContext.useContainer()
160+
const {
161+
userId,
162+
myIdentity,
163+
personaInfo,
164+
checkingVerified,
165+
verified,
166+
loadingCurrentUserId,
167+
currentUserId,
168+
setIsFirstVerification,
169+
} = SetupGuideContext.useContainer()
162170
const { nickname: username, avatar } = myIdentity
163171
const personaName = personaInfo?.nickname
164172
const personaIdentifier = personaInfo?.identifier
@@ -197,6 +205,7 @@ export function VerifyNextID({ onClose }: VerifyNextIDProps) {
197205

198206
const isBound = await NextIDProof.queryIsBound(personaInfo.identifier.publicKeyAsHex, nextIdPlatform, userId)
199207
if (!isBound) {
208+
setIsFirstVerification(true)
200209
await handleVerifyNextID(personaInfo, userId)
201210
Telemetry.captureEvent(EventType.Access, EventID.EntryPopupSocialAccountVerifyTwitter)
202211
}

packages/mask/shared-ui/locale/en-US.json

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/mask/shared-ui/locale/en-US.po

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/mask/shared-ui/locale/ja-JP.json

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/mask/shared-ui/locale/ja-JP.po

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/mask/shared-ui/locale/ko-KR.json

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/mask/shared-ui/locale/ko-KR.po

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/mask/shared-ui/locale/zh-CN.json

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)