Skip to content

Commit 88c94ab

Browse files
committed
Notifications "final"
1 parent bc8a25d commit 88c94ab

2 files changed

Lines changed: 29 additions & 11 deletions

File tree

app/settings.tsx

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export default function SettingsScreen() {
1616

1717
return settings;
1818

19-
}, { client: true, server: true, oxide: true, carbon: true });
19+
}, { clientUpdates: true, serverUpdates: true, oxideUpdates: true, carbonUpdates: true, protocolUpdates: true });
2020

2121
useEffect(() => {
2222

@@ -33,24 +33,28 @@ export default function SettingsScreen() {
3333
</Link>
3434
</View>
3535
<Separator className="my-4" />
36-
<View className="bg-zinc-900 rounded-md pb-2 pt-4 px-4">
36+
<View className="bg-zinc-900 rounded-md p-4">
3737
<Text className="text-xl">Notifications</Text>
3838
<Separator className="mt-4 mb-2" />
3939
<View className="mt-4 flex flex-row justify-between items-center">
4040
<Text>Client Updates</Text>
41-
<Switch value={notifications.client} onChange={() => setNotifications({ client: !notifications.client })} />
41+
<Switch value={notifications.clientUpdates} onChange={() => setNotifications({ clientUpdates: !notifications.clientUpdates })} />
4242
</View>
4343
<View className="mt-4 flex flex-row justify-between items-center">
4444
<Text>Server Updates</Text>
45-
<Switch value={notifications.server} onChange={() => setNotifications({ server: !notifications.server })} />
45+
<Switch value={notifications.serverUpdates} onChange={() => setNotifications({ serverUpdates: !notifications.serverUpdates })} />
4646
</View>
4747
<View className="mt-4 flex flex-row justify-between items-center">
4848
<Text>Oxide Updates</Text>
49-
<Switch value={notifications.oxide} onChange={() => setNotifications({ oxide: !notifications.oxide })} />
49+
<Switch value={notifications.oxideUpdates} onChange={() => setNotifications({ oxideUpdates: !notifications.oxideUpdates })} />
5050
</View>
5151
<View className="mt-4 flex flex-row justify-between items-center">
5252
<Text>Carbon Updates</Text>
53-
<Switch value={notifications.carbon} onChange={() => setNotifications({ carbon: !notifications.carbon })} />
53+
<Switch value={notifications.carbonUpdates} onChange={() => setNotifications({ carbonUpdates: !notifications.carbonUpdates })} />
54+
</View>
55+
<View className="mt-4 flex flex-row justify-between items-center">
56+
<Text>Protocol Updates</Text>
57+
<Switch value={notifications.protocolUpdates} onChange={() => setNotifications({ protocolUpdates: !notifications.protocolUpdates })} />
5458
</View>
5559
</View>
5660
<Separator className="my-4" />

utils/storage/notifications.ts

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@ import { registerPushToken } from "../notifications";
33

44
export interface NotificationSettings {
55

6-
client: boolean;
6+
clientUpdates: boolean;
77

8-
server: boolean;
8+
serverUpdates: boolean;
99

10-
oxide: boolean;
10+
oxideUpdates: boolean;
1111

12-
carbon: boolean;
12+
carbonUpdates: boolean;
13+
14+
protocolUpdates: boolean;
1315

1416
}
1517

@@ -31,7 +33,19 @@ export async function getNotificationSettings(): Promise<NotificationSettings> {
3133

3234
}
3335

34-
const defaultSettings = { client: true, server: true, oxide: true, carbon: true };
36+
const defaultSettings = {
37+
38+
clientUpdates: true,
39+
40+
serverUpdates: true,
41+
42+
oxideUpdates: true,
43+
44+
carbonUpdates: true,
45+
46+
protocolUpdates: true
47+
48+
};
3549

3650
await setNotificationSettings(defaultSettings);
3751

0 commit comments

Comments
 (0)