diff --git a/apps/ui/src/components/App/Nav.vue b/apps/ui/src/components/App/Nav.vue index 2791f38fc..b66c736c1 100644 --- a/apps/ui/src/components/App/Nav.vue +++ b/apps/ui/src/components/App/Nav.vue @@ -126,6 +126,11 @@ const navigationConfig = computed< contacts: { name: 'Contacts', icon: IHUsers + }, + 'email-notifications': { + name: 'Email notifications', + icon: IHBell, + hidden: true } }, my: { diff --git a/apps/ui/src/components/Ui/Switch.vue b/apps/ui/src/components/Ui/Switch.vue index e09bef554..36d1e988b 100644 --- a/apps/ui/src/components/Ui/Switch.vue +++ b/apps/ui/src/components/Ui/Switch.vue @@ -4,7 +4,7 @@ import { Switch, SwitchGroup, SwitchLabel } from '@headlessui/vue'; const enabled = defineModel({ required: true }); defineProps<{ - title: string; + title?: string; tooltip?: string; }>(); @@ -26,10 +26,13 @@ defineProps<{ - {{ title }} - - - + + diff --git a/apps/ui/src/networks/offchain/api/queries.ts b/apps/ui/src/networks/offchain/api/queries.ts index 4b018bb86..60827027b 100644 --- a/apps/ui/src/networks/offchain/api/queries.ts +++ b/apps/ui/src/networks/offchain/api/queries.ts @@ -304,6 +304,10 @@ export const USER_QUERY = gql` farcaster votesCount created + emailSubscription { + status + subscriptions + } } } `; diff --git a/apps/ui/src/routes/default.ts b/apps/ui/src/routes/default.ts index 54a51c7a8..aec2914bd 100644 --- a/apps/ui/src/routes/default.ts +++ b/apps/ui/src/routes/default.ts @@ -9,6 +9,7 @@ import My from '@/views/My.vue'; import Network from '@/views/Network.vue'; import Policy from '@/views/Policy.vue'; import Contacts from '@/views/Settings/Contacts.vue'; +import EmailNotifications from '@/views/Settings/EmailNotifications.vue'; import SettingsSpaces from '@/views/Settings/Spaces.vue'; import Settings from '@/views/Settings.vue'; import Site from '@/views/Site.vue'; @@ -45,7 +46,12 @@ export default [ component: Settings, children: [ { path: '', name: 'settings-spaces', component: SettingsSpaces }, - { path: 'contacts', name: 'settings-contacts', component: Contacts } + { path: 'contacts', name: 'settings-contacts', component: Contacts }, + { + path: 'email-notifications', + name: 'settings-email-notifications', + component: EmailNotifications + } ] }, { diff --git a/apps/ui/src/types.ts b/apps/ui/src/types.ts index 88cd8c5a7..34d969652 100644 --- a/apps/ui/src/types.ts +++ b/apps/ui/src/types.ts @@ -4,6 +4,11 @@ import { ApiSpace as OffchainApiSpace } from '@/networks/offchain/api/types'; // UI export type NotificationType = 'error' | 'warning' | 'success'; +export type EmailSubscriptionType = + | 'summary' + | 'newProposal' + | 'closedProposal'; + export type ProposalState = | 'pending' | 'active' @@ -296,6 +301,7 @@ export type UserProfile = { lens: string; farcaster: string; votesCount: number; + emailSubscription: EmailSubscription; }; export type User = { @@ -304,6 +310,11 @@ export type User = { follows?: string[]; } & Partial; +export type EmailSubscription = { + status: 'NOT_SUBSCRIBED' | 'UNVERIFIED' | 'VERIFIED'; + subscriptions: EmailSubscriptionType[]; +}; + export type UserActivity = { id: string; name?: string; diff --git a/apps/ui/src/views/Settings/EmailNotifications.vue b/apps/ui/src/views/Settings/EmailNotifications.vue new file mode 100644 index 000000000..bc6c0776b --- /dev/null +++ b/apps/ui/src/views/Settings/EmailNotifications.vue @@ -0,0 +1,175 @@ + + +