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 | 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 3x 3x 5x 5x 5x | import { TabContext, TabPanel } from "@mui/lab"; import { Button, Card, Grid } from "@mui/material"; import HtmlMeta from "components/HtmlMeta"; import PageTitle from "components/PageTitle"; import TabBar from "components/TabBar"; import Link from "next/link"; import { useRouter } from "next/router"; import React from "react"; import { useTranslation } from "react-i18next"; import { EditUserTab, routeToEditProfile, settingsRoute } from "routes"; import makeStyles from "utils/makeStyles"; import EditHostingPreference from "./EditHostingPreference"; import EditProfile from "./EditProfile"; const useStyles = makeStyles((theme) => ({ detailsCard: { [theme.breakpoints.down("md")]: { margin: 0, width: "100%", }, flexGrow: 1, marginRight: 0, padding: theme.spacing(2), }, buttonContainer: { display: "flex", justifyContent: "center", paddingBottom: theme.spacing(1), paddingTop: theme.spacing(1), }, linkStyle: { "&:hover": { textDecoration: "underline", }, color: "inherit", fontSize: "1rem", textDecoration: "none", }, root: { paddingTop: theme.spacing(3), [theme.breakpoints.up("md")]: { paddingTop: 0, display: "flex", }, }, tabPanel: { padding: 0, }, })); export default function EditProfilePage({ tab = "about", }: { tab?: EditUserTab; }) { const { t } = useTranslation(); const classes = useStyles(); const router = useRouter(); return ( <> <HtmlMeta title={t("profile:heading.edit_profile")} /> <Grid container direction="row" justifyContent="space-between" alignItems="center" > <PageTitle>{t("profile:heading.edit_profile")}</PageTitle> <div className={classes.buttonContainer}> <Link href={settingsRoute} passHref legacyBehavior> <Button component="a" variant="contained" color="primary"> {t("global:nav.account_settings")} </Button> </Link> </div> </Grid> <div className={classes.root}> <Card className={classes.detailsCard}> <TabContext value={tab}> <TabBar setValue={(newTab) => router.push(routeToEditProfile(newTab))} labels={{ about: t("profile:heading.about_me"), home: t("profile:heading.home"), }} ariaLabel={t("profile:edit_profile_tab_bar_a11y_label")} /> <TabPanel classes={{ root: classes.tabPanel }} value="about"> <EditProfile /> </TabPanel> <TabPanel value="home"> <EditHostingPreference /> </TabPanel> </TabContext> </Card> </div> </> ); } |