Skip to content

Commit e9e6577

Browse files
committed
💩(frontend) add a banner to warm about incident
Sh*t code that would be stabilize asap.
1 parent 89031ab commit e9e6577

3 files changed

Lines changed: 74 additions & 3 deletions

File tree

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
import { css } from '@/styled-system/css'
2+
import { RiErrorWarningLine, RiExternalLinkLine } from '@remixicon/react'
3+
import { Text, A } from '@/primitives'
4+
import { useConfig } from '@/api/useConfig'
5+
6+
export const IncidentBanner = () => {
7+
const { data } = useConfig()
8+
9+
if (!data?.feedback?.url) return
10+
11+
return (
12+
<div
13+
className={css({
14+
width: '100%',
15+
backgroundColor: 'error.900',
16+
color: 'error.100',
17+
display: { base: 'none', xs: 'flex' },
18+
justifyContent: 'center',
19+
padding: '0.5rem 0',
20+
})}
21+
>
22+
<div
23+
className={css({
24+
display: 'inline-flex',
25+
gap: '0.5rem',
26+
alignItems: 'center',
27+
})}
28+
>
29+
<RiErrorWarningLine size={20} aria-hidden="true" />
30+
<Text as="p" variant="sm">
31+
Incident hébergeur en cours,{' '}
32+
<span
33+
className={css({
34+
display: { base: 'none', sm: 'inline-block' },
35+
})}
36+
>
37+
déploiement d'urgence
38+
</span>
39+
</Text>
40+
<div
41+
className={css({
42+
display: 'flex',
43+
alignItems: 'center',
44+
gap: 0.25,
45+
})}
46+
>
47+
<A
48+
href={'https://pad.numerique.gouv.fr/s/qcYxMi2nH'}
49+
target="_blank"
50+
size="sm"
51+
>
52+
En savoir plus
53+
</A>
54+
<RiExternalLinkLine size={16} aria-hidden="true" />
55+
</div>
56+
</div>
57+
</div>
58+
)
59+
}

src/frontend/src/features/rooms/livekit/prefabs/VideoConference.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import { useTranslation } from 'react-i18next'
2121

2222
import { ControlBar } from './ControlBar/ControlBar'
2323
import { styled } from '@/styled-system/jsx'
24-
import { cva } from '@/styled-system/css'
24+
import { css, cva } from '@/styled-system/css'
2525
import { MainNotificationToast } from '@/features/notifications/MainNotificationToast'
2626
import { FocusLayout } from '../components/FocusLayout'
2727
import { ParticipantTile } from '../components/ParticipantTile'
@@ -40,6 +40,7 @@ import { GridLayout } from '../components/layout/GridLayout'
4040
import { IsIdleDisconnectModal } from '../components/IsIdleDisconnectModal'
4141
import { getParticipantName } from '@/features/rooms/utils/getParticipantName'
4242
import { useScreenReaderAnnounce } from '@/hooks/useScreenReaderAnnounce'
43+
import { IncidentBanner } from '@/components/IncidentBanner'
4344

4445
const LayoutWrapper = styled(
4546
'div',
@@ -254,6 +255,16 @@ export function VideoConference({ ...props }: VideoConferenceProps) {
254255
overflowX: 'hidden',
255256
}}
256257
>
258+
<div
259+
className={css({
260+
display: 'flex',
261+
width: '100%',
262+
position: 'absolute',
263+
zIndex: '1000',
264+
})}
265+
>
266+
<IncidentBanner />
267+
</div>
257268
{isWeb() && (
258269
<LayoutContextProvider
259270
value={layoutContext}

src/frontend/src/layout/Header.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ import { Button, Text } from '@/primitives'
66
import { SettingsButton } from '@/features/settings'
77
import { useUser } from '@/features/auth'
88
import { useMatchesRoute } from '@/navigation/useMatchesRoute'
9-
import { FeedbackBanner } from '@/components/FeedbackBanner'
109
import { Menu } from '@/primitives/Menu'
1110
import { MenuList } from '@/primitives/MenuList'
1211
import { LoginButton } from '@/components/LoginButton'
1312
import { VisualOnlyTooltip } from '@/primitives/VisualOnlyTooltip'
1413

1514
import { useLoginHint } from '@/hooks/useLoginHint'
15+
import { IncidentBanner } from '@/components/IncidentBanner'
1616

1717
const Logo = () => (
1818
<img
@@ -99,7 +99,8 @@ export const Header = () => {
9999

100100
return (
101101
<>
102-
<FeedbackBanner />
102+
{/*<FeedbackBanner />*/}
103+
<IncidentBanner />
103104
<div
104105
className={css({
105106
paddingBottom: 1,

0 commit comments

Comments
 (0)