Add internal nav to top nav on homepage

This commit is contained in:
2022-07-11 22:22:10 -07:00
parent fda58c87ed
commit 2c9aacc1a2
3 changed files with 22 additions and 17 deletions

View File

@@ -10,7 +10,11 @@ const getNavClasses = (isClient) =>
const Nav = ({ isClient, internalLinks, className }) => (
<nav
className={classnames("m-2 flex justify-center", className)}
className={classnames(
"m-2 flex justify-center",
isClient ? "text-vibrant-light" : "text-gray-200",
className
)}
style={{ zIndex: 100 }}
>
<div
@@ -25,7 +29,11 @@ const Nav = ({ isClient, internalLinks, className }) => (
{internalLinks &&
internalLinks.map(({ href, label }) => (
<li key={href}>
<Link className={getNavClasses(isClient)} to={href}>
<Link
activeClassName="font-bold underline"
className={getNavClasses(isClient)}
to={href}
>
{label}
</Link>
</li>

View File

@@ -2,12 +2,11 @@ import React from "react";
import classnames from "classnames";
import { Link } from "gatsby";
import Image from "@spectrum-icons/workflow/Image";
import Shuffle from "@spectrum-icons/workflow/Shuffle";
const getButtonClasses = (isClient) =>
classnames(
"z-20 rounded-md text-md inline-block px-2 py-1 mt-1 md:py-2 md:px-3 md:my-1 mr-2 text-md hover:underline text-black",
"z-20 rounded-md text-md inline-block px-2 py-1 mt-1 mr-2 text-md hover:underline text-black",
isClient ? "cool-border-small hover:bg-vibrant" : "text-gray-200"
);
@@ -26,10 +25,9 @@ const ActionButtons = ({ isClient, image, shuffleImage }) => (
<Link
className={getButtonClasses(isClient, "muted")}
id="image-link"
title="view image details"
to={`/photogallery/${image.base}/`}
>
<Image aria-label="view image details" />
view image
</Link>
<button
className={getButtonClasses(isClient, "muted")}
@@ -37,18 +35,11 @@ const ActionButtons = ({ isClient, image, shuffleImage }) => (
onClick={() => {
shuffleImage(image);
}}
title="shuffle image"
type="button"
>
<Shuffle aria-label="shuffle image" size="S" />
shuffle background
<Shuffle UNSAFE_className="ml-1" aria-label="shuffle image" size="XS" />
</button>
<Link
className={getButtonClasses(isClient, "muted")}
id="photogallery-link"
to="/photogallery/"
>
Photography Gallery
</Link>
</div>
</div>
);