Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HOTFIX:SUL23-697 | add green library extended hours notice #250

Merged
merged 1 commit into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/components/node/stanford-page/home-page/today-hours.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import SelectList from "@/components/patterns/elements/select-list"
import {buildUrl} from "@/lib/drupal/utils"
import {NodeSulLibrary} from "@/lib/gql/__generated__/drupal.d"
import Link from "next/link"
import MoonStarsIcon from "@/components/patterns/icons/MoonStarsIcon"

type HoursProps = HTMLAttributes<HTMLDivElement> & {
libraries: NodeSulLibrary[]
Expand Down Expand Up @@ -95,6 +96,17 @@ const LibrariesTodayHours = ({libraries, ...props}: {libraries: HoursProps["libr
</div>
}
/>
<div className="rs-px-1 w-full bg-cardinal-red py-9 text-16 text-white shadow-md">
<MoonStarsIcon className="mr-02em inline" />
<span className="font-bold">New!</span>{" "}
<Link
href="/extended-green-library-hours"
className="grow-0 font-normal text-white underline hocus:text-white hocus:no-underline"
>
Late night study space
</Link>{" "}
available at Green.
</div>
</div>
)
}
Expand Down
9 changes: 9 additions & 0 deletions src/components/patterns/icons/MoonStarsIcon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import {SVGProps} from "react"

const MoonStarsIcon = (props: SVGProps<SVGSVGElement>) => (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I've ever seen the pattern of: take an icon, turn it into an svg, turn the svg into a react component, then use the react component in the layout, but now that I have, I've got to say, I kind of like it. 👍

<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="#ffffff" viewBox="0 0 16 16" {...props}>
<path d="M6 .278a.77.77 0 0 1 .08.858 7.2 7.2 0 0 0-.878 3.46c0 4.021 3.278 7.277 7.318 7.277q.792-.001 1.533-.16a.79.79 0 0 1 .81.316.73.73 0 0 1-.031.893A8.35 8.35 0 0 1 8.344 16C3.734 16 0 12.286 0 7.71 0 4.266 2.114 1.312 5.124.06A.75.75 0 0 1 6 .278" />
<path d="M10.794 3.148a.217.217 0 0 1 .412 0l.387 1.162c.173.518.579.924 1.097 1.097l1.162.387a.217.217 0 0 1 0 .412l-1.162.387a1.73 1.73 0 0 0-1.097 1.097l-.387 1.162a.217.217 0 0 1-.412 0l-.387-1.162A1.73 1.73 0 0 0 9.31 6.593l-1.162-.387a.217.217 0 0 1 0-.412l1.162-.387a1.73 1.73 0 0 0 1.097-1.097zM13.863.099a.145.145 0 0 1 .274 0l.258.774c.115.346.386.617.732.732l.774.258a.145.145 0 0 1 0 .274l-.774.258a1.16 1.16 0 0 0-.732.732l-.258.774a.145.145 0 0 1-.274 0l-.258-.774a1.16 1.16 0 0 0-.732-.732l-.774-.258a.145.145 0 0 1 0-.274l.774-.258c.346-.115.617-.386.732-.732z" />
</svg>
)
export default MoonStarsIcon
Loading