diff --git a/src/frontend/components/Button/ButtonLayout/index.tsx b/src/frontend/components/Button/ButtonLayout/index.tsx index d07c4a01c4..7db514285a 100644 --- a/src/frontend/components/Button/ButtonLayout/index.tsx +++ b/src/frontend/components/Button/ButtonLayout/index.tsx @@ -20,6 +20,12 @@ const IconBox = styled(Box)` text-align: center; `; +const BadgeBox = styled(Box)` + bottom: 15px; + left: 25px; + position: relative; +`; + const TextBox = styled(Box)` display: flex; margin-top: 6px; @@ -77,7 +83,9 @@ export const ButtonLayout = ({ {Icon && ( - {badge} + + {badge} + )} diff --git a/src/frontend/components/LiveControls/BadgeNotification/index.tsx b/src/frontend/components/LiveControls/BadgeNotification/index.tsx new file mode 100644 index 0000000000..515f8bc596 --- /dev/null +++ b/src/frontend/components/LiveControls/BadgeNotification/index.tsx @@ -0,0 +1,33 @@ +import { Box, Text } from 'grommet'; +import React from 'react'; +import styled from 'styled-components'; + +const StyledText = styled(Text)` + font-family: 'Roboto-Bold'; +`; + +interface BadgeNotificationProps { + color: string; + nbrOfNotifications: number; +} +export const BadgeNotification = ({ + color, + nbrOfNotifications, +}: BadgeNotificationProps) => { + return ( + + + {nbrOfNotifications} + + + ); +}; diff --git a/src/frontend/components/LiveControls/ViewersWrapper/StudentHideViewersButton/__image_snapshots__/index-spec-tsx-student-hide-viewers-button-closes-the-panel-and-select-viewers-item-1-snap.png b/src/frontend/components/LiveControls/ViewersWrapper/StudentHideViewersButton/__image_snapshots__/index-spec-tsx-student-hide-viewers-button-closes-the-panel-and-select-viewers-item-1-snap.png new file mode 100644 index 0000000000..29d2e18fc0 Binary files /dev/null and b/src/frontend/components/LiveControls/ViewersWrapper/StudentHideViewersButton/__image_snapshots__/index-spec-tsx-student-hide-viewers-button-closes-the-panel-and-select-viewers-item-1-snap.png differ diff --git a/src/frontend/components/LiveControls/ViewersWrapper/StudentHideViewersButton/index.tsx b/src/frontend/components/LiveControls/ViewersWrapper/StudentHideViewersButton/index.tsx index 71309827c4..123b9bd4a5 100644 --- a/src/frontend/components/LiveControls/ViewersWrapper/StudentHideViewersButton/index.tsx +++ b/src/frontend/components/LiveControls/ViewersWrapper/StudentHideViewersButton/index.tsx @@ -2,6 +2,7 @@ import React from 'react'; import { defineMessages, useIntl } from 'react-intl'; import { Button } from 'components/Button'; +import { BadgeNotification } from 'components/LiveControls/BadgeNotification'; import { ViewersSVG } from 'components/SVGIcons/ViewersSVG'; import { useLivePanelState } from 'data/stores/useLivePanelState'; @@ -18,7 +19,13 @@ const messages = defineMessages({ }, }); -export const StudentHideViewersButton = () => { +interface StudentHideViewersButtonProps { + nbrOfOnStageRequests?: number; +} + +export const StudentHideViewersButton = ({ + nbrOfOnStageRequests, +}: StudentHideViewersButtonProps) => { const intl = useIntl(); const { setPanelVisibility } = useLivePanelState((state) => ({ setPanelVisibility: state.setPanelVisibility, @@ -27,6 +34,14 @@ export const StudentHideViewersButton = () => { return (