Skip to content

Commit cc9d970

Browse files
committed
feat: add floating fullscreen toggle button
1 parent ad474ae commit cc9d970

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed
Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,21 @@
1-
import { Container } from "@quassel/ui";
1+
import { ActionIcon, Affix, Container, IconMaximize, IconMaximizeOff, useFullscreen } from "@quassel/ui";
22
import { createFileRoute, Outlet } from "@tanstack/react-router";
33

44
export const Route = createFileRoute("/_auth/questionnaire")({
55
component: QuestionnaireLayout,
66
});
77

88
function QuestionnaireLayout() {
9+
const { fullscreen, toggle } = useFullscreen();
10+
911
return (
1012
<Container size="md" mt="xl">
1113
<Outlet />
14+
<Affix position={{ bottom: 100, right: 40 }}>
15+
<ActionIcon variant="outline" radius="xl" size="xl" onClick={toggle}>
16+
{fullscreen ? <IconMaximizeOff /> : <IconMaximize />}
17+
</ActionIcon>
18+
</Affix>
1219
</Container>
1320
);
1421
}

libs/ui/src/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ export {
6262
ColorSwatch,
6363
Divider,
6464
Flex,
65+
Affix,
6566
Group,
6667
InputError,
6768
InputLabel,
@@ -88,7 +89,7 @@ export {
8889

8990
export { TimeInput, DateInput } from "@mantine/dates";
9091

91-
export { useDisclosure } from "@mantine/hooks";
92+
export { useDisclosure, useFullscreen } from "@mantine/hooks";
9293

9394
export { notifications } from "@mantine/notifications";
9495

@@ -106,6 +107,8 @@ export {
106107
IconMapSearch,
107108
IconMinus,
108109
IconRepeat,
110+
IconMaximize,
111+
IconMaximizeOff,
109112
} from "@tabler/icons-react";
110113

111114
export { uzhColors } from "./theme/uzh";

0 commit comments

Comments
 (0)