File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
components/sections/profile Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ export default function ProfileHeader() {
62
62
dispatch ( openVerificationModal ( { } ) ) ;
63
63
} ;
64
64
65
- const { canConnectDiscord, triggerDiscordOauth } = useDiscordConnect ( ) ;
65
+ const { canConnectDiscord, triggerDiscordOauth, showKycVerificationButton } = useDiscordConnect ( ) ;
66
66
const discordLink = "https://discord.gg/U38KQHDtHe" ;
67
67
68
68
const iconStyles = "inline-block" ;
@@ -117,7 +117,7 @@ export default function ProfileHeader() {
117
117
{ t ( "profile.header.connect-discord" ) }
118
118
</ Button >
119
119
) }
120
- { ! isKycVerified && (
120
+ { ! isKycVerified && showKycVerificationButton && (
121
121
< Button variant = "outline-primary" className = "flex mx-auto text-base" onClick = { triggerKYCVerification } >
122
122
{ t ( "profile.header.sumsub.verify" ) }
123
123
</ Button >
Original file line number Diff line number Diff line change @@ -37,11 +37,16 @@ export const useDiscordConnect = () => {
37
37
const isCurrentUser = useMemo ( ( ) => username ?. toLowerCase ( ) === authUser ?. displayName ?. toLowerCase ( ) , [ authUser , username ] ) ;
38
38
const canConnectDiscord = useMemo ( ( ) => isCurrentUser && ! user ?. discord ?. connected , [ isCurrentUser , user ] ) ;
39
39
40
+ const showKycVerificationButton = useMemo ( ( ) => {
41
+ return isCurrentUser && ! user ?. isKycVerified ;
42
+ } , [ isCurrentUser , user ?. isKycVerified ] ) ;
43
+
40
44
const triggerDiscordOauth = ( ) =>
41
45
( window . location . href = `${ NEXT_PUBLIC_DISCORD_OAUTH_BASE_URL } ?response_type=code&client_id=${ NEXT_PUBLIC_DISCORD_CLIENT_ID } &scope=${ NEXT_PUBLIC_DISCORD_SCOPE } &state=15773059ghq9183habn&redirect_uri=${ NEXT_PUBLIC_DISCORD_CALLBACK_URL } &prompt=consent` ) ;
42
46
43
47
return {
44
48
canConnectDiscord,
45
49
triggerDiscordOauth,
50
+ showKycVerificationButton,
46
51
} ;
47
52
} ;
You can’t perform that action at this time.
0 commit comments