-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
582 additions
and
349 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { Text } from "@mantine/core"; | ||
import React from "react"; | ||
import { useBuildDate } from "../../hooks/use-build-date"; | ||
|
||
export function DataInformation() { | ||
const buildYear = useBuildDate(); | ||
console.log(buildYear); | ||
return ( | ||
<> | ||
<Text> | ||
Times are GMT/BST. Heights shown are heights above chart datum. Low | ||
water times are not provided due to seasonal variations and river flows. | ||
</Text> | ||
<Text> | ||
No warranty is provided for the accuracy of data displayed. Tidal Data | ||
is ©Crown Copyright. Reproduced by permission of the Controller of | ||
Her Majesty's Stationery Office and the UK Hydrographic Office | ||
(www.ukho.gov.uk). No tidal data may be reproduced without the expressed | ||
permission of the UKHO licensing department. | ||
</Text> | ||
</> | ||
); | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,41 @@ | ||
import { Container, Group, Text } from '@mantine/core'; | ||
import * as classes from './Footer.module.css'; | ||
import React from 'react'; | ||
import { Link } from 'gatsby'; | ||
import { useBuildDate } from '../../hooks/use-build-date'; | ||
import { Button, Container, Group, Modal, Text } from "@mantine/core"; | ||
import React from "react"; | ||
import { Link } from "gatsby"; | ||
import { useBuildDate } from "../../hooks/use-build-date"; | ||
import { useDisclosure } from "@mantine/hooks"; | ||
import { DataInformation } from "./DataInformation"; | ||
|
||
export function Footer() { | ||
const buildYear = useBuildDate() | ||
const buildYear = useBuildDate(); | ||
const [opened, { open, close }] = useDisclosure(false); | ||
|
||
return ( | ||
<Container size="xl" className={classes.inner}> | ||
<Text>Times are GMT/BST. No warranty is provided for the accuracy of data displayed. Tidal Data is ©Crown Copyright. Reproduced by permission of the Controller of Her Majesty's Stationery Office and the UK Hydrographic Office (www.ukho.gov.uk). No tidal data may be reproduced without the expressed permission of the UKHO licensing department.</Text> | ||
<Text>©2014-{buildYear} James Bithell</Text> | ||
</Container> | ||
<> | ||
<Modal | ||
opened={opened} | ||
onClose={close} | ||
title="Data Information" | ||
size={"lg"} | ||
> | ||
<DataInformation /> | ||
</Modal> | ||
|
||
<Container size="xl"> | ||
<Group justify="space-between" align="center" mt="md"> | ||
<Button size="compact-md" variant="outline" onClick={open}> | ||
Data information | ||
</Button> | ||
<Text> | ||
©2014-{buildYear}{" "} | ||
<Link | ||
to={"https://jbithell.com"} | ||
style={{ textDecoration: "none", color: "inherit" }} | ||
> | ||
James Bithell | ||
</Link> | ||
</Text> | ||
</Group> | ||
</Container> | ||
</> | ||
); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,74 @@ | ||
import { AppShell, Container } from "@mantine/core" | ||
import React from "react" | ||
import { Header } from "./Header" | ||
import { Footer } from "./Footer" | ||
import { | ||
AppShell, | ||
Box, | ||
Center, | ||
Container, | ||
Group, | ||
Title, | ||
useMatches, | ||
} from "@mantine/core"; | ||
import React from "react"; | ||
import { Header } from "./Header"; | ||
import { Footer } from "./Footer"; | ||
import { useDisclosure } from "@mantine/hooks"; | ||
import { MobileNavbar } from "./MobileNavbar"; | ||
|
||
export default function Layout({ children }: { children: React.ReactNode }) { | ||
const [menuOpened, { toggle: menuToggle }] = useDisclosure(false); | ||
export default function Layout({ | ||
children, | ||
title, | ||
headerButtons, | ||
}: { | ||
children: React.ReactNode; | ||
headerButtons?: React.ReactNode; | ||
title?: string; | ||
}) { | ||
const showHeader = useMatches({ | ||
base: false, | ||
sm: true, | ||
}); | ||
return ( | ||
<AppShell | ||
header={{ height: 60 }} | ||
navbar={{ | ||
width: 300, | ||
breakpoint: 'sm', | ||
collapsed: { mobile: !menuOpened, desktop: true }, | ||
}} | ||
header={{ height: showHeader && headerButtons && title ? 60 : 0 }} | ||
footer={{ height: 60 }} | ||
padding="md" | ||
> | ||
<AppShell.Header><Header menuOpened={menuOpened} menuToggle={menuToggle} /></AppShell.Header> | ||
<AppShell.Navbar p="md"><MobileNavbar /></AppShell.Navbar> | ||
{showHeader && headerButtons && title ? ( | ||
<AppShell.Header> | ||
<Container size="xl"> | ||
<Group justify="space-between" align="center" mt="xs"> | ||
<Title size={"h2"} order={1}> | ||
{title} | ||
</Title> | ||
<Box> | ||
<Group justify="flex-end">{headerButtons}</Group> | ||
</Box> | ||
</Group> | ||
</Container> | ||
</AppShell.Header> | ||
) : null} | ||
<AppShell.Main> | ||
<Container size="xl"> | ||
{children} | ||
</Container> | ||
{!showHeader && headerButtons && title ? ( | ||
<> | ||
<Center> | ||
<Title order={1} size={"h2"} hiddenFrom="sm"> | ||
{title} | ||
</Title> | ||
</Center> | ||
<Group | ||
justify="space-between" | ||
hiddenFrom="sm" | ||
align="center" | ||
mt="xs" | ||
mb="mb" | ||
> | ||
{headerButtons} | ||
</Group> | ||
</> | ||
) : null} | ||
<Container size="xl">{children}</Container> | ||
</AppShell.Main> | ||
<AppShell.Footer><Footer /></AppShell.Footer> | ||
<AppShell.Footer> | ||
<Footer /> | ||
</AppShell.Footer> | ||
</AppShell> | ||
) | ||
} | ||
); | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.