Skip to content

Commit 4bb797e

Browse files
committed
feat: hide layout element in fullscreen
1 parent cc9d970 commit 4bb797e

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

apps/frontend/src/routes/__root.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ function Root() {
5454
return (
5555
<>
5656
<AppShell
57-
header={{ height: 104 }}
58-
footer={{ height: 84 }}
57+
header={{ height: 104, collapsed: layoutStore.fullscreen }}
58+
footer={{ height: 84, collapsed: layoutStore.fullscreen }}
5959
navbar={{ width: 300, breakpoint: "sm", collapsed: { desktop: !layoutStore.admin } }}
6060
padding="xl"
6161
mod={{ admin: layoutStore.admin }}
@@ -100,6 +100,7 @@ function Root() {
100100
<AppShell.Main>
101101
<Outlet />
102102
</AppShell.Main>
103+
103104
<AppShell.Footer>
104105
<Group justify="space-between">
105106
<FooterLogos />

apps/frontend/src/routes/_auth/questionnaire.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { ActionIcon, Affix, Container, IconMaximize, IconMaximizeOff, useFullscreen } from "@quassel/ui";
22
import { createFileRoute, Outlet } from "@tanstack/react-router";
3+
import { $layout } from "../../stores/layout";
4+
import { useEffect } from "react";
35

46
export const Route = createFileRoute("/_auth/questionnaire")({
57
component: QuestionnaireLayout,
@@ -8,10 +10,14 @@ export const Route = createFileRoute("/_auth/questionnaire")({
810
function QuestionnaireLayout() {
911
const { fullscreen, toggle } = useFullscreen();
1012

13+
useEffect(() => {
14+
$layout.set({ fullscreen });
15+
}, [fullscreen]);
16+
1117
return (
12-
<Container size="md" mt="xl">
18+
<Container size={fullscreen ? "100%" : "md"} p={0} mt={fullscreen ? 0 : "xl"}>
1319
<Outlet />
14-
<Affix position={{ bottom: 100, right: 40 }}>
20+
<Affix position={{ bottom: 110, right: 40 }}>
1521
<ActionIcon variant="outline" radius="xl" size="xl" onClick={toggle}>
1622
{fullscreen ? <IconMaximizeOff /> : <IconMaximize />}
1723
</ActionIcon>

apps/frontend/src/stores/layout.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { map } from "nanostores";
22

33
type Layout = {
44
admin?: boolean;
5+
fullscreen?: boolean;
56
};
67

78
export const $layout = map<Layout>({});

0 commit comments

Comments
 (0)