added theme icon and login button when user is unauthenticated

This commit is contained in:
Carter 2024-11-01 11:14:42 -06:00
parent f64e5ad231
commit fc03b8c7b1

42
src/user/UserTeamName.tsx Normal file
View file

@ -0,0 +1,42 @@
import { Theme, Typography } from "@mui/material";
import { User } from "../models/user";
import { makeStyles } from "@mui/styles";
import { getSignatureAccentColour } from "../services/whiteLabel";
import { Team } from "../models/team";
const useStyles = makeStyles((theme: Theme) => ({
profileName: {
whiteSpace: "nowrap",
overflow: "hidden",
textOverflow: "ellipsis",
textTransform: "capitalize",
color: getSignatureAccentColour(),
marginBottom: -3,
marginTop: -3
},
}));
interface Props {
user: User;
team?: Team;
}
export default function UserMenu(props: Props) {
const { user, team } = props;
const hasTeams = user.hasFeature ? user.hasFeature("teams") : false;
const classes = useStyles();
return (
<>
<Typography className={classes.profileName} variant="button">
{user.name()}
</Typography>
{team && team.settings.name && hasTeams && (
<Typography className={classes.profileName} variant="button">
({team.settings.name})
</Typography>
)}
</>
)
}