Skip to content

Commit

Permalink
Merge branch '1.x' into feature/SUP-190--textAreaParagraph
Browse files Browse the repository at this point in the history
  • Loading branch information
rebeccahongsf committed May 3, 2024
2 parents 763a319 + e00d526 commit ef2ef5a
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 18 deletions.
8 changes: 4 additions & 4 deletions src/components/elements/action-link.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Link from "@components/elements/link";
import {ChevronRightIcon} from "@heroicons/react/20/solid";
import {ArrowLongRightIcon} from "@heroicons/react/20/solid";
import {HtmlHTMLAttributes} from "react";
import {twMerge} from "tailwind-merge";

Expand All @@ -10,11 +10,11 @@ type Props = HtmlHTMLAttributes<HTMLAnchorElement> & {
href: string
}

const ActionLink = ({children, ...props}: Props) => {
const ActionLink = ({ children, className, ...props }: Props) => {
return (
<Link {...props} className={twMerge("relative", props.className)}>
<Link {...props} className={twMerge("relative", className?.replace("link--action", ""))}>
{children}
<ChevronRightIcon height={20} className="ml-2 inline-block mb-2"/>
<ArrowLongRightIcon height={20} className="ml-2 inline-block mb-2"/>
</Link>
)
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/elements/button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export const Button = ({
return (
<Link
href={href}
className={twMerge(standardClasses, className)}
className={twMerge(standardClasses, className?.replace("button", ""))}
{...props}
>
{children}
Expand Down
12 changes: 6 additions & 6 deletions src/components/elements/link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ type Props = HtmlHTMLAttributes<HTMLAnchorElement | HTMLButtonElement> & LinkPro
href: string
}

const DrupalLink = ({href, className, children, ...props}: Props) => {
const DrupalLink = ({href, children, ...props}: Props) => {
// Make sure all links have a href.
href = href || "#"
const drupalBase: string = (process.env.NEXT_PUBLIC_DRUPAL_BASE_URL || "").replace(/\/$/, "");
Expand All @@ -21,20 +21,20 @@ const DrupalLink = ({href, className, children, ...props}: Props) => {
href = href.replace(drupalBase, "").replace("<front>", "/");
}

if (className?.includes("link--action")) {
if (props.className?.includes("link--action")) {
return (
<ActionLink href={href} {...props}>
{children}
</ActionLink>
)
}

if (className?.includes("button")) {
if (props.className?.includes("button")) {
return (
<Button
href={href}
big={className.includes("--big")}
secondary={className.includes("--secondary")}
big={props.className.includes("--big")}
secondary={props.className.includes("--secondary")}
{...props}
>
{children}
Expand All @@ -43,7 +43,7 @@ const DrupalLink = ({href, className, children, ...props}: Props) => {
}

return (
<Link href={href} className={className} {...props}>
<Link href={href} {...props}>
{children}
{href.startsWith("mailto") &&
<EnvelopeIcon width={20} className="ml-4 inline-block"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ const MediaCaptionParagraph = ({paragraph, ...props}: Props) => {
}
{videoUrl && <Oembed url={videoUrl}/>}

<figcaption className="text-archway-dark">
<figcaption>
{paragraph.suMediaCaptionLink?.url &&
<Link href={paragraph.suMediaCaptionLink.url} className="link--action">
<Link href={paragraph.suMediaCaptionLink.url} className="link--action text-stone-dark hocus:text-archway-dark">
{paragraph.suMediaCaptionLink.title}
</Link>
}

<Wysiwyg html={paragraph.suMediaCaptionCaption?.processed}/>
<Wysiwyg html={paragraph.suMediaCaptionCaption?.processed} className="text-archway-dark children:text-18 rs-mb-4"/>

</figcaption>
</figure>
Expand Down
10 changes: 6 additions & 4 deletions tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,12 @@ module.exports = {
scale: {
'-100': '-1',
},
colors: {
'press-indigo': '#003D69',
'press-grass': '#00593E',
},
},
colors: {
'press-indigo': '#003D69',
'press-grass': '#00593E',
'press-bay-light-light': '#a0d2bf',
'press-sand': '#9c9286',
},
},
plugins: [
Expand Down

0 comments on commit ef2ef5a

Please sign in to comment.