Skip to content

Commit 8da37f2

Browse files
authored
Merge pull request #984 from dacadeorg/fix/show-verify-button-for-current-user-only
fix: show the KYC verify button only when viewing own profile
2 parents f8415bf + c401e42 commit 8da37f2

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/components/sections/profile/Header.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,12 @@ export default function ProfileHeader() {
5757

5858
const username = useMemo(() => user?.displayName, [user?.displayName]);
5959

60+
const isCurrentUser = useMemo(() => username?.toLowerCase() === authUser?.displayName?.toLowerCase(), [authUser, username]);
61+
62+
const showKycVerificationButton = useMemo(() => {
63+
return isCurrentUser && !isKycVerified;
64+
}, [isCurrentUser, isKycVerified]);
65+
6066
const dispatch = useDispatch();
6167
const triggerKYCVerification = () => {
6268
dispatch(openVerificationModal({}));
@@ -117,7 +123,7 @@ export default function ProfileHeader() {
117123
{t("profile.header.connect-discord")}
118124
</Button>
119125
)}
120-
{!isKycVerified && (
126+
{!isKycVerified && showKycVerificationButton && (
121127
<Button variant="outline-primary" className="flex mx-auto text-base" onClick={triggerKYCVerification}>
122128
{t("profile.header.sumsub.verify")}
123129
</Button>

0 commit comments

Comments
 (0)