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 | 1x 1x 1x 1x 1x 1x 1x 1x 1x 2x 2x 2x 2x 2x | import { Typography } from "@mui/material"; import HeaderButton from "components/HeaderButton"; import { BackIcon } from "components/Icons"; import { useTranslation } from "i18n"; import { GLOBAL, PROFILE } from "i18n/namespaces"; import { useRouter } from "next/router"; import { ReferenceType } from "proto/references_pb"; import { referenceTypeRoute } from "routes"; import makeStyles from "utils/makeStyles"; export interface ReferenceStepHeaderProps { name?: string; referenceType?: string; isSubmitStep?: boolean; } const useStyles = makeStyles((theme) => ({ header: { alignItems: "center", display: "flex", }, title: { marginInlineStart: theme.spacing(2), }, })); export default function ReferenceStepHeader({ name, referenceType, isSubmitStep = false, }: ReferenceStepHeaderProps) { const { t } = useTranslation([GLOBAL, PROFILE]); const router = useRouter(); const classes = useStyles(); return ( <div className={classes.header}> <HeaderButton onClick={() => router.back()} aria-label={t("profile:leave_reference.previous_step")} > <BackIcon /> </HeaderButton> <Typography variant="h2" className={classes.title}> {isSubmitStep ? t("profile:leave_reference.reference_submit_heading") : referenceType === referenceTypeRoute[ReferenceType.REFERENCE_TYPE_FRIEND] ? t("profile:leave_reference.reference_form_heading_friend", { name, }) : referenceType === referenceTypeRoute[ReferenceType.REFERENCE_TYPE_SURFED] ? t("profile:leave_reference.reference_form_heading_surfed", { name, }) : t("profile:leave_reference.reference_form_heading_hosted", { name, })} </Typography> </div> ); } |