Skip to content

Commit

Permalink
center footer on landing page
Browse files Browse the repository at this point in the history
  • Loading branch information
Leo committed Sep 10, 2024
1 parent d5ff060 commit 7726ebb
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 7 deletions.
7 changes: 6 additions & 1 deletion app/components/Layout/index.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,19 @@

.container footer {
position: relative;
text-align: left;
z-index: 1;
padding: 1rem;
padding-top: 4rem;
color: #aaa;
display: flex;
width: 100%;
gap: 1rem;
}
@media (max-width: 768px) {
.container[data-layout-center="true"] footer {
justify-content: center;
}
}

.container footer a:visited,
.container footer a:active,
Expand Down
23 changes: 17 additions & 6 deletions app/components/Layout/index.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,34 @@
import { NavLink } from "@remix-run/react";
import { NavLink, useLocation } from "@remix-run/react";
import classes from "./index.module.css";

interface Props extends React.HTMLAttributes<HTMLDivElement> {
type?: "black" | "white";
noFooter?: boolean;
}

export const Layout: React.FC<Props> = ({ type, children, ...props }) => {
export const Layout: React.FC<Props> = ({
type = "black",
children,
...props
}) => {
const { pathname } = useLocation();
return (
<div className={classes.container} data-layout-type={type ?? "black"}>
<div
className={classes.container}
data-layout-type={type ?? "black"}
data-layout-center={pathname === "/"}
>
<main {...props}>{children}</main>
{!props.noFooter && (
<footer>
<NavLink prefetch="intent" to="/legal">
legal notice
</NavLink>
<NavLink prefetch="intent" to="/past-shows">
past shows
</NavLink>
{pathname === "/" && (
<NavLink prefetch="intent" to="/past-shows">
past shows
</NavLink>
)}
</footer>
)}
</div>
Expand Down

0 comments on commit 7726ebb

Please sign in to comment.