Wire up notification preferences in settings UI

This commit is contained in:
fullsizemalt 2025-12-26 17:02:23 -08:00
parent 2f905d7173
commit a7ce4d17a1
2 changed files with 22 additions and 27 deletions

View file

@ -244,7 +244,7 @@ export default function SettingsPage() {
<Separator /> <Separator />
<NotificationsSection /> <NotificationsSection preferences={preferences} updatePreferences={updatePreferences} />
<Separator /> <Separator />
@ -307,7 +307,7 @@ export default function SettingsPage() {
</TabsContent> </TabsContent>
<TabsContent value="notifications"> <TabsContent value="notifications">
<NotificationsSection /> <NotificationsSection preferences={preferences} updatePreferences={updatePreferences} />
</TabsContent> </TabsContent>
<TabsContent value="privacy"> <TabsContent value="privacy">
@ -545,7 +545,7 @@ function DisplaySection({ preferences, updatePreferences }: any) {
} }
// Notifications Section // Notifications Section
function NotificationsSection() { function NotificationsSection({ preferences, updatePreferences }: any) {
return ( return (
<Card id="notifications"> <Card id="notifications">
<CardHeader> <CardHeader>
@ -554,46 +554,33 @@ function NotificationsSection() {
Notifications Notifications
</CardTitle> </CardTitle>
<CardDescription> <CardDescription>
Choose what updates you receive Choose what email notifications you receive
</CardDescription> </CardDescription>
</CardHeader> </CardHeader>
<CardContent className="space-y-6"> <CardContent className="space-y-6">
<SettingRow <SettingRow
label="Comment Replies" label="Comment Replies"
description="Get notified when someone replies to your comment" description="Get an email when someone replies to your review or comment"
checked={true} checked={preferences.email_on_reply ?? true}
onChange={() => { }} onChange={(checked: boolean) => updatePreferences({ email_on_reply: checked })}
comingSoon
/> />
<Separator /> <Separator />
<SettingRow <SettingRow
label="New Show Added" label="Chase Song Alerts"
description="Get notified when a new show is added to the archive" description="Get an email when a song on your chase list gets played at a show"
checked={true} checked={preferences.email_on_chase ?? true}
onChange={() => { }} onChange={(checked: boolean) => updatePreferences({ email_on_chase: checked })}
comingSoon
/>
<Separator />
<SettingRow
label="Chase Song Played"
description="Get notified when a song on your chase list gets played"
checked={true}
onChange={() => { }}
comingSoon
/> />
<Separator /> <Separator />
<SettingRow <SettingRow
label="Weekly Digest" label="Weekly Digest"
description="Receive a weekly email with site highlights" description="Receive a weekly email with site highlights and new shows"
checked={false} checked={preferences.email_digest ?? false}
onChange={() => { }} onChange={(checked: boolean) => updatePreferences({ email_digest: checked })}
comingSoon
/> />
</CardContent> </CardContent>
</Card> </Card>

View file

@ -7,6 +7,10 @@ interface Preferences {
wiki_mode: boolean wiki_mode: boolean
show_ratings: boolean show_ratings: boolean
show_comments: boolean show_comments: boolean
theme: string
email_on_reply: boolean
email_on_chase: boolean
email_digest: boolean
} }
interface PreferencesContextType { interface PreferencesContextType {
@ -19,6 +23,10 @@ const defaultPreferences: Preferences = {
wiki_mode: false, wiki_mode: false,
show_ratings: true, show_ratings: true,
show_comments: true, show_comments: true,
theme: "system",
email_on_reply: true,
email_on_chase: true,
email_digest: false,
} }
const PreferencesContext = createContext<PreferencesContextType>({ const PreferencesContext = createContext<PreferencesContextType>({