Open source video conferencing app powered by LiveKit. Built with Django and React.
♻️(frontend) refactor notification preferences to use Field switch
lebaudantoine0c3bcd81c90c
diff --git a/src/frontend/src/features/settings/components/tabs/NotificationsTab.tsx b/src/frontend/src/features/settings/components/tabs/NotificationsTab.tsxindex b0d2ed6a..b2134fed 100644--- a/src/frontend/src/features/settings/components/tabs/NotificationsTab.tsx+++ b/src/frontend/src/features/settings/components/tabs/NotificationsTab.tsx@@ -1,5 +1,5 @@import { TabPanel, TabPanelProps } from '@/primitives/Tabs'-import { H, Switch } from '@/primitives'+import { Field, H } from '@/primitives'import { css } from '@/styled-system/css'import { useTranslation } from 'react-i18next'import { useSnapshot } from 'valtio'@@ -23,15 +23,19 @@ export const NotificationsTab = ({ id }: NotificationsTabProps) => {{Array.from(notificationsSnap.soundNotifications).map(([key, value]) => (<li key={key}>- <Switch- aria-label={`${t(`actions.${value ? 'disable' : 'enable'}`)} ${t('label')} "${t(`items.${key}`)}"`}+ <Field+ type="switch"+ aria-label={`${t(`actions.${value ? 'disable' : 'enable'}`)} ${t('label')} "${t(`items.${key}.label`)}"`}+ label={t(`items.${key}.label`)}isSelected={value}onChange={(v) => {notificationsStore.soundNotifications.set(key, v)}}- >- {t(`items.${key}`)}- </Switch>+ wrapperProps={{+ noMargin: true,+ fullWidth: true,+ }}+ /></li>))}diff --git a/src/frontend/src/locales/de/settings.json b/src/frontend/src/locales/de/settings.jsonindex 38370295..873b9994 100644--- a/src/frontend/src/locales/de/settings.json+++ b/src/frontend/src/locales/de/settings.json@@ -76,9 +76,15 @@"enable": "Aktivieren"},"items": {- "participantJoined": "Teilnehmer beigetreten",- "handRaised": "Hand gehoben",- "messageReceived": "Nachricht erhalten"+ "participantJoined": {+ "label": "Teilnehmer beigetreten"+ },+ "handRaised": {+ "label": "Hand gehoben"+ },+ "messageReceived": {+ "label": "Nachricht erhalten"+ }}},"dialog": {diff --git a/src/frontend/src/locales/en/settings.json b/src/frontend/src/locales/en/settings.jsonindex e9cde714..eb7bb294 100644--- a/src/frontend/src/locales/en/settings.json+++ b/src/frontend/src/locales/en/settings.json@@ -76,9 +76,15 @@"enable": "Enable"},"items": {- "participantJoined": "Participant joined",- "handRaised": "Hand raised",- "messageReceived": "Message received"+ "participantJoined": {+ "label": "Participant joined"+ },+ "handRaised": {+ "label": "Hand raised"+ },+ "messageReceived": {+ "label": "Message received"+ }}},"dialog": {diff --git a/src/frontend/src/locales/fr/settings.json b/src/frontend/src/locales/fr/settings.jsonindex 5465b2e6..bc1704e3 100644--- a/src/frontend/src/locales/fr/settings.json+++ b/src/frontend/src/locales/fr/settings.json@@ -76,9 +76,15 @@"enable": "Activer"},"items": {- "participantJoined": "Un nouveau participant",- "handRaised": "Une main levée",- "messageReceived": "Un message reçu"+ "participantJoined": {+ "label": "Un nouveau participant"+ },+ "handRaised": {+ "label": "Une main levée"+ },+ "messageReceived": {+ "label": "Un message reçu"+ }}},"dialog": {diff --git a/src/frontend/src/locales/nl/settings.json b/src/frontend/src/locales/nl/settings.jsonindex 430e7b34..50c34dc7 100644--- a/src/frontend/src/locales/nl/settings.json+++ b/src/frontend/src/locales/nl/settings.json@@ -76,9 +76,15 @@"enable": "Inschakelen"},"items": {- "participantJoined": "Deelnemer is toegevoegd",- "handRaised": "Hand opgestoken",- "messageReceived": "Bericht ontvangen"+ "participantJoined": {+ "label": "Deelnemer is toegevoegd"+ },+ "handRaised": {+ "label": "Hand opgestoken"+ },+ "messageReceived": {+ "label": "Bericht ontvangen"+ }}},"dialog": {