view for background push checkbox, install button

This commit is contained in:
Liam 2022-11-10 14:11:25 -05:00
parent c89193e907
commit b0d7cad5f3

View file

@ -3,6 +3,7 @@ import {useEffect, useState} from 'react';
import {
CardActions,
CardContent,
Checkbox,
FormControl,
Select,
Stack,
@ -42,6 +43,7 @@ const Preferences = () => {
<Notifications/>
<Appearance/>
<Users/>
<Installation/>
</Stack>
</Container>
);
@ -58,6 +60,7 @@ const Notifications = () => {
<Sound/>
<MinPriority/>
<DeleteAfter/>
<BackgroundPush/>
</PrefGroup>
</Card>
);
@ -173,6 +176,33 @@ const DeleteAfter = () => {
)
};
const BackgroundPush = () => {
const { t } = useTranslation();
const handleChange = () => {
console.log('The checkbox was toggled.');
}
return (
<Pref
labelId={"background_push"}
title={"prefs_notification_background"}
description={"Enable background notifications?"}
>
<FormControl
fullWidth
variant="standard"
sx={{ m: 1 }}
>
<Checkbox
onChange={handleChange}
>
</Checkbox>
</FormControl>
</Pref>
)
};
const PrefGroup = (props) => {
return (
<div role="table">
@ -473,4 +503,32 @@ const Language = () => {
)
};
const Installation = () => {
const { t } = useTranslation(); // Need help setting up the locale
return (
<Card sx={{p: 3}} aria-label={"Install ntfy"}>
<Typography variant="h5" sx={{marginBottom: 2}}>
{"Install NTFY"}
</Typography>
<Install/>
</Card>
)
}
const Install = () => {
const { t } = useTranslation();
return (
<FormControl fullWidth variant="standard" sx={{ m: 1 }}>
<Button variant="contained">
Install
</Button>
</FormControl>
)
}
export default Preferences;