added theme icon and login button when user is unauthenticated
This commit is contained in:
parent
f64e5ad231
commit
fc03b8c7b1
1 changed files with 42 additions and 0 deletions
42
src/user/UserTeamName.tsx
Normal file
42
src/user/UserTeamName.tsx
Normal 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>
|
||||
)}
|
||||
</>
|
||||
)
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue