Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moves footer into nav to fix main body size issues #141

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions app/(authenticated)/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,6 @@ export default async function AuthenticatedLayout({
<main className="mx-2 max-w-[min(theme(maxWidth.6xl),theme(maxWidth.full))] overflow-x-hidden md:mx-6 [@media(min-width:calc(theme(maxWidth.6xl)+theme(margin.6)*2))]:mx-auto">
{children}
</main>
<br />
<footer className="mt-8 text-center text-sm text-gray-500">
Calendar version {process.env.NEXT_PUBLIC_RELEASE}. Built and
maintained by the YSTV Computing Team. <FeedbackPrompt />
</footer>
<style
dangerouslySetInnerHTML={{
__html: `
Expand Down
5 changes: 3 additions & 2 deletions components/FeedbackPrompt.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
"use client";

import { Anchor } from "@mantine/core";
import Link from "next/link";
import { usePathname } from "next/navigation";

export function FeedbackPrompt() {
const pathname = usePathname();

return (
<Link href={`/feedback?return_to=${encodeURIComponent(pathname)}`}>
<Anchor href={`/feedback?return_to=${encodeURIComponent(pathname)}`}>
Got an idea or found something broken?
</Link>
</Anchor>
);
}
23 changes: 19 additions & 4 deletions components/Nav.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,27 @@
"use client";
import { AppShell, Group, rem } from "@mantine/core";
import { Anchor, AppShell, Group, rem, Text } from "@mantine/core";
import { useHeadroom } from "@mantine/hooks";
import Image from "next/image";
import Link from "next/link";
import Logo from "@/app/_assets/logo.png";
import { UserMenu } from "@/components/UserMenu";
import styles from "@/styles/Nav.module.css";
import YSTVBreadcrumbs from "@/components/Breadcrumbs";
import { FeedbackPrompt } from "./FeedbackPrompt";

interface NavProps {
children: React.ReactNode;
user: any;
}

export default function Nav({ children, user }: NavProps) {
const pinned = useHeadroom({ fixedAt: 100 });
const headerPinned = useHeadroom({ fixedAt: 100 });
const footerPinned = useHeadroom({ fixedAt: 100 });

return (
<AppShell
header={{ height: 80, collapsed: !pinned, offset: false }}
header={{ height: 80, collapsed: !headerPinned, offset: false }}
footer={{ height: 80, collapsed: !headerPinned, offset: false }}
padding="md"
classNames={{ header: styles.header }}
>
Expand All @@ -39,9 +43,20 @@ export default function Nav({ children, user }: NavProps) {
</Group>
</AppShell.Header>

<AppShell.Main pt={`calc(${rem(80)} + var(--mantine-spacing-md))`}>
<AppShell.Main
pt={`calc(${rem(80)} + var(--mantine-spacing-md))`}
h={`10vh - ${rem(80)} - var(--mantine-spacing-md)`}
>
{children}
</AppShell.Main>
<AppShell.Footer bg-dark="true">
<div className="flex h-full items-center justify-center">
<Text ta="center">
Calendar version {process.env.NEXT_PUBLIC_RELEASE}. Built and
maintained by the YSTV Computing Team. <FeedbackPrompt />
</Text>
</div>
</AppShell.Footer>
</AppShell>
);
}
Loading