Skip to content

Commit

Permalink
feat: footer nav back and forth
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaKGoldberg committed Feb 20, 2024
1 parent d32b43d commit 6918101
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 1 deletion.
24 changes: 24 additions & 0 deletions app/components/Layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { Link } from "@remix-run/react";
import React from "react";

import { HeroHeading } from "~/HeroHeading";

export interface LayoutProps extends React.PropsWithChildren {
back?: boolean;
title: string;
}

export function Layout({ back, children, title }: LayoutProps) {
return (
<div>
<main>
<HeroHeading>{title}</HeroHeading>
{back && <Link to="/">Boston TS ⬅️</Link>}
{children}
</main>
<footer>
<Link to="/about">About</Link>
</footer>
</div>
);
}
1 change: 0 additions & 1 deletion app/root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ export default function App() {
<Links />
</head>
<body>
<HeroHeading>Boston TypeScript</HeroHeading>
<Outlet />

<Scripts />
Expand Down
5 changes: 5 additions & 0 deletions app/routes/_index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { Layout } from "~/components/Layout";

export default function Index() {
return <Layout title="Boston TypeScript">Hello, world!</Layout>;
}
9 changes: 9 additions & 0 deletions app/routes/about.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { Layout } from "~/components/Layout";

export default function About() {
return (
<Layout back title="About">
Hello, world!
</Layout>
);
}

0 comments on commit 6918101

Please sign in to comment.