From b87b4917bc550b639a8afb6fa6458a740d9b2587 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nuno=20G=C3=B3is?= Date: Fri, 13 Oct 2023 11:28:24 +0100 Subject: [PATCH] feat: adds a new design to the header icons --- .../common/Notifications/Notifications.tsx | 25 ++++++----- frontend/src/component/menu/Header/Header.tsx | 31 ++++++++----- .../InviteLinkButton/InviteLinkButton.tsx | 9 +++- .../user/UserProfile/UserProfile.tsx | 44 ++++++++++--------- 4 files changed, 64 insertions(+), 45 deletions(-) diff --git a/frontend/src/component/common/Notifications/Notifications.tsx b/frontend/src/component/common/Notifications/Notifications.tsx index 9cdde57f2275..5b5a9c78109d 100644 --- a/frontend/src/component/common/Notifications/Notifications.tsx +++ b/frontend/src/component/common/Notifications/Notifications.tsx @@ -8,6 +8,7 @@ import { ClickAwayListener, Button, Switch, + Tooltip, } from '@mui/material'; import { useNotifications } from 'hooks/api/getters/useNotifications/useNotifications'; import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender'; @@ -170,17 +171,19 @@ export const Notifications = () => { return ( - setShowNotifications(!showNotifications)} - data-testid='NOTIFICATIONS_BUTTON' - disableFocusRipple - > - } - /> - - + + setShowNotifications(!showNotifications)} + data-testid='NOTIFICATIONS_BUTTON' + size='large' + > + } + /> + + + ({ const StyledLink = styled(Link)(({ theme }) => focusable(theme)); -const StyledIconButton = styled(IconButton)(({ theme }) => ({ - ...focusable(theme), +const StyledIconButton = styled(IconButton)<{ + component?: 'a' | 'button'; + href?: string; + target?: string; +}>(({ theme }) => ({ borderRadius: 100, + '&:focus-visible': { + outlineStyle: 'solid', + outlineWidth: 2, + outlineColor: theme.palette.primary.main, + borderRadius: '100%', + }, })); const Header: VFC = () => { @@ -210,29 +219,31 @@ const Header: VFC = () => { } arrow > - + } elseShow={} /> - - {' '} + + } /> - - + { aria-controls={adminRef ? adminId : undefined} aria-expanded={Boolean(adminRef)} size='large' - disableRipple > - ({ const StyledIconButton = styled(IconButton)(({ theme }) => ({ ...focusable(theme), borderRadius: 100, + '&:focus-visible': { + outlineStyle: 'solid', + outlineWidth: 2, + outlineColor: theme.palette.primary.main, + borderRadius: '100%', + }, })); const InviteLinkButton = () => { @@ -34,7 +40,6 @@ const InviteLinkButton = () => { setShowInviteLinkContent(true)} size='large' - disableRipple > diff --git a/frontend/src/component/user/UserProfile/UserProfile.tsx b/frontend/src/component/user/UserProfile/UserProfile.tsx index 962852d84675..9925b4590d76 100644 --- a/frontend/src/component/user/UserProfile/UserProfile.tsx +++ b/frontend/src/component/user/UserProfile/UserProfile.tsx @@ -1,6 +1,5 @@ import { useState } from 'react'; -import { Button, ClickAwayListener, styled } from '@mui/material'; -import KeyboardArrowDownIcon from '@mui/icons-material/KeyboardArrowDown'; +import { ClickAwayListener, IconButton, Tooltip, styled } from '@mui/material'; import { UserProfileContent } from './UserProfileContent/UserProfileContent'; import { IUser } from 'interfaces/user'; import { HEADER_USER_AVATAR } from 'utils/testIds'; @@ -17,19 +16,21 @@ const StyledProfileContainer = styled('div')(({ theme }) => ({ position: 'relative', })); -const StyledButton = styled(Button)(({ theme }) => ({ +const StyledIconButton = styled(IconButton)(({ theme }) => ({ ...focusable(theme), ...flexRow, ...itemsCenter, color: 'inherit', - padding: theme.spacing(0.5, 2), + padding: theme.spacing(1), '&:hover': { backgroundColor: 'transparent', }, -})); - -const StyledIcon = styled(KeyboardArrowDownIcon)(({ theme }) => ({ - color: theme.palette.neutral.main, + '&:focus-visible': { + outlineStyle: 'solid', + outlineWidth: 2, + outlineColor: theme.palette.primary.main, + borderRadius: '100%', + }, })); interface IUserProfileProps { @@ -43,19 +44,20 @@ const UserProfile = ({ profile }: IUserProfileProps) => { return ( setShowProfile(false)}> - setShowProfile((prev) => !prev)} - aria-controls={showProfile ? modalId : undefined} - aria-expanded={showProfile} - color='secondary' - disableRipple - > - - - + + setShowProfile((prev) => !prev)} + aria-controls={showProfile ? modalId : undefined} + aria-expanded={showProfile} + color='secondary' + size='large' + > + + +