All files / app/features/dashboard MinimalUserProfileCard.tsx

0% Statements 0/13
100% Branches 0/0
0% Functions 0/2
0% Lines 0/12

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                                                                                                     
import { Card, Link as MuiLink, Typography } from "@material-ui/core";
import Avatar from "components/Avatar";
import { DASHBOARD } from "i18n/namespaces";
import Link from "next/link";
import { useTranslation } from "next-i18next";
import { User } from "proto/api_pb";
import { routeToProfile } from "routes";
import makeStyles from "utils/makeStyles";
 
const useStyles = makeStyles((theme) => ({
  container: {
    display: "flex",
    flexDirection: "row",
    padding: theme.spacing(1, 2),
  },
  textFieldsContainer: {
    display: "flex",
    justifyContent: "flex-end",
    flexGrow: 1,
    paddingLeft: theme.spacing(2),
    overflow: "hidden",
  },
}));
 
export default function MinimalUserProfileCard({
  user,
}: {
  user: User.AsObject;
}) {
  const { t } = useTranslation([DASHBOARD]);
  const classes = useStyles();
  return (
    <Card className={classes.container}>
      <Avatar user={user} />
 
      <div className={classes.textFieldsContainer}>
        <div>
          <Typography noWrap align="right">
            {user.city}
          </Typography>
          <Typography noWrap align="right">
            <Link href={routeToProfile()} passHref>
              <MuiLink>{t("dashboard:profile_mobile_summary_view")}</MuiLink>
            </Link>
          </Typography>
        </div>
      </div>
    </Card>
  );
}