diff --git a/web/components/notification-settings.tsx b/web/components/notification-settings.tsx index 551e4d73..5dcdf3dd 100644 --- a/web/components/notification-settings.tsx +++ b/web/components/notification-settings.tsx @@ -8,7 +8,6 @@ import { notification_destination_types, } from 'common/user' import { updatePrivateUser } from 'web/lib/firebase/users' -import { Switch } from '@headlessui/react' import { Col } from 'web/components/layout/col' import { CashIcon, @@ -26,6 +25,7 @@ import { import { WatchMarketModal } from 'web/components/contract/watch-market-modal' import { filterDefined } from 'common/util/array' import toast from 'react-hot-toast' +import { SwitchSetting } from 'web/components/switch' export function NotificationSettings(props: { navigateToSection: string | undefined @@ -218,54 +218,18 @@ export function NotificationSettings(props: { {!browserDisabled.includes(key) && ( - - - - - - In-app - - - + )} {emailsEnabled.includes(key) && ( - - - - - - Emails - - - + )} diff --git a/web/components/switch-setting.tsx b/web/components/switch-setting.tsx new file mode 100644 index 00000000..0e93c420 --- /dev/null +++ b/web/components/switch-setting.tsx @@ -0,0 +1,34 @@ +import { Switch } from '@headlessui/react' +import clsx from 'clsx' +import React from 'react' + +export const SwitchSetting = (props: { + checked: boolean + onChange: (checked: boolean) => void + label: string +}) => { + const { checked, onChange, label } = props + return ( + + + + + {label} + + + ) +}