mirror of
https://github.com/Unleash/unleash.git
synced 2024-12-22 19:07:54 +01:00
Fix/show notification state (#3365)
Adds * Missing notification switch state * Fixed width * Notification icon outline
This commit is contained in:
parent
27d48b3437
commit
96da121863
@ -43,7 +43,7 @@ const StyledTypography = styled(Typography)(({ theme }) => ({
|
||||
}));
|
||||
|
||||
const StyledPaper = styled(Paper)(({ theme }) => ({
|
||||
minWidth: '400px',
|
||||
width: '400px',
|
||||
boxShadow: theme.boxShadows.popup,
|
||||
borderRadius: `${theme.shape.borderRadiusLarge}px`,
|
||||
position: 'absolute',
|
||||
@ -71,6 +71,15 @@ const StyledHeaderTypography = styled(Typography)(({ theme }) => ({
|
||||
fontSize: theme.fontSizes.smallerBody,
|
||||
}));
|
||||
|
||||
const StyledIconButton = styled(IconButton)(({ theme }) => ({
|
||||
'&:focus-visible': {
|
||||
outlineStyle: 'solid',
|
||||
outlineWidth: 2,
|
||||
outlineColor: theme.palette.primary.main,
|
||||
borderRadius: '100%',
|
||||
},
|
||||
}));
|
||||
|
||||
export const Notifications = () => {
|
||||
const [showNotifications, setShowNotifications] = useState(false);
|
||||
const { notifications, refetchNotifications } = useNotifications({
|
||||
@ -162,16 +171,17 @@ export const Notifications = () => {
|
||||
|
||||
return (
|
||||
<StyledPrimaryContainerBox>
|
||||
<IconButton
|
||||
<StyledIconButton
|
||||
onClick={() => setShowNotifications(!showNotifications)}
|
||||
data-testid="NOTIFICATIONS_BUTTON"
|
||||
disableFocusRipple
|
||||
>
|
||||
<ConditionallyRender
|
||||
condition={hasUnreadNotifications}
|
||||
show={<StyledDotBox />}
|
||||
/>
|
||||
<NotificationsIcon />
|
||||
</IconButton>
|
||||
</StyledIconButton>
|
||||
|
||||
<ConditionallyRender
|
||||
condition={showNotifications}
|
||||
@ -192,6 +202,7 @@ export const Notifications = () => {
|
||||
onClick={() =>
|
||||
setShowUnread(!showUnread)
|
||||
}
|
||||
checked={showUnread}
|
||||
/>
|
||||
</StyledHeaderBox>
|
||||
</NotificationsHeader>
|
||||
|
Loading…
Reference in New Issue
Block a user