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

Weekly PR from Staging to Main #988

Closed
wants to merge 19 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
fed8c2e
adding focus and keyboard accessibility to the cookie consent buttons
Amberroseweeks Oct 9, 2024
a9a44f3
add role of checkbox and label to group
Amberroseweeks Oct 10, 2024
df3fdbf
Merge branch 'staging' into amberroseweeks-859-cookie-consent-keyboar…
Amberroseweeks Oct 17, 2024
038fa9e
updating to use dynamic labels targetings the h2
Amberroseweeks Oct 18, 2024
4f04f2c
fix donate option not visible in mobile nav dropdown
vinhyan Oct 29, 2024
6133dc6
Merge pull request #985 from vinhyan/vinhyan/976-fix-donate-option-no…
bacitracin Oct 31, 2024
16d4408
fixing eslint errors - no errors
Amberroseweeks Nov 2, 2024
db82d6a
improving the checkbox by adding aria describedby and connecting the …
Amberroseweeks Nov 2, 2024
bf5c0e2
Merge branch 'main' of https://github.com/CodeForPhilly/vacant-lots-p…
Amberroseweeks Nov 2, 2024
b6c1d19
Merge branch 'amberroseweeks-859-cookie-consent-keyboard-a11y' of htt…
Amberroseweeks Nov 2, 2024
c8a35ba
Merge branch 'amberroseweeks-628-filter-options-new-branch' into ambe…
Amberroseweeks Nov 3, 2024
cd6f9a1
Merge branch 'amberroseweeks-628-filter-checkbox-role-new-branch' int…
Amberroseweeks Nov 3, 2024
08addb8
Merge pull request #945 from Amberroseweeks/amberroseweeks-859-cookie…
bacitracin Nov 3, 2024
b92fa67
Merge pull request #987 from Amberroseweeks/amberroseweeks-628-filter…
bacitracin Nov 3, 2024
362dcde
adding role of checkbox and aria-describedby
Amberroseweeks Nov 3, 2024
257a9ae
cleaning up aria-checked code
Amberroseweeks Nov 5, 2024
f2d09b4
Merge pull request #989 from Amberroseweeks/amberroseweeks-663-checkb…
bacitracin Nov 5, 2024
7a4605b
make sure land bank filter works
nlebovits Nov 14, 2024
853396c
Merge pull request #999 from CodeForPhilly/lebovits/fix-land-bank-filter
nlebovits Nov 14, 2024
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
174 changes: 78 additions & 96 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@
-webkit-transform: translateZ(0);
}
.mobileIconLinkNav {
@apply px-0 text-base max-h-52 overflow-hidden fixed w-full z-50 shadow-2xl rounded-md border-1 border-gray-200 bg-gray-0;
@apply px-0 text-base max-h-64 overflow-hidden fixed w-full z-50 shadow-2xl rounded-md border-1 border-gray-200 bg-gray-0;
transform: translateZ(0);
-webkit-transform: translateZ(0);
}
Expand Down
31 changes: 27 additions & 4 deletions src/components/CookieConsentBanner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@
import { ThemeButton } from './ThemeButton';
import { Check, X } from '@phosphor-icons/react';
import { useCookieContext } from '@/context/CookieContext';
import { useEffect, useState } from 'react';
import { useEffect, useState, useRef } from 'react';

const CookieConsentBanner = () => {
const { shouldShowBanner, setShouldAllowCookies, setShouldShowBanner } =
useCookieContext();

const bannerRef = useRef<HTMLDivElement>(null);
const inputRef = useRef<HTMLInputElement>(null);

Check warning on line 13 in src/components/CookieConsentBanner.tsx

View workflow job for this annotation

GitHub Actions / lint

'inputRef' is assigned a value but never used

const [isClientSide, setIsClientSide] = useState(false);

useEffect(() => {
Expand All @@ -21,34 +24,54 @@
setShouldShowBanner(false);
};

useEffect(() => {
// Focus on the banner when it becomes visible
if (shouldShowBanner && bannerRef.current) {
// Use setTimeout to ensure focus is applied after DOM updates
setTimeout(() => {
bannerRef.current?.focus();
}, 0);
}
}, [shouldShowBanner]); // Trigger focus when shouldShowBanner changes

if (!isClientSide) return null;

return (
<div
role="region"
tabIndex={-1} // Make the div focusable
ref={bannerRef} // Attach the ref to the banner
aria-labelledby="cookie_heading"
className={`${
shouldShowBanner
? 'md:flex fixed inset-x-0 bottom-0 z-20 justify-between bg-blue-200 p-4 sm:p-6'
: 'hidden'
}`}
>
<div>
<div className="heading-md">Can we store cookies to your browser?</div>
<h2 className="heading-md" id="cookie_heading">
Can we store cookies to your browser?
</h2>
<div className="body-sm">
This provides you a nice experience preserving your filtering, your
position on the map and your property saved list.
<p>
This provides you a nice experience preserving your filtering, your
position on the map and your property saved list.
</p>
</div>
</div>

<div className="flex justify-end gap-2 pt-4 sm:pt-0">
<div className="flex flex-none items-center gap-x-2">
<ThemeButton
tabIndex={1}
color="tertiary"
label="Decline"
startContent={<X />}
onPress={() => onClickButton(false)}
/>

<ThemeButton
tabIndex={2}
color="primary"
label="Accept"
startContent={<Check />}
Expand Down
Loading
Loading