|
1 | 1 | import { Header } from "./header.tsx"; |
2 | | -import { Router } from "../Router.tsx"; |
3 | 2 | import { Footer } from "./footer/Footer.tsx"; |
4 | 3 | import '@radix-ui/themes/styles.css'; |
5 | 4 | import "./style.css" |
6 | | -import { Theme } from "@radix-ui/themes"; |
7 | | -import { css } from "@emotion/react"; |
8 | | -import {IsDevModeContext, useDevMode} from "../shared-components/devmode/DevMode.ts" |
9 | | - |
10 | | -export function Layout() { |
11 | | - const devModeControl = useDevMode() |
12 | | - return ( |
13 | | - <Theme |
14 | | - css={css` |
15 | | - display: flex; |
16 | | - flex-direction: column; |
17 | | - align-items: center; |
18 | | - justify-content: center; |
19 | | -
|
20 | | - /* set variables for Radix UI */ |
21 | | - --cursor-button: pointer; |
22 | | - --cursor-checkbox: pointer; |
23 | | - --cursor-disabled: default; |
24 | | - --cursor-link: pointer; |
25 | | - --cursor-menu-item: pointer; |
26 | | - --cursor-radio: pointer; |
27 | | - --cursor-slider-thumb: grab; |
28 | | - --cursor-slider-thumb-active: grabbing; |
29 | | - --cursor-switch: pointer; |
30 | | - |
31 | | - /* fonts copied from local4local.nu */ |
32 | | - @font-face { |
33 | | - font-family: 'rubik-regular'; |
34 | | - src: url('/rubik-regular.woff2') format('woff2'); |
35 | | - font-weight: normal; |
36 | | - font-style: normal; |
37 | | - font-display: swap; |
38 | | - } |
39 | | -
|
40 | | - @font-face { |
41 | | - font-family: 'rubik-light'; |
42 | | - src: url('/rubik-light.woff2') format('woff2'); |
43 | | - font-weight: light; |
44 | | - font-style: normal; |
45 | | - font-display: swap; |
46 | | - } |
47 | | -
|
48 | | - --default-font-family: 'rubik-light'; |
49 | | - --heading-font-family: 'rubik-regular'; |
50 | | - --strong-font-family: 'rubik-regular'; |
51 | | - |
52 | | - h1, h2, h3, h4, h5, h6 { |
53 | | - font-family: var(--heading-font-family), sans-serif; |
54 | | - } |
55 | | - |
56 | | - strong, b { |
57 | | - font-family: var(--strong-font-family), sans-serif; |
58 | | - } |
59 | | - |
60 | | - button { |
61 | | - font-family: var(--strong-font-family), sans-serif; |
62 | | - } |
63 | | - `} |
64 | | - > |
65 | | - <Header style={{marginTop: "auto"}}/> |
66 | | - <IsDevModeContext value={devModeControl.isDevMode}> |
67 | | - <Router /> |
68 | | - </IsDevModeContext> |
69 | | - <Footer style={{marginTop: "auto"}} devModeControl={devModeControl} /> |
70 | | - </Theme> |
71 | | - ); |
72 | | -} |
| 5 | +import {FunctionComponent, PropsWithChildren} from "react" |
| 6 | + |
| 7 | +export const Layout: FunctionComponent<PropsWithChildren> = ({children}) => ( |
| 8 | + <> |
| 9 | + <Header style={{marginTop: "auto"}}/> |
| 10 | + {children} |
| 11 | + <Footer style={{marginTop: "auto"}} /> |
| 12 | + </> |
| 13 | +) |
0 commit comments