-
Notifications
You must be signed in to change notification settings - Fork 1
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
SUL23-438: Added location link to list of branches on the homepage #150
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Preview branch on Vercel is here: https://su-library-7f8up786g-stanford-libraries.vercel.app/ |
suLibraryHours: library.suLibraryHours, | ||
suLibraryContactImg: library.suLibraryContactImg as MediaImage, | ||
suLibraryBanner: library.suLibraryBanner as MediaImage, | ||
map: library.suLibraryMapLink?.url ?? undefined |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need the ?? undefined
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It threw a typescript error without it. Because of the Maybe
I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah. If you use map?: Maybe<string>
it should fix that.
@@ -80,6 +83,9 @@ const LibrariesTodayHours = ({libraries, ...props}: { libraries: HoursProps["lib | |||
{library?.suLibraryHours && | |||
<TodayLibraryHours branchId={library.suLibraryHours}/> | |||
} | |||
{library?.map && | |||
<span className="float-right w-auto inline"><Link href={library?.map} aria-label="Link to map"><MapPinIcon title="Map" width={25} className="mr-5 inline"/>Location</Link></span> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like some sr-only
descriptive text would be helpful here. like <span className="sr-only">{library.title}</span> Location
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I put this in the right place...
@@ -80,6 +84,9 @@ const LibrariesTodayHours = ({libraries, ...props}: { libraries: HoursProps["lib | |||
{library?.suLibraryHours && | |||
<TodayLibraryHours branchId={library.suLibraryHours}/> | |||
} | |||
{library?.map && | |||
<span className="float-right w-auto inline"><span className="sr-only">{library.title} Location</span><Link href={library?.map} aria-label="Link to map"><MapPinIcon title="Map" width={25} className="mr-5 inline"/>Location</Link></span> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the sr-only
needs to be within the <Link>
also you can remove the aria-label
property.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok this is fixed.
@@ -80,6 +84,9 @@ const LibrariesTodayHours = ({libraries, ...props}: { libraries: HoursProps["lib | |||
{library?.suLibraryHours && | |||
<TodayLibraryHours branchId={library.suLibraryHours}/> | |||
} | |||
{library?.map && | |||
<span className="float-right w-auto inline"><Link href={library?.map} ><span className="sr-only">{library.title} Location</span><MapPinIcon title="Map" width={25} className="mr-5 inline"/>Location</Link></span> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now you have 2 "location" strings. either wrap the second in aria-hidden
or remove the first one. Ensure there is a space though. Sometimes you have to use &nbps;
to force a space at the end of tag.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed the first one since the second is visible, and included the &nbps; for safety. Also got that git hook for prettier
to do its thing correctly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks.
READY FOR REVIEW
Summary
Review By (Date)
Criticality
Urgency
Review Tasks
Setup tasks and/or behavior to test
Site Configuration Sync
Front End Validation
Backend / Functional Validation
Code
Code security
General
Affected Projects or Products
Associated Issues and/or People
@mention
them here)Resources