add a preference

This commit is contained in:
Hailey
2024-08-26 00:21:10 -07:00
parent 256c50c648
commit 13b1cc6379
3 changed files with 32 additions and 0 deletions
@@ -25,6 +25,7 @@ export function BackgroundNotificationPreferencesProvider({
const [preferences, setPreferences] =
React.useState<BackgroundNotificationHandlerPreferences>({
playSoundChat: true,
showAvatarChat: false, // @TODO probably want this to default to true
})
React.useEffect(() => {
@@ -38,4 +38,5 @@ export type ExpoBackgroundNotificationHandlerModule = {
// Don't add them until the native logic also handles the notifications for those preference types.
export type BackgroundNotificationHandlerPreferences = {
playSoundChat: boolean
showAvatarChat: boolean
}
+30
View File
@@ -146,6 +146,36 @@ export function MessagesSettingsScreen({}: Props) {
</Toggle.Item>
</View>
</Toggle.Group>
<Text style={[a.text_lg, a.font_bold]}>
<Trans>Notification Sounds</Trans>
</Text>
<Divider style={a.my_md} />
<Toggle.Group
label={_(msg`Show avatars`)}
type="radio"
values={[preferences.showAvatarChat ? 'enabled' : 'disabled']}
onChange={onSelectSoundSetting}>
<View>
<Toggle.Item
name="show"
label={_(msg`Show`)}
style={[a.justify_between, a.py_sm]}>
<Toggle.LabelText>
<Trans>Show</Trans>
</Toggle.LabelText>
<Toggle.Radio />
</Toggle.Item>
<Toggle.Item
name="hide"
label={_(msg`Hide`)}
style={[a.justify_between, a.py_sm]}>
<Toggle.LabelText>
<Trans>Hide</Trans>
</Toggle.LabelText>
<Toggle.Radio />
</Toggle.Item>
</View>
</Toggle.Group>
</>
)}
</View>