-
Notifications
You must be signed in to change notification settings - Fork 72
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
Phase 2 CSS improvements for consent banner and overlay #4334
Conversation
Passing run #4838 ↗︎
Details:
Review all test suite changes for PR #4334 ↗︎ |
Hey @allisonking, heads up, I just made a tiny fix to the drop-down carets, they were being pushed out of the div if the corresponding text was too wide 279a9d1 |
Got it, starting review now! |
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.
tested it out and it's looking nice, great work! a few comments but nothing blocking. largest thing might be the carets in firefox
}) => { | ||
const [isMobile, setIsMobile] = useState(window.innerWidth < 768); |
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.
can we put 768
as a constant somewhere?
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.
this whole state + useEffect could go into hooks.ts
to keep this component cleaner
|
||
useEffect(() => { | ||
const handleResize = () => { | ||
setIsMobile(window.innerWidth < 768); |
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.
a lil bit of repeated code here—could pull out into a func? or at least make the 768 a reused constant
renderModalFooter={() => | ||
renderModalFooter({ | ||
onClose: handleCloseModal, | ||
isMobile: false, |
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.
hm why is this false
?
min-height: 40px; | ||
align-items: center; | ||
|
||
& svg { |
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.
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'm on firefox 116 (which is a little out of date) which doesn't support it, seems to only be a recent thing https://caniuse.com/css-nesting
/> | ||
) : null | ||
} | ||
renderModalContent={({ onClose }) => ( | ||
renderModalContent={() => ( |
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.
if this no longer needs an argument, I think it'd be cleaner to revert it back to a component, i.e.
modalContent={
<div>
...
</div>
}
or even to let this be children
Thanks for the review @allisonking 🙏 I addressed the visual issues but in the interest of time, I'm moving the code-cleanup recommendations to the next sprint. I'll address them when I come back from break. |
Closes #4274
Description Of Changes
This PR focused on:
I tried to make the layout changes with just CSS but there were enough differences between the desktop and mobile layouts that I think it made sense to have an
isMobile
prop to conditionally render the components instead of trying to nest them or modify them with CSS.Code Changes
isMobile
state to theConsentBanner.tsx
ConsentModal.tsx
to usefides-modal-header
,fides-modal-body
, andfides-modal-footer
Steps to Confirm
Pre-Merge Checklist
CHANGELOG.md