From e4b2e83a83d7d44a8f8106c167fd3669b83a726a Mon Sep 17 00:00:00 2001 From: Wan Qi Chen <495709+wa0x6e@users.noreply.github.com> Date: Sun, 24 Nov 2024 13:19:01 +0800 Subject: [PATCH] fix: improve types --- apps/ui/src/types.ts | 9 ++- .../src/views/Settings/EmailNotifications.vue | 65 ++++++++----------- 2 files changed, 35 insertions(+), 39 deletions(-) diff --git a/apps/ui/src/types.ts b/apps/ui/src/types.ts index 450162d03..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' @@ -306,8 +311,8 @@ export type User = { } & Partial; export type EmailSubscription = { - status: string; - subscriptions: string[]; + status: 'NOT_SUBSCRIBED' | 'UNVERIFIED' | 'VERIFIED'; + subscriptions: EmailSubscriptionType[]; }; export type UserActivity = { diff --git a/apps/ui/src/views/Settings/EmailNotifications.vue b/apps/ui/src/views/Settings/EmailNotifications.vue index c56f04342..077f3592f 100644 --- a/apps/ui/src/views/Settings/EmailNotifications.vue +++ b/apps/ui/src/views/Settings/EmailNotifications.vue @@ -1,6 +1,7 @@