Settings: use AppTopBar

This commit is contained in:
thislight 2024-12-27 22:24:19 +08:00
parent 81b5fe1450
commit 4df609f1f5
No known key found for this signature in database
GPG key ID: FCFE5192241CCD4E
4 changed files with 26 additions and 42 deletions

View file

@ -25,6 +25,7 @@ import type { Template } from "@solid-primitives/i18n";
import { useStore } from "@nanostores/solid";
import { $settings } from "./stores";
import { useNavigator } from "~platform/StackedRouter";
import AppTopBar from "~material/AppTopBar";
const ChooseLang: Component = () => {
const { pop } = useNavigator();
@ -54,17 +55,12 @@ const ChooseLang: Component = () => {
return (
<Scaffold
topbar={
<AppBar position="static">
<Toolbar
variant="dense"
sx={{ paddingTop: "var(--safe-area-inset-top, 0px)" }}
>
<IconButton color="inherit" onClick={[pop, 1]} disableRipple>
<ArrowBack />
</IconButton>
<Title>{t("Choose Language")}</Title>
</Toolbar>
</AppBar>
<AppTopBar>
<IconButton color="inherit" onClick={[pop, 1]} disableRipple>
<ArrowBack />
</IconButton>
<Title>{t("Choose Language")}</Title>
</AppTopBar>
}
>
<List

View file

@ -18,6 +18,7 @@ import { createTranslator } from "~platform/i18n";
import { useStore } from "@nanostores/solid";
import { $settings } from "./stores";
import { useNavigator } from "~platform/StackedRouter";
import AppTopBar from "~material/AppTopBar";
const Motions: Component = () => {
const {pop} = useNavigator();
@ -31,17 +32,12 @@ const Motions: Component = () => {
return (
<Scaffold
topbar={
<AppBar position="static">
<Toolbar
variant="dense"
sx={{ paddingTop: "var(--safe-area-inset-top, 0px)" }}
>
<IconButton color="inherit" onClick={[pop, 1]} disableRipple>
<AppTopBar>
<IconButton color="inherit" onClick={[pop, 1]} disableRipple>
<ArrowBack />
</IconButton>
<Title>{t("motions")}</Title>
</Toolbar>
</AppBar>
</AppTopBar>
}
>
<List

View file

@ -23,9 +23,10 @@ import type { Template } from "@solid-primitives/i18n";
import { $settings } from "./stores";
import { useStore } from "@nanostores/solid";
import { useNavigator } from "~platform/StackedRouter";
import AppTopBar from "~material/AppTopBar";
const ChooseRegion: Component = () => {
const {pop} = useNavigator();
const { pop } = useNavigator();
const [t] = createTranslator(
() => import("./i18n/generic.json"),
(code) =>
@ -49,17 +50,12 @@ const ChooseRegion: Component = () => {
return (
<Scaffold
topbar={
<AppBar position="static">
<Toolbar
variant="dense"
sx={{ paddingTop: "var(--safe-area-inset-top, 0px)" }}
>
<IconButton color="inherit" onClick={[pop, 1]} disableRipple>
<ArrowBack />
</IconButton>
<Title>{t("Choose Region")}</Title>
</Toolbar>
</AppBar>
<AppTopBar>
<IconButton color="inherit" onClick={[pop, 1]} disableRipple>
<ArrowBack />
</IconButton>
<Title>{t("Choose Region")}</Title>
</AppTopBar>
}
>
<List

View file

@ -41,6 +41,7 @@ import { type Template } from "@solid-primitives/i18n";
import { useServiceWorker } from "~platform/host.js";
import { useSessions } from "../masto/clients.js";
import { useNavigator } from "~platform/StackedRouter.jsx";
import AppTopBar from "~material/AppTopBar.jsx";
type Inset = {
top?: number;
@ -199,17 +200,12 @@ const Settings: Component = () => {
return (
<Scaffold
topbar={
<AppBar position="static">
<Toolbar
variant="dense"
sx={{ paddingTop: "var(--safe-area-inset-top, 0px)" }}
>
<IconButton color="inherit" onClick={[pop, 1]} disableRipple>
<CloseIcon />
</IconButton>
<Title>{t("Settings")}</Title>
</Toolbar>
</AppBar>
<AppTopBar>
<IconButton color="inherit" onClick={[pop, 1]} disableRipple>
<CloseIcon />
</IconButton>
<Title>{t("Settings")}</Title>
</AppTopBar>
}
>
<List class="setting-list" use:solid-styled>