From 375081657d8d9595388ce6e3eb2117bd904c1064 Mon Sep 17 00:00:00 2001
From: Rebecca Hong <34019925+rebeccahongsf@users.noreply.github.com>
Date: Wed, 24 Apr 2024 09:59:44 -0700
Subject: [PATCH] SUM-47 Theme & Style local footer (#1)
---
app/layout.tsx | 5 +-
src/components/config-pages/local-footer.tsx | 188 +++++++++---------
src/components/elements/action-link.tsx | 18 +-
src/components/elements/button.tsx | 35 ++--
.../elements/icons/InstagramIcon.tsx | 13 +-
.../elements/icons/LinkedInIcon.tsx | 12 +-
src/styles/fonts.tsx | 11 +-
tailwind.config.js | 5 +-
8 files changed, 151 insertions(+), 136 deletions(-)
diff --git a/app/layout.tsx b/app/layout.tsx
index e5383aff..d05fd537 100644
--- a/app/layout.tsx
+++ b/app/layout.tsx
@@ -3,10 +3,11 @@ import BackToTop from "@components/elements/back-to-top";
import PageFooter from "@components/global/page-footer";
import PageHeader from "@components/global/page-header";
import {Icon} from "next/dist/lib/metadata/types/metadata-types";
-import {sourceSans3} from "../src/styles/fonts";
+import { roboto, sourceSans3} from "../src/styles/fonts";
import DrupalWindowSync from "@components/elements/drupal-window-sync";
import {isPreviewMode} from "@lib/drupal/utils";
import UserAnalytics from "@components/elements/user-analytics";
+import clsx from "clsx";
const appleIcons: Icon[] = [60, 72, 76, 114, 120, 144, 152, 180].map(size => ({
url: `https://www-media.stanford.edu/assets/favicon/apple-touch-icon-${size}x${size}.png`,
@@ -45,7 +46,7 @@ export const revalidate = false;
const RootLayout = ({children, modal}: { children: React.ReactNode, modal: React.ReactNode }) => {
const isPreview = isPreviewMode();
return (
-
+
{/* Add Google Analytics and SiteImprove when not in preview mode. */}
{!isPreview &&
diff --git a/src/components/config-pages/local-footer.tsx b/src/components/config-pages/local-footer.tsx
index be5332c0..d16ae392 100644
--- a/src/components/config-pages/local-footer.tsx
+++ b/src/components/config-pages/local-footer.tsx
@@ -14,13 +14,15 @@ import LockupP from "@components/elements/lockup/lockup-p";
import LockupR from "@components/elements/lockup/lockup-r";
import LockupS from "@components/elements/lockup/lockup-s";
import LockupT from "@components/elements/lockup/lockup-t";
-import {JSX} from "react";
-import {H2} from "@components/elements/headers";
+import { JSX } from "react";
+import { H2 } from "@components/elements/headers";
import TwitterIcon from "@components/elements/icons/TwitterIcon";
import YoutubeIcon from "@components/elements/icons/YoutubeIcon";
import FacebookIcon from "@components/elements/icons/FacebookIcon";
-import { Maybe, StanfordLocalFooter} from "@lib/gql/__generated__/drupal.d";
-import {buildUrl} from "@lib/drupal/utils";
+import { Maybe, StanfordLocalFooter } from "@lib/gql/__generated__/drupal.d";
+import { buildUrl } from "@lib/drupal/utils";
+import InstagramIcon from "@components/elements/icons/InstagramIcon";
+import LinkedInIcon from "@components/elements/icons/LinkedInIcon";
const LocalFooter = ({
suFooterEnabled,
@@ -55,23 +57,22 @@ const LocalFooter = ({
line3: suLocalFootLine3,
line4: suLocalFootLine4,
line5: suLocalFootLine5,
- logoUrl: !suLocalFootUseLogo && suLocalFootLocImg?.url ? buildUrl(suLocalFootLocImg?.url).toString() : undefined,
- }
+ logoUrl:
+ !suLocalFootUseLogo && suLocalFootLocImg?.url
+ ? buildUrl(suLocalFootLocImg?.url).toString()
+ : undefined,
+ };
return (
-
-
-
-
-
-
+
+
+
+
- {suLocalFootAddress &&
-
- }
+
+ {suLocalFootAddress &&
}
{suLocalFootAction &&
@@ -79,173 +80,176 @@ const LocalFooter = ({
if (!link.url) return;
return (
-
-
- {link.title}
-
+ {link.title}
- )
+ );
})}
}
- {suLocalFootSocial &&
-
+
+
+ {suLocalFootSocial && (
+
{suLocalFootSocial.map((link, index) => {
if (!link.url) return;
return (
-
-
-
+
+
{link.title}
- )
+ );
})}
- }
-
-
+ )}
-
- {suLocalFootPrimeH &&
-
{suLocalFootPrimeH}
}
- {suLocalFootPrimary &&
+
+ {suLocalFootPrimeH &&
{suLocalFootPrimeH}
}
+ {suLocalFootPrimary && (
{suLocalFootPrimary.map((link, index) => {
if (!link.url) return;
return (
-
-
+
{link.title}
- )
+ );
})}
- }
-
-
+ )}
+
-
- {suLocalFootSecondH &&
-
{suLocalFootSecondH}
}
+
+ {suLocalFootSecondH &&
{suLocalFootSecondH}
}
- {suLocalFootSecond &&
+ {suLocalFootSecond &&
{suLocalFootSecond.map((link, index) => {
if (!link.url) return;
return (
-
-
+
{link.title}
- )
+ );
})}
}
-
-
+
-
-
+
- )
-}
-
-const SocialIcon = ({url}: { url: string }) => {
- if (url.includes("twitter.com")) return
- if (url.includes("youtube.com")) return
- if (url.includes("facebook")) return
+ );
+};
+
+const SocialIcon = ({ url }: { url: string }) => {
+ if (url.includes("facebook")) return
;
+ if (url.includes("linkedin")) return
;
+ if (url.includes("twitter.com")) return
;
+ if (url.includes("instagram.com")) return
;
+ if (url.includes("youtube.com")) return
;
return null;
-}
+};
export interface FooterLockupProps {
- useDefault?: Maybe
- siteName?: Maybe
- lockupOption?: Maybe
- line1?: Maybe
- line2?: Maybe
- line3?: Maybe
- line4?: Maybe
- line5?: Maybe
- logoUrl?: Maybe
+ useDefault?: Maybe;
+ siteName?: Maybe;
+ lockupOption?: Maybe;
+ line1?: Maybe;
+ line2?: Maybe;
+ line3?: Maybe;
+ line4?: Maybe;
+ line5?: Maybe;
+ logoUrl?: Maybe;
}
-const FooterLockup = ({useDefault = true, siteName, lockupOption, ...props}: FooterLockupProps): JSX.Element => {
+const FooterLockup = ({
+ useDefault = true,
+ siteName,
+ lockupOption,
+ ...props
+}: FooterLockupProps): JSX.Element => {
const lockupProps = {
- ...props
- }
+ ...props,
+ };
- lockupOption = useDefault ? "default" : lockupOption
+ lockupOption = useDefault ? "default" : lockupOption;
switch (lockupOption) {
case "none":
return (
-
-
+
+
- )
+ );
case "a":
- return ;
+ return ;
case "b":
- return ;
+ return ;
case "d":
- return ;
+ return ;
case "e":
- return ;
+ return ;
case "h":
- return ;
+ return ;
case "i":
- return ;
+ return ;
case "m":
- return ;
+ return ;
case "o":
- return ;
+ return ;
case "p":
- return ;
+ return ;
case "r":
- return ;
+ return ;
case "s":
- return ;
+ return ;
case "t":
- return ;
+ return ;
}
-
return (
-
-
+
+
-
+
{siteName || "University"}
- )
-
-}
-export default LocalFooter;
\ No newline at end of file
+ );
+};
+export default LocalFooter
diff --git a/src/components/elements/action-link.tsx b/src/components/elements/action-link.tsx
index 7d8ec90b..3671655d 100644
--- a/src/components/elements/action-link.tsx
+++ b/src/components/elements/action-link.tsx
@@ -1,21 +1,21 @@
import Link from "@components/elements/link";
-import {ChevronRightIcon} from "@heroicons/react/20/solid";
-import {HtmlHTMLAttributes} from "react";
-import {twMerge} from "tailwind-merge";
+import { ArrowRightIcon } from "@heroicons/react/20/solid";
+import { HtmlHTMLAttributes } from "react";
+import { twMerge } from "tailwind-merge";
type Props = HtmlHTMLAttributes & {
/**
* Link url.
*/
href: string
-}
+};
-const ActionLink = ({children, ...props}: Props) => {
+const ActionLink = ({ children, ...props }: Props) => {
return (
{children}
-
+
- )
-}
-export default ActionLink;
\ No newline at end of file
+ );
+};
+export default ActionLink
diff --git a/src/components/elements/button.tsx b/src/components/elements/button.tsx
index 6b907455..e895a996 100644
--- a/src/components/elements/button.tsx
+++ b/src/components/elements/button.tsx
@@ -1,8 +1,9 @@
import Link from "@components/elements/link";
-import {twMerge} from "tailwind-merge"
-import {HtmlHTMLAttributes, MouseEventHandler} from "react";
-import {Maybe} from "@lib/gql/__generated__/drupal.d";
-import {clsx} from "clsx";
+import { twMerge } from "tailwind-merge";
+import { HtmlHTMLAttributes, MouseEventHandler } from "react";
+import { Maybe } from "@lib/gql/__generated__/drupal.d";
+import { clsx } from "clsx";
+import { ArrowRightIcon } from "@heroicons/react/20/solid";
type Props = HtmlHTMLAttributes & {
/**
@@ -53,17 +54,18 @@ export const Button = ({
className,
...props
}: Props) => {
-
- const standardClasses = clsx(
- {
- "flex items-center w-fit mx-auto": centered,
- "inline-block text-center w-fit": !centered,
- "btn btn--big transition text-5xl text-white hocus:text-white bg-digital-red hocus:bg-black no-underline hocus:underline py-6 px-12 font-normal": big && !secondary,
- "btn btn--secondary transition text-digital-red border-2 border-digital-red hocus:border-black no-underline hocus:underline py-4 px-8 font-normal": !big && secondary,
- "btn btn--big btn--secondary transition text-5xl text-digital-red border-2 border-digital-red hocus:border-black no-underline hocus:underline py-6 px-12 font-normal": big && secondary,
- "btn bg-digital-red font-normal text-white hocus:bg-black hocus:text-white py-4 px-8 no-underline hocus:underline transition": !big && !secondary,
- }
- )
+ const standardClasses = clsx({
+ "flex items-center w-fit mx-auto": centered,
+ "inline-block text-center w-fit": !centered,
+ "btn btn--big transition text-5xl text-white hocus:text-white bg-digital-red border-2 border-white hocus:outline hocus:outline-3 hocus:outline-digital-red no-underline hocus:underline py-6 px-12 font-normal rounded-full m-4":
+ big && !secondary,
+ "btn btn--secondary transition text-digital-red hocus:text-white hocus:bg-digital-red border-2 border-digital-red hocus:border-white no-underline hocus:underline hocus:outline hocus:outline-3 hocus:outline-digital-red py-4 px-16 font-normal rounded-full":
+ !big && secondary,
+ "btn btn--big btn--secondary transition text-5xl text-digital-red hocus:text-white hocus:bg-digital-red border-2 border-digital-red hocus:border-white no-underline hocus:underline hocus:outline hocus:outline-3 hocus:outline-digital-red py-6 px-20 font-normal rounded-full":
+ big && secondary,
+ "btn bg-digital-red font-normal text-white border-2 border-white hocus:text-white hocus:outline hocus:outline-3 hocus:outline-digital-red py-4 px-8 no-underline hocus:underline transition rounded-full m-4":
+ !big && !secondary,
+ })
if (!href || buttonElem) {
return (
@@ -84,8 +86,9 @@ export const Button = ({
{...props}
>
{children}
+
)
}
-export default Button
\ No newline at end of file
+export default Button
diff --git a/src/components/elements/icons/InstagramIcon.tsx b/src/components/elements/icons/InstagramIcon.tsx
index 2540ed08..185df308 100644
--- a/src/components/elements/icons/InstagramIcon.tsx
+++ b/src/components/elements/icons/InstagramIcon.tsx
@@ -1,14 +1,15 @@
-import {HTMLAttributes} from "react";
+import { HTMLAttributes } from "react";
const InstagramIcon = (props: HTMLAttributes) => {
return (
-