Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 | 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 70x 34x 68x 51x 17x 17x 17x | import {
CheckCircle,
DeleteOutlineOutlined,
EnhancedEncryptionOutlined,
HandshakeOutlined,
PhoneIphoneOutlined,
PhotoLibraryOutlined,
SearchOutlined,
VerifiedUser,
WorkspacePremiumOutlined,
} from "@mui/icons-material";
import { alpha, Box, styled, Typography } from "@mui/material";
import Button from "components/Button";
import StyledLink from "components/StyledLink";
import { GALLERY_MAX_PHOTOS_NOT_VERIFIED, GALLERY_MAX_PHOTOS_VERIFIED } from "features/auth/verification/constants";
import { Trans, useTranslation } from "i18n";
import { AUTH } from "i18n/namespaces";
import Link from "next/link";
import { ReactNode } from "react";
import { helpCenterStrongVerificationDataUrl, irisIdUrl, strongVerificationRoute } from "routes";
import DeleteStrongVerificationDataButton from "./DeleteStrongVerificationDataButton";
import { ActionRow, SectionBlock, SectionRoot, SuccessBanner, VerificationSectionHeader } from "./VerificationSection";
type StrongVerificationSectionProps = {
hasStrongVerification: boolean;
};
/** Auto-fitting grid of small cards; used for both benefits and data notes. */
const CardGrid = styled("div", {
shouldForwardProp: (prop) => prop !== "minColumnWidth",
})<{ minColumnWidth: number }>(({ theme, minColumnWidth }) => ({
display: "grid",
gridTemplateColumns: `repeat(auto-fit, minmax(${minColumnWidth}px, 1fr))`,
gap: theme.spacing(1.25),
}));
const BenefitCard = styled("div")(({ theme }) => ({
display: "flex",
flexDirection: "column",
gap: theme.spacing(0.5),
padding: theme.spacing(1.5),
borderRadius: "8px",
backgroundColor: "var(--mui-palette-background-paper)",
border: "1px solid var(--mui-palette-divider)",
"& .MuiSvgIcon-root": { fontSize: 20, color: "var(--mui-palette-primary-main)" },
}));
const DataNote = styled("div")(({ theme }) => ({
display: "flex",
gap: theme.spacing(1.25),
alignItems: "flex-start",
padding: theme.spacing(1.75),
borderRadius: "8px",
backgroundColor: "var(--mui-palette-grey-50)",
"& .MuiSvgIcon-root": { fontSize: 20, color: "var(--mui-palette-primary-main)" },
}));
function Benefit({ icon, title, description }: { icon: ReactNode; title: string; description: string }) {
return (
<BenefitCard>
{icon}
<Typography variant="h4" component="div">
{title}
</Typography>
<Typography variant="body2" sx={{ color: "var(--mui-palette-text-secondary)" }}>
{description}
</Typography>
</BenefitCard>
);
}
export default function StrongVerificationSection({ hasStrongVerification }: StrongVerificationSectionProps) {
const { t } = useTranslation(AUTH);
return (
<SectionRoot id="strong-verification">
<VerificationSectionHeader
icon={<VerifiedUser />}
iconTint="primary"
title={t("strong_verification.title")}
description={t("verification_page.strong.description")}
status={hasStrongVerification ? "verified" : "not_verified"}
/>
{hasStrongVerification && (
<SuccessBanner>
<CheckCircle />
<Typography variant="body1">{t("verification_page.strong.verified_message")}</Typography>
</SuccessBanner>
)}
<Box
sx={(theme) => ({
display: "flex",
flexDirection: "column",
gap: 1.5,
padding: theme.spacing(2.25),
borderRadius: "10px",
backgroundColor: alpha(theme.palette.primary.main, 0.06),
})}
>
<Typography variant="h3">{t("verification_page.strong.benefits_header")}</Typography>
<CardGrid minColumnWidth={128}>
<Benefit
icon={<PhotoLibraryOutlined />}
title={t("verification_page.strong.benefits.photos_title", { count: GALLERY_MAX_PHOTOS_VERIFIED })}
description={t("verification_page.strong.benefits.photos_description", {
unverified_count: GALLERY_MAX_PHOTOS_NOT_VERIFIED,
})}
/>
<Benefit
icon={<SearchOutlined />}
title={t("verification_page.strong.benefits.visibility_title")}
description={t("verification_page.strong.benefits.visibility_description")}
/>
<Benefit
icon={<WorkspacePremiumOutlined />}
title={t("verification_page.strong.benefits.badge_title")}
description={t("verification_page.strong.benefits.badge_description")}
/>
<Benefit
icon={<HandshakeOutlined />}
title={t("verification_page.strong.benefits.interactions_title")}
description={t("verification_page.strong.benefits.interactions_description")}
/>
</CardGrid>
</Box>
<CardGrid minColumnWidth={240}>
<DataNote>
<PhoneIphoneOutlined />
<Typography variant="body2">
<Trans
t={t}
i18nKey="verification_page.strong.data_notes.third_party"
components={{ irisIdLink: <StyledLink href={irisIdUrl} target="_blank" /> }}
/>
</Typography>
</DataNote>
<DataNote>
<EnhancedEncryptionOutlined />
<Typography variant="body2">
<Trans
t={t}
i18nKey="verification_page.strong.data_notes.encryption"
components={{ fieldsLink: <StyledLink href={helpCenterStrongVerificationDataUrl} target="_blank" /> }}
/>
</Typography>
</DataNote>
<DataNote>
<DeleteOutlineOutlined />
<Typography variant="body2">
<Trans t={t} i18nKey="verification_page.strong.data_notes.deletion" />
</Typography>
</DataNote>
</CardGrid>
{hasStrongVerification ? (
<ActionRow align="center">
<DeleteStrongVerificationDataButton variant="outlined" />
</ActionRow>
) : (
<SectionBlock>
<Box sx={{ display: "flex", flexDirection: "column", gap: 0.75 }}>
<Typography variant="h3">{t("verification_page.strong.requirements_header")}</Typography>
<Box
component="ul"
sx={{
margin: 0,
paddingInlineStart: 2.5,
color: "var(--mui-palette-text-secondary)",
}}
>
<Typography variant="body1" component="li">
{t("verification_page.strong.requirements.passport")}
</Typography>
<Typography variant="body1" component="li">
{t("verification_page.strong.requirements.nfc_phone")}
</Typography>
<Typography variant="body1" component="li">
{t("verification_page.strong.requirements.time")}
</Typography>
</Box>
</Box>
<ActionRow align="center">
<Button component={Link} href={strongVerificationRoute} size="large">
{t("strong_verification.start_button")}
</Button>
<Typography variant="body2" sx={{ color: "var(--mui-palette-text-secondary)" }}>
{t("verification_page.strong.start_hint")}
</Typography>
</ActionRow>
</SectionBlock>
)}
</SectionRoot>
);
}
|