mirror of
https://github.com/stoatchat/for-legacy-web.git
synced 2026-03-07 09:25:27 +00:00
Fixed descriptions on checkbox components
This commit is contained in:
@@ -39,6 +39,7 @@ export function Component({ options, dispatcher }: Props & WithDispatcher) {
|
||||
<Checkbox
|
||||
disabled={!("Notification" in window)}
|
||||
checked={options?.desktopEnabled ?? false}
|
||||
description={<Text id="app.settings.pages.notifications.descriptions.enable_desktop" />}
|
||||
onChange={async desktopEnabled => {
|
||||
if (desktopEnabled) {
|
||||
let permission = await Notification.requestPermission();
|
||||
@@ -57,13 +58,11 @@ export function Component({ options, dispatcher }: Props & WithDispatcher) {
|
||||
}}
|
||||
>
|
||||
<Text id="app.settings.pages.notifications.enable_desktop" />
|
||||
<p>
|
||||
<Text id="app.settings.pages.notifications.descriptions.enable_desktop" />
|
||||
</p>
|
||||
</Checkbox>
|
||||
<Checkbox
|
||||
disabled={typeof pushEnabled === "undefined"}
|
||||
checked={pushEnabled ?? false}
|
||||
description={<Text id="app.settings.pages.notifications.descriptions.enable_push" />}
|
||||
onChange={async pushEnabled => {
|
||||
try {
|
||||
const reg = await navigator.serviceWorker?.getRegistration();
|
||||
@@ -99,9 +98,6 @@ export function Component({ options, dispatcher }: Props & WithDispatcher) {
|
||||
}}
|
||||
>
|
||||
<Text id="app.settings.pages.notifications.enable_push" />
|
||||
<p>
|
||||
<Text id="app.settings.pages.notifications.descriptions.enable_push" />
|
||||
</p>
|
||||
</Checkbox>
|
||||
<h3>
|
||||
<Text id="app.settings.pages.notifications.sounds" />
|
||||
|
||||
@@ -321,30 +321,16 @@
|
||||
}
|
||||
}
|
||||
|
||||
.notifications {
|
||||
label {
|
||||
margin-top: 12px;
|
||||
}
|
||||
|
||||
p {
|
||||
margin-top: 0;
|
||||
font-size: 0.9em;
|
||||
color: var(--secondary-foreground);
|
||||
}
|
||||
}
|
||||
|
||||
.languages {
|
||||
.list {
|
||||
margin-bottom: 1em;
|
||||
|
||||
.entry {
|
||||
padding: 2px 8px;
|
||||
height: 50px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.entry > span > span {
|
||||
gap: 8px;
|
||||
gap: 20px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-direction: row;
|
||||
|
||||
@@ -25,6 +25,7 @@ export function Component(props: Props & WithDispatcher) {
|
||||
([ key, title ]) =>
|
||||
<Checkbox
|
||||
checked={(props.options?.disabled ?? []).indexOf(key) === -1}
|
||||
description={<Text id={`app.settings.pages.sync.descriptions.${key}`} />}
|
||||
onChange={enabled => {
|
||||
props.dispatcher({
|
||||
type: enabled ? 'SYNC_ENABLE_KEY' : 'SYNC_DISABLE_KEY',
|
||||
@@ -33,9 +34,6 @@ export function Component(props: Props & WithDispatcher) {
|
||||
}}
|
||||
>
|
||||
<Text id={`app.settings.pages.${title}`} />
|
||||
<p>
|
||||
<Text id={`app.settings.pages.sync.descriptions.${key}`} />
|
||||
</p>
|
||||
</Checkbox>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user