Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions app/web/components/StrongVerificationBadge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import { useTranslation } from "i18n";
import { GLOBAL } from "i18n/namespaces";
import React from "react";

const StyledSpan = styled("span")(({ theme }) => ({
display: "inline-block",
const StyledSpan = styled("span")(() => ({
display: "inline-flex",
alignItems: "center",
verticalAlign: "middle",
marginLeft: theme.spacing(0.5),
}));

export default function StrongVerificationBadge() {
Expand Down
18 changes: 12 additions & 6 deletions app/web/components/UserSummary.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {
Box,
ListItemAvatar,
ListItemText,
Skeleton,
Expand All @@ -17,6 +18,13 @@ import useIsScreenSizeOrSmaller from "utils/useIsScreenSizeOrSmaller";

import StrongVerificationBadge from "./StrongVerificationBadge";

// It could be BlockedUser.AsObject or LiteUser.AsObject and only LiteUser has hasStrongVerification
function isLiteUser(
user: LiteUser.AsObject | BlockedUser.AsObject,
): user is LiteUser.AsObject {
return "hasStrongVerification" in user;
}

const StyledWrapper = styled("div")({
display: "flex",
padding: 0,
Expand Down Expand Up @@ -125,16 +133,14 @@ export default function UserSummary({
sx={{ maxWidth: 300 }}
/>
) : (
<>
<Box sx={{ display: "flex", alignItems: "center", gap: 0.5 }}>
{nameOnly
? nameValue
: `${nameValue}${user && "age" in user ? `, ${user.age}` : ""}`}
{user &&
"hasStrongVerification" in user &&
user.hasStrongVerification ? (
{isLiteUser(user) && user.hasStrongVerification && (
<StrongVerificationBadge />
) : null}
</>
)}
</Box>
)}
</Typography>
</Tooltip>
Expand Down
8 changes: 3 additions & 5 deletions app/web/features/profile/view/UserOverview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,9 @@ export default function UserOverview({
)}

<StyledWrapper>
<StyledIntro variant="h1">
<span>
{user.name}
{user.hasStrongVerification ? <StrongVerificationBadge /> : null}
</span>
<StyledIntro variant="h1" gap={0.5}>
{user.name}
{user.hasStrongVerification && <StrongVerificationBadge />}
</StyledIntro>
<StyledLink
href={routeToUser(user.username)}
Expand Down
2 changes: 2 additions & 0 deletions app/web/features/search/SeachResultUserCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { FlexboxProps, useMediaQuery } from "@mui/system";
import Avatar from "components/Avatar";
import { OpenInNewIcon } from "components/Icons";
import ProfileLink from "components/ProfileLink/ProfileLink";
import StrongVerificationBadge from "components/StrongVerificationBadge";
import StyledLink from "components/StyledLink";
import { useImpressionRef, useLogEvent } from "features/analytics/hooks";
import { useSearchAnalytics } from "features/analytics/searchAnalyticsContext";
Expand Down Expand Up @@ -293,6 +294,7 @@ const SearchResultUserCard = ({
{user.name}
</Typography>
</ProfileLink>
{user.hasStrongVerification && <StrongVerificationBadge />}
</FlexRow>
{!isNativeEmbed && !isMobile && (
<StyledLink
Expand Down
Loading