show footer on the bottom of the page on mobile (#1121)

This commit is contained in:
Athou
2024-01-18 09:10:13 +01:00
parent a8be8f2edf
commit 0946c0248e
38 changed files with 195 additions and 32 deletions

View File

@@ -93,10 +93,14 @@ export const Constants = {
const header = document.getElementById(Constants.dom.headerId)?.getBoundingClientRect() const header = document.getElementById(Constants.dom.headerId)?.getBoundingClientRect()
return div.getBoundingClientRect().top >= (header?.bottom ?? 0) return div.getBoundingClientRect().top >= (header?.bottom ?? 0)
}, },
isBottomVisible: (div: HTMLElement) => div.getBoundingClientRect().bottom <= window.innerHeight, isBottomVisible: (div: HTMLElement) => {
const footer = document.getElementById(Constants.dom.footerId)?.getBoundingClientRect()
return div.getBoundingClientRect().bottom <= (footer?.top ?? window.innerHeight)
},
}, },
dom: { dom: {
headerId: "header", headerId: "header",
footerId: "footer",
entryId: (entry: Entry) => `entry-id-${entry.id}`, entryId: (entry: Entry) => `entry-id-${entry.id}`,
entryContextMenuId: (entry: Entry) => entry.id, entryContextMenuId: (entry: Entry) => entry.id,
}, },

View File

@@ -208,6 +208,7 @@ export interface Settings {
alwaysScrollToEntry: boolean alwaysScrollToEntry: boolean
markAllAsReadConfirmation: boolean markAllAsReadConfirmation: boolean
customContextMenu: boolean customContextMenu: boolean
mobileFooter: boolean
sharingSettings: SharingSettings sharingSettings: SharingSettings
} }

View File

@@ -7,6 +7,7 @@ import {
changeCustomContextMenu, changeCustomContextMenu,
changeLanguage, changeLanguage,
changeMarkAllAsReadConfirmation, changeMarkAllAsReadConfirmation,
changeMobileFooter,
changeReadingMode, changeReadingMode,
changeReadingOrder, changeReadingOrder,
changeScrollMarks, changeScrollMarks,
@@ -76,6 +77,10 @@ export const userSlice = createSlice({
if (!state.settings) return if (!state.settings) return
state.settings.customContextMenu = action.meta.arg state.settings.customContextMenu = action.meta.arg
}) })
builder.addCase(changeMobileFooter.pending, (state, action) => {
if (!state.settings) return
state.settings.mobileFooter = action.meta.arg
})
builder.addCase(changeSharingSetting.pending, (state, action) => { builder.addCase(changeSharingSetting.pending, (state, action) => {
if (!state.settings) return if (!state.settings) return
state.settings.sharingSettings[action.meta.arg.site] = action.meta.arg.value state.settings.sharingSettings[action.meta.arg.site] = action.meta.arg.value
@@ -89,6 +94,7 @@ export const userSlice = createSlice({
changeAlwaysScrollToEntry.fulfilled, changeAlwaysScrollToEntry.fulfilled,
changeMarkAllAsReadConfirmation.fulfilled, changeMarkAllAsReadConfirmation.fulfilled,
changeCustomContextMenu.fulfilled, changeCustomContextMenu.fulfilled,
changeMobileFooter.fulfilled,
changeSharingSetting.fulfilled changeSharingSetting.fulfilled
), ),
() => { () => {

View File

@@ -56,6 +56,11 @@ export const changeCustomContextMenu = createAppAsyncThunk("settings/customConte
if (!settings) return if (!settings) return
client.user.saveSettings({ ...settings, customContextMenu }) client.user.saveSettings({ ...settings, customContextMenu })
}) })
export const changeMobileFooter = createAppAsyncThunk("settings/mobileFooter", (mobileFooter: boolean, thunkApi) => {
const { settings } = thunkApi.getState().user
if (!settings) return
client.user.saveSettings({ ...settings, mobileFooter })
})
export const changeSharingSetting = createAppAsyncThunk( export const changeSharingSetting = createAppAsyncThunk(
"settings/sharingSetting", "settings/sharingSetting",
( (

View File

@@ -8,6 +8,7 @@ import {
changeCustomContextMenu, changeCustomContextMenu,
changeLanguage, changeLanguage,
changeMarkAllAsReadConfirmation, changeMarkAllAsReadConfirmation,
changeMobileFooter,
changeScrollMarks, changeScrollMarks,
changeScrollSpeed, changeScrollSpeed,
changeSharingSetting, changeSharingSetting,
@@ -23,6 +24,7 @@ export function DisplaySettings() {
const alwaysScrollToEntry = useAppSelector(state => state.user.settings?.alwaysScrollToEntry) const alwaysScrollToEntry = useAppSelector(state => state.user.settings?.alwaysScrollToEntry)
const markAllAsReadConfirmation = useAppSelector(state => state.user.settings?.markAllAsReadConfirmation) const markAllAsReadConfirmation = useAppSelector(state => state.user.settings?.markAllAsReadConfirmation)
const customContextMenu = useAppSelector(state => state.user.settings?.customContextMenu) const customContextMenu = useAppSelector(state => state.user.settings?.customContextMenu)
const mobileFooter = useAppSelector(state => state.user.settings?.mobileFooter)
const sharingSettings = useAppSelector(state => state.user.settings?.sharingSettings) const sharingSettings = useAppSelector(state => state.user.settings?.sharingSettings)
const dispatch = useAppDispatch() const dispatch = useAppDispatch()
@@ -74,6 +76,12 @@ export function DisplaySettings() {
onChange={async e => await dispatch(changeCustomContextMenu(e.currentTarget.checked))} onChange={async e => await dispatch(changeCustomContextMenu(e.currentTarget.checked))}
/> />
<Switch
label={<Trans>On mobile, show action buttons at the bottom of the screen</Trans>}
checked={mobileFooter}
onChange={async e => await dispatch(changeMobileFooter(e.currentTarget.checked))}
/>
<Divider label={<Trans>Sharing sites</Trans>} labelPosition="center" /> <Divider label={<Trans>Sharing sites</Trans>} labelPosition="center" />
<SimpleGrid cols={2}> <SimpleGrid cols={2}>

View File

@@ -574,6 +574,10 @@ msgstr "لم يتم العثور على شيء"
msgid "Oldest first" msgid "Oldest first"
msgstr "الأقدم أولا" msgstr "الأقدم أولا"
#: src/components/settings/DisplaySettings.tsx
msgid "On mobile, show action buttons at the bottom of the screen"
msgstr ""
#: src/pages/ErrorPage.tsx #: src/pages/ErrorPage.tsx
msgid "Oops!" msgid "Oops!"
msgstr "اوووه!" msgstr "اوووه!"

View File

@@ -574,6 +574,10 @@ msgstr "No s'ha trobat res"
msgid "Oldest first" msgid "Oldest first"
msgstr "el més vell primer" msgstr "el més vell primer"
#: src/components/settings/DisplaySettings.tsx
msgid "On mobile, show action buttons at the bottom of the screen"
msgstr ""
#: src/pages/ErrorPage.tsx #: src/pages/ErrorPage.tsx
msgid "Oops!" msgid "Oops!"
msgstr "Vaja!" msgstr "Vaja!"

View File

@@ -574,6 +574,10 @@ msgstr "Nic nebylo nalezeno"
msgid "Oldest first" msgid "Oldest first"
msgstr "Nejdříve nejstarší" msgstr "Nejdříve nejstarší"
#: src/components/settings/DisplaySettings.tsx
msgid "On mobile, show action buttons at the bottom of the screen"
msgstr ""
#: src/pages/ErrorPage.tsx #: src/pages/ErrorPage.tsx
msgid "Oops!" msgid "Oops!"
msgstr "Jejda!" msgstr "Jejda!"

View File

@@ -574,6 +574,10 @@ msgstr "Dim wedi'i ddarganfod"
msgid "Oldest first" msgid "Oldest first"
msgstr "Hynaf yn gyntaf" msgstr "Hynaf yn gyntaf"
#: src/components/settings/DisplaySettings.tsx
msgid "On mobile, show action buttons at the bottom of the screen"
msgstr ""
#: src/pages/ErrorPage.tsx #: src/pages/ErrorPage.tsx
msgid "Oops!" msgid "Oops!"
msgstr "Wps!" msgstr "Wps!"

View File

@@ -574,6 +574,10 @@ msgstr "Intet fundet"
msgid "Oldest first" msgid "Oldest first"
msgstr "Ældst først" msgstr "Ældst først"
#: src/components/settings/DisplaySettings.tsx
msgid "On mobile, show action buttons at the bottom of the screen"
msgstr ""
#: src/pages/ErrorPage.tsx #: src/pages/ErrorPage.tsx
msgid "Oops!" msgid "Oops!"
msgstr "Hovsa!" msgstr "Hovsa!"

View File

@@ -574,6 +574,10 @@ msgstr "Nichts gefunden"
msgid "Oldest first" msgid "Oldest first"
msgstr "Älteste zuerst" msgstr "Älteste zuerst"
#: src/components/settings/DisplaySettings.tsx
msgid "On mobile, show action buttons at the bottom of the screen"
msgstr ""
#: src/pages/ErrorPage.tsx #: src/pages/ErrorPage.tsx
msgid "Oops!" msgid "Oops!"
msgstr "Ups!" msgstr "Ups!"

View File

@@ -574,6 +574,10 @@ msgstr "Nothing found"
msgid "Oldest first" msgid "Oldest first"
msgstr "Oldest first" msgstr "Oldest first"
#: src/components/settings/DisplaySettings.tsx
msgid "On mobile, show action buttons at the bottom of the screen"
msgstr "On mobile, show action buttons at the bottom of the screen"
#: src/pages/ErrorPage.tsx #: src/pages/ErrorPage.tsx
msgid "Oops!" msgid "Oops!"
msgstr "Oops!" msgstr "Oops!"

View File

@@ -574,6 +574,10 @@ msgstr "Nada encontrado"
msgid "Oldest first" msgid "Oldest first"
msgstr "más antigua primero" msgstr "más antigua primero"
#: src/components/settings/DisplaySettings.tsx
msgid "On mobile, show action buttons at the bottom of the screen"
msgstr ""
#: src/pages/ErrorPage.tsx #: src/pages/ErrorPage.tsx
msgid "Oops!" msgid "Oops!"
msgstr "¡Ups!" msgstr "¡Ups!"

View File

@@ -574,6 +574,10 @@ msgstr "چیزی پیدا نشد"
msgid "Oldest first" msgid "Oldest first"
msgstr "قدیمی ترین اول" msgstr "قدیمی ترین اول"
#: src/components/settings/DisplaySettings.tsx
msgid "On mobile, show action buttons at the bottom of the screen"
msgstr ""
#: src/pages/ErrorPage.tsx #: src/pages/ErrorPage.tsx
msgid "Oops!" msgid "Oops!"
msgstr "اوه!" msgstr "اوه!"

View File

@@ -574,6 +574,10 @@ msgstr "Mitään ei löytynyt"
msgid "Oldest first" msgid "Oldest first"
msgstr "Vanhin ensin" msgstr "Vanhin ensin"
#: src/components/settings/DisplaySettings.tsx
msgid "On mobile, show action buttons at the bottom of the screen"
msgstr ""
#: src/pages/ErrorPage.tsx #: src/pages/ErrorPage.tsx
msgid "Oops!" msgid "Oops!"
msgstr "Hups!" msgstr "Hups!"

View File

@@ -574,6 +574,10 @@ msgstr "Aucun résultat"
msgid "Oldest first" msgid "Oldest first"
msgstr "Du plus ancien au plus récent" msgstr "Du plus ancien au plus récent"
#: src/components/settings/DisplaySettings.tsx
msgid "On mobile, show action buttons at the bottom of the screen"
msgstr ""
#: src/pages/ErrorPage.tsx #: src/pages/ErrorPage.tsx
msgid "Oops!" msgid "Oops!"
msgstr "Oups !" msgstr "Oups !"

View File

@@ -574,6 +574,10 @@ msgstr "Non se atopou nada"
msgid "Oldest first" msgid "Oldest first"
msgstr "O máis vello primeiro" msgstr "O máis vello primeiro"
#: src/components/settings/DisplaySettings.tsx
msgid "On mobile, show action buttons at the bottom of the screen"
msgstr ""
#: src/pages/ErrorPage.tsx #: src/pages/ErrorPage.tsx
msgid "Oops!" msgid "Oops!"
msgstr "Vaia!" msgstr "Vaia!"

View File

@@ -574,6 +574,10 @@ msgstr "Semmi sem található"
msgid "Oldest first" msgid "Oldest first"
msgstr "A legidősebb első" msgstr "A legidősebb első"
#: src/components/settings/DisplaySettings.tsx
msgid "On mobile, show action buttons at the bottom of the screen"
msgstr ""
#: src/pages/ErrorPage.tsx #: src/pages/ErrorPage.tsx
msgid "Oops!" msgid "Oops!"
msgstr "Hoppá!" msgstr "Hoppá!"

View File

@@ -574,6 +574,10 @@ msgstr "Tidak ada yang ditemukan"
msgid "Oldest first" msgid "Oldest first"
msgstr "Tertua dulu" msgstr "Tertua dulu"
#: src/components/settings/DisplaySettings.tsx
msgid "On mobile, show action buttons at the bottom of the screen"
msgstr ""
#: src/pages/ErrorPage.tsx #: src/pages/ErrorPage.tsx
msgid "Oops!" msgid "Oops!"
msgstr "Ups!" msgstr "Ups!"

View File

@@ -574,6 +574,10 @@ msgstr "Non è stato trovato nulla"
msgid "Oldest first" msgid "Oldest first"
msgstr "Il più vecchio prima" msgstr "Il più vecchio prima"
#: src/components/settings/DisplaySettings.tsx
msgid "On mobile, show action buttons at the bottom of the screen"
msgstr ""
#: src/pages/ErrorPage.tsx #: src/pages/ErrorPage.tsx
msgid "Oops!" msgid "Oops!"
msgstr "Ops!" msgstr "Ops!"

View File

@@ -574,6 +574,10 @@ msgstr "何も見つかりませんでした"
msgid "Oldest first" msgid "Oldest first"
msgstr "古い順" msgstr "古い順"
#: src/components/settings/DisplaySettings.tsx
msgid "On mobile, show action buttons at the bottom of the screen"
msgstr ""
#: src/pages/ErrorPage.tsx #: src/pages/ErrorPage.tsx
msgid "Oops!" msgid "Oops!"
msgstr "おっと!" msgstr "おっと!"

View File

@@ -574,6 +574,10 @@ msgstr "아무것도 찾을 수 없습니다"
msgid "Oldest first" msgid "Oldest first"
msgstr "가장 오래된 것부터" msgstr "가장 오래된 것부터"
#: src/components/settings/DisplaySettings.tsx
msgid "On mobile, show action buttons at the bottom of the screen"
msgstr ""
#: src/pages/ErrorPage.tsx #: src/pages/ErrorPage.tsx
msgid "Oops!" msgid "Oops!"
msgstr "앗!" msgstr "앗!"

View File

@@ -574,6 +574,10 @@ msgstr "Tiada apa-apa dijumpai"
msgid "Oldest first" msgid "Oldest first"
msgstr "Tertua dahulu" msgstr "Tertua dahulu"
#: src/components/settings/DisplaySettings.tsx
msgid "On mobile, show action buttons at the bottom of the screen"
msgstr ""
#: src/pages/ErrorPage.tsx #: src/pages/ErrorPage.tsx
msgid "Oops!" msgid "Oops!"
msgstr "Aduh!" msgstr "Aduh!"

View File

@@ -574,6 +574,10 @@ msgstr "Ingenting funnet"
msgid "Oldest first" msgid "Oldest first"
msgstr "Eldste først" msgstr "Eldste først"
#: src/components/settings/DisplaySettings.tsx
msgid "On mobile, show action buttons at the bottom of the screen"
msgstr ""
#: src/pages/ErrorPage.tsx #: src/pages/ErrorPage.tsx
msgid "Oops!" msgid "Oops!"
msgstr "Beklager!" msgstr "Beklager!"

View File

@@ -574,6 +574,10 @@ msgstr "Niets gevonden"
msgid "Oldest first" msgid "Oldest first"
msgstr "Oudste eerst" msgstr "Oudste eerst"
#: src/components/settings/DisplaySettings.tsx
msgid "On mobile, show action buttons at the bottom of the screen"
msgstr ""
#: src/pages/ErrorPage.tsx #: src/pages/ErrorPage.tsx
msgid "Oops!" msgid "Oops!"
msgstr "Oeps!" msgstr "Oeps!"

View File

@@ -574,6 +574,10 @@ msgstr "Ingenting funnet"
msgid "Oldest first" msgid "Oldest first"
msgstr "Eldste først" msgstr "Eldste først"
#: src/components/settings/DisplaySettings.tsx
msgid "On mobile, show action buttons at the bottom of the screen"
msgstr ""
#: src/pages/ErrorPage.tsx #: src/pages/ErrorPage.tsx
msgid "Oops!" msgid "Oops!"
msgstr "Beklager!" msgstr "Beklager!"

View File

@@ -574,6 +574,10 @@ msgstr "Nic nie znaleziono"
msgid "Oldest first" msgid "Oldest first"
msgstr "Najstarsze jako pierwsze" msgstr "Najstarsze jako pierwsze"
#: src/components/settings/DisplaySettings.tsx
msgid "On mobile, show action buttons at the bottom of the screen"
msgstr ""
#: src/pages/ErrorPage.tsx #: src/pages/ErrorPage.tsx
msgid "Oops!" msgid "Oops!"
msgstr "Ups!" msgstr "Ups!"

View File

@@ -574,6 +574,10 @@ msgstr "Nada encontrado"
msgid "Oldest first" msgid "Oldest first"
msgstr "Mais antigo primeiro" msgstr "Mais antigo primeiro"
#: src/components/settings/DisplaySettings.tsx
msgid "On mobile, show action buttons at the bottom of the screen"
msgstr ""
#: src/pages/ErrorPage.tsx #: src/pages/ErrorPage.tsx
msgid "Oops!" msgid "Oops!"
msgstr "Opa!" msgstr "Opa!"

View File

@@ -574,6 +574,10 @@ msgstr "Ничего не найдено"
msgid "Oldest first" msgid "Oldest first"
msgstr "Сначала самые старые" msgstr "Сначала самые старые"
#: src/components/settings/DisplaySettings.tsx
msgid "On mobile, show action buttons at the bottom of the screen"
msgstr ""
#: src/pages/ErrorPage.tsx #: src/pages/ErrorPage.tsx
msgid "Oops!" msgid "Oops!"
msgstr "Ой!" msgstr "Ой!"

View File

@@ -574,6 +574,10 @@ msgstr "Nič sa nenašlo"
msgid "Oldest first" msgid "Oldest first"
msgstr "Najprv najstarší" msgstr "Najprv najstarší"
#: src/components/settings/DisplaySettings.tsx
msgid "On mobile, show action buttons at the bottom of the screen"
msgstr ""
#: src/pages/ErrorPage.tsx #: src/pages/ErrorPage.tsx
msgid "Oops!" msgid "Oops!"
msgstr "Ojoj!" msgstr "Ojoj!"

View File

@@ -574,6 +574,10 @@ msgstr "Inget hittades"
msgid "Oldest first" msgid "Oldest first"
msgstr "Äldst först" msgstr "Äldst först"
#: src/components/settings/DisplaySettings.tsx
msgid "On mobile, show action buttons at the bottom of the screen"
msgstr ""
#: src/pages/ErrorPage.tsx #: src/pages/ErrorPage.tsx
msgid "Oops!" msgid "Oops!"
msgstr "Hoppsan!" msgstr "Hoppsan!"

View File

@@ -574,6 +574,10 @@ msgstr "Hiçbir şey bulunamadı"
msgid "Oldest first" msgid "Oldest first"
msgstr "Önce en eski" msgstr "Önce en eski"
#: src/components/settings/DisplaySettings.tsx
msgid "On mobile, show action buttons at the bottom of the screen"
msgstr ""
#: src/pages/ErrorPage.tsx #: src/pages/ErrorPage.tsx
msgid "Oops!" msgid "Oops!"
msgstr "Hata!" msgstr "Hata!"

View File

@@ -574,6 +574,10 @@ msgstr "没有找到"
msgid "Oldest first" msgid "Oldest first"
msgstr "最早的优先" msgstr "最早的优先"
#: src/components/settings/DisplaySettings.tsx
msgid "On mobile, show action buttons at the bottom of the screen"
msgstr ""
#: src/pages/ErrorPage.tsx #: src/pages/ErrorPage.tsx
msgid "Oops!" msgid "Oops!"
msgstr "哎呀!" msgstr "哎呀!"

View File

@@ -13,6 +13,8 @@ import { Logo } from "components/Logo"
import { OnDesktop } from "components/responsive/OnDesktop" import { OnDesktop } from "components/responsive/OnDesktop"
import { OnMobile } from "components/responsive/OnMobile" import { OnMobile } from "components/responsive/OnMobile"
import { useAppLoading } from "hooks/useAppLoading" import { useAppLoading } from "hooks/useAppLoading"
import { useBrowserExtension } from "hooks/useBrowserExtension"
import { useMobile } from "hooks/useMobile"
import { useWebSocket } from "hooks/useWebSocket" import { useWebSocket } from "hooks/useWebSocket"
import { LoadingPage } from "pages/LoadingPage" import { LoadingPage } from "pages/LoadingPage"
import { type ReactNode, Suspense, useEffect } from "react" import { type ReactNode, Suspense, useEffect } from "react"
@@ -60,6 +62,8 @@ const useStyles = tss
export default function Layout(props: LayoutProps) { export default function Layout(props: LayoutProps) {
const theme = useMantineTheme() const theme = useMantineTheme()
const mobile = useMobile()
const { isBrowserExtensionPopup } = useBrowserExtension()
const [sidebarWidth, setSidebarWidth] = useLocalStorage("sidebar-width", 350) const [sidebarWidth, setSidebarWidth] = useLocalStorage("sidebar-width", 350)
const sidebarPadding = theme.spacing.xs const sidebarPadding = theme.spacing.xs
const { classes } = useStyles({ const { classes } = useStyles({
@@ -71,6 +75,8 @@ export default function Layout(props: LayoutProps) {
const mobileMenuOpen = useAppSelector(state => state.tree.mobileMenuOpen) const mobileMenuOpen = useAppSelector(state => state.tree.mobileMenuOpen)
const webSocketConnected = useAppSelector(state => state.server.webSocketConnected) const webSocketConnected = useAppSelector(state => state.server.webSocketConnected)
const treeReloadInterval = useAppSelector(state => state.server.serverInfos?.treeReloadInterval) const treeReloadInterval = useAppSelector(state => state.server.serverInfos?.treeReloadInterval)
const mobileFooter = useAppSelector(state => state.user.settings?.mobileFooter)
const headerInFooter = mobile && !isBrowserExtensionPopup && mobileFooter
const dispatch = useAppDispatch() const dispatch = useAppDispatch()
useWebSocket() useWebSocket()
@@ -112,6 +118,39 @@ export default function Layout(props: LayoutProps) {
</ActionIcon> </ActionIcon>
) )
const header = (
<>
<OnMobile>
{mobileMenuOpen && (
<Group justify="space-between" p="md">
<Box>{burger}</Box>
<Box>
<LogoAndTitle />
</Box>
<Box>{addButton}</Box>
</Group>
)}
{!mobileMenuOpen && (
<Group p="md">
<Box>{burger}</Box>
<Box style={{ flexGrow: 1 }}>{props.header}</Box>
</Group>
)}
</OnMobile>
<OnDesktop>
<Group p="md">
<Group justify="space-between" style={{ width: sidebarWidth - 16 }}>
<Box>
<LogoAndTitle />
</Box>
<Box>{addButton}</Box>
</Group>
<Box style={{ flexGrow: 1 }}>{props.header}</Box>
</Group>
</OnDesktop>
</>
)
const swipeHandlers = useSwipeable({ const swipeHandlers = useSwipeable({
onSwiping: e => { onSwiping: e => {
const threshold = document.documentElement.clientWidth / 6 const threshold = document.documentElement.clientWidth / 6
@@ -125,7 +164,8 @@ export default function Layout(props: LayoutProps) {
return ( return (
<Box {...swipeHandlers}> <Box {...swipeHandlers}>
<AppShell <AppShell
header={{ height: Constants.layout.headerHeight }} header={{ height: Constants.layout.headerHeight, collapsed: headerInFooter }}
footer={{ height: Constants.layout.headerHeight, collapsed: !headerInFooter }}
navbar={{ navbar={{
width: sidebarWidth, width: sidebarWidth,
breakpoint: Constants.layout.mobileBreakpoint, breakpoint: Constants.layout.mobileBreakpoint,
@@ -133,36 +173,8 @@ export default function Layout(props: LayoutProps) {
}} }}
padding={{ base: 6, [Constants.layout.mobileBreakpointName]: "md" }} padding={{ base: 6, [Constants.layout.mobileBreakpointName]: "md" }}
> >
<AppShell.Header id={Constants.dom.headerId}> <AppShell.Header id={Constants.dom.headerId}>{header}</AppShell.Header>
<OnMobile> <AppShell.Footer id={Constants.dom.footerId}>{header}</AppShell.Footer>
{mobileMenuOpen && (
<Group justify="space-between" p="md">
<Box>{burger}</Box>
<Box>
<LogoAndTitle />
</Box>
<Box>{addButton}</Box>
</Group>
)}
{!mobileMenuOpen && (
<Group p="md">
<Box>{burger}</Box>
<Box style={{ flexGrow: 1 }}>{props.header}</Box>
</Group>
)}
</OnMobile>
<OnDesktop>
<Group p="md">
<Group justify="space-between" style={{ width: sidebarWidth - 16 }}>
<Box>
<LogoAndTitle />
</Box>
<Box>{addButton}</Box>
</Group>
<Box style={{ flexGrow: 1 }}>{props.header}</Box>
</Group>
</OnDesktop>
</AppShell.Header>
<AppShell.Navbar id="sidebar" p={sidebarPadding}> <AppShell.Navbar id="sidebar" p={sidebarPadding}>
<AppShell.Section grow component={ScrollArea} mx="-sm" px="sm"> <AppShell.Section grow component={ScrollArea} mx="-sm" px="sm">
<Box className={classes.sidebarContent}>{props.sidebar}</Box> <Box className={classes.sidebarContent}>{props.sidebar}</Box>

View File

@@ -69,6 +69,7 @@ public class UserSettings extends AbstractModel {
private boolean alwaysScrollToEntry; private boolean alwaysScrollToEntry;
private boolean markAllAsReadConfirmation; private boolean markAllAsReadConfirmation;
private boolean customContextMenu; private boolean customContextMenu;
private boolean mobileFooter;
private boolean email; private boolean email;
private boolean gmail; private boolean gmail;

View File

@@ -52,6 +52,9 @@ public class Settings implements Serializable {
@Schema(description = "show commafeed's own context menu on right click", requiredMode = RequiredMode.REQUIRED) @Schema(description = "show commafeed's own context menu on right click", requiredMode = RequiredMode.REQUIRED)
private boolean customContextMenu; private boolean customContextMenu;
@Schema(description = "on mobile, show action buttons at the bottom of the screen", requiredMode = RequiredMode.REQUIRED)
private boolean mobileFooter;
@Schema(description = "sharing settings", requiredMode = RequiredMode.REQUIRED) @Schema(description = "sharing settings", requiredMode = RequiredMode.REQUIRED)
private SharingSettings sharingSettings = new SharingSettings(); private SharingSettings sharingSettings = new SharingSettings();

View File

@@ -111,6 +111,7 @@ public class UserREST {
s.setAlwaysScrollToEntry(settings.isAlwaysScrollToEntry()); s.setAlwaysScrollToEntry(settings.isAlwaysScrollToEntry());
s.setMarkAllAsReadConfirmation(settings.isMarkAllAsReadConfirmation()); s.setMarkAllAsReadConfirmation(settings.isMarkAllAsReadConfirmation());
s.setCustomContextMenu(settings.isCustomContextMenu()); s.setCustomContextMenu(settings.isCustomContextMenu());
s.setMobileFooter(settings.isMobileFooter());
} else { } else {
s.setReadingMode(ReadingMode.unread.name()); s.setReadingMode(ReadingMode.unread.name());
s.setReadingOrder(ReadingOrder.desc.name()); s.setReadingOrder(ReadingOrder.desc.name());
@@ -131,6 +132,7 @@ public class UserREST {
s.setAlwaysScrollToEntry(false); s.setAlwaysScrollToEntry(false);
s.setMarkAllAsReadConfirmation(true); s.setMarkAllAsReadConfirmation(true);
s.setCustomContextMenu(true); s.setCustomContextMenu(true);
s.setMobileFooter(false);
} }
return Response.ok(s).build(); return Response.ok(s).build();
} }
@@ -159,6 +161,7 @@ public class UserREST {
s.setAlwaysScrollToEntry(settings.isAlwaysScrollToEntry()); s.setAlwaysScrollToEntry(settings.isAlwaysScrollToEntry());
s.setMarkAllAsReadConfirmation(settings.isMarkAllAsReadConfirmation()); s.setMarkAllAsReadConfirmation(settings.isMarkAllAsReadConfirmation());
s.setCustomContextMenu(settings.isCustomContextMenu()); s.setCustomContextMenu(settings.isCustomContextMenu());
s.setMobileFooter(settings.isMobileFooter());
s.setEmail(settings.getSharingSettings().isEmail()); s.setEmail(settings.getSharingSettings().isEmail());
s.setGmail(settings.getSharingSettings().isGmail()); s.setGmail(settings.getSharingSettings().isGmail());

View File

@@ -18,4 +18,12 @@
<modifyDataType tableName="USERS" columnName="recoverPasswordTokenDate" newDataType="${timestamp_type}" /> <modifyDataType tableName="USERS" columnName="recoverPasswordTokenDate" newDataType="${timestamp_type}" />
</changeSet> </changeSet>
<changeSet id="mobile-footer-setting" author="athou">
<addColumn tableName="USERSETTINGS">
<column name="mobileFooter" type="BOOLEAN" defaultValueBoolean="false">
<constraints nullable="false" />
</column>
</addColumn>
</changeSet>
</databaseChangeLog> </databaseChangeLog>