diff --git a/moped-editor/src/layouts/DashboardLayout/TopBar.js b/moped-editor/src/layouts/DashboardLayout/TopBar.js index 01972a91c2..72a3bf07e1 100644 --- a/moped-editor/src/layouts/DashboardLayout/TopBar.js +++ b/moped-editor/src/layouts/DashboardLayout/TopBar.js @@ -15,6 +15,7 @@ import MenuIcon from "@material-ui/icons/Menu"; import { LogOut as LogOutIcon } from "react-feather"; import Logo from "src/components/Logo"; import { useUser } from "../../auth/user"; +import emailToInitials from "../../utils/emailToInitials"; const useStyles = makeStyles(() => ({ root: {}, @@ -27,20 +28,6 @@ const TopBar = ({ className, onMobileNavOpen, ...rest }) => { const classes = useStyles(); const { user, logout } = useUser(); - const emailToInitials = email => { - try { - const subdomain = "austintexas.gov"; - if (!email.endsWith(subdomain)) return null; - const [first, last] = email - .replace("azure_ad", "") - .replace(subdomain, "") - .split("."); - return String(first.charAt(0) + last.charAt(0)).toUpperCase(); - } catch { - return null; - } - }; - return (