Skip to content

Commit

Permalink
feat: Contrast and both initials for user avatar (#2863)
Browse files Browse the repository at this point in the history
  • Loading branch information
ianjon3s authored Mar 6, 2024
1 parent 92f2046 commit 90c249a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion editor.planx.uk/src/components/Header.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ describe("Header Component - Editor Route", () => {

it("displays avatar and settings", () => {
setup(<Header />);
expect(screen.getByText("T")).toBeInTheDocument();
expect(screen.getByText("TU")).toBeInTheDocument();
expect(screen.getByLabelText("Toggle Menu")).toBeInTheDocument();
});

Expand Down
12 changes: 11 additions & 1 deletion editor.planx.uk/src/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import Visibility from "@mui/icons-material/Visibility";
import AppBar from "@mui/material/AppBar";
import Avatar from "@mui/material/Avatar";
import Box from "@mui/material/Box";
import { grey } from '@mui/material/colors';
import Container from "@mui/material/Container";
import IconButton from "@mui/material/IconButton";
import Link from "@mui/material/Link";
Expand Down Expand Up @@ -453,7 +454,16 @@ const EditorToolbar: React.FC<{
</IconButton>
)}
<Box mr={1}>
<Avatar>{user.firstName[0]}</Avatar>
<Avatar
sx={{
bgcolor: grey[200],
color: "text.primary",
fontSize: "1em",
fontWeight: "600",
}}
>
{user.firstName[0]}{user.lastName[0]}
</Avatar>
</Box>
<IconButton
edge="end"
Expand Down

0 comments on commit 90c249a

Please sign in to comment.