diff --git a/src/app/components/NavBar/__snapshots__/index.spec.tsx.snap b/src/app/components/NavBar/__snapshots__/index.spec.tsx.snap index e10fad3d11..92e6a8f90c 100644 --- a/src/app/components/NavBar/__snapshots__/index.spec.tsx.snap +++ b/src/app/components/NavBar/__snapshots__/index.spec.tsx.snap @@ -180,6 +180,10 @@ exports[`content in browser assignable user renders 1`] = ` box-shadow: 0 0 0.2rem 0.2rem rgba(0,0,0,0.3); } +.c6 svg { + width: 1.5rem; +} + .c6 { display: -webkit-box; display: -webkit-flex; @@ -208,6 +212,10 @@ exports[`content in browser assignable user renders 1`] = ` box-shadow: 0 0 0.2rem 0.2rem rgba(0,0,0,0.3); } +.c6 svg { + width: 1.5rem; +} + .c6 { display: -webkit-box; display: -webkit-flex; @@ -236,6 +244,10 @@ exports[`content in browser assignable user renders 1`] = ` box-shadow: 0 0 0.2rem 0.2rem rgba(0,0,0,0.3); } +.c6 svg { + width: 1.5rem; +} + .c10 { color: #424242; font-size: 1.8rem; @@ -947,7 +959,17 @@ exports[`content in browser assignable user renders 1`] = ` data-testid="user-nav-toggle" tabIndex="0" > - AU + ", + } + } + fill="currentColor" + viewBox="0 0 448 512" + xmlns="http://www.w3.org/2000/svg" + />
= ({ const DropdownToggle: FunctionComponent<{ user: User }> = ({ user: { firstName, lastName }, }) => { - const initials = ((firstName || 'A')[0] + (lastName || 'U')[0]).toUpperCase(); + const renderEl = firstName && lastName ? (firstName[0] + lastName[0]).toUpperCase() : ; return ( = ({ aria-haspopup='true' aria-controls='dropdown-menu' > - {initials} + {renderEl} ); }; diff --git a/src/app/components/NavBar/styled.tsx b/src/app/components/NavBar/styled.tsx index 0dd6d694a5..4e0c30fedf 100644 --- a/src/app/components/NavBar/styled.tsx +++ b/src/app/components/NavBar/styled.tsx @@ -165,6 +165,10 @@ export const DropdownToggle = styled.div` ${theme.breakpoints.mobile(css` margin-top: 0; `)} + + svg { + width: 1.5rem; + } `; // tslint:disable-next-line:variable-name diff --git a/src/assets/UserIcon.tsx b/src/assets/UserIcon.tsx new file mode 100644 index 0000000000..880845376d --- /dev/null +++ b/src/assets/UserIcon.tsx @@ -0,0 +1,16 @@ +import React from "react"; + +// tslint:disable:max-line-length +// tslint:disable-next-line:variable-name +const SvgComponent = () => ( + ` + }} + > +); +export default SvgComponent;