-
Notifications
You must be signed in to change notification settings - Fork 199
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
[QUAR-642] [BpkCardWrapper] Add more info button and body section to card wrapper #3730
base: main
Are you sure you want to change the base?
Conversation
Visit https://backpack.github.io/storybook-prs/3730 to see this build running in a browser. |
Visit https://backpack.github.io/storybook-prs/3730 to see this build running in a browser. |
Visit https://backpack.github.io/storybook-prs/3730 to see this build running in a browser. |
Visit https://backpack.github.io/storybook-prs/3730 to see this build running in a browser. |
Visit https://backpack.github.io/storybook-prs/3730 to see this build running in a browser. |
Visit https://backpack.github.io/storybook-prs/3730 to see this build running in a browser. |
Visit https://backpack.github.io/storybook-prs/3730 to see this build running in a browser. |
Visit https://backpack.github.io/storybook-prs/3730 to see this build running in a browser. |
Visit https://backpack.github.io/storybook-prs/3730 to see this build running in a browser. |
Visit https://backpack.github.io/storybook-prs/3730 to see this build running in a browser. |
Visit https://backpack.github.io/storybook-prs/3730 to see this build running in a browser. |
Can you add screenshots for the visual changes in PR description? |
|
||
.bpk-card-wrapper { | ||
padding: 0.1rem; |
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.
why give fixed number here? will it not impact the visual test cases of other consumers already using bpk-card-wrapper
?
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.
yes, you are right. I’ve updated the padding to use the predefined spacing token.
Visit https://backpack.github.io/storybook-prs/3730 to see this build running in a browser. |
1 similar comment
Visit https://backpack.github.io/storybook-prs/3730 to see this build running in a browser. |
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.
LGTM but please check for build failures and warnings and visual tests for consumer of the component
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 see some design conflict with expand version of the wrapper for eg. rounded corner for the body details are not present on desktop or mobile.
Visit https://backpack.github.io/storybook-prs/3730 to see this build running in a browser. |
All the checks has been passed and visual test is picked up by Percy to run on CI. |
I checked with the design team, and they confirmed that we should maintain the full card look with rounded corners as long as the transition is smooth. |
Visit https://backpack.github.io/storybook-prs/3730 to see this build running in a browser. |
Visit https://backpack.github.io/storybook-prs/3730 to see this build running in a browser. |
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.
Just a small UI change needed, otherwise LGTM :)
Co-authored-by: Kirsty Bryce <[email protected]>
Visit https://backpack.github.io/storybook-prs/3730 to see this build running in a browser. |
Visit https://backpack.github.io/storybook-prs/3730 to see this build running in a browser. |
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.
LGTM please check the pipeline failures.
border-radius: 0 0 tokens.$bpk-border-radius-md tokens.$bpk-border-radius-md; | ||
transition: border-radius 0.25s ease-in-out; | ||
border-radius: tokens.$bpk-border-radius-md; | ||
background-color: tokens.$bpk-private-info-banner-default-day; |
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 should not use a private component token however the same colour exists as
background-color: tokens.$bpk-private-info-banner-default-day; | |
background-color: tokens.$bpk-canvas-contrast-day; |
display: flex; | ||
padding: tokens.bpk-spacing-base(); | ||
flex-direction: column; | ||
background-color: tokens.$bpk-private-info-banner-default-day; |
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 should not use a private component token however the same colour exists as
background-color: tokens.$bpk-private-info-banner-default-day; | |
background-color: tokens.$bpk-canvas-contrast-day; |
|
||
&--link-text { | ||
width: max-content; | ||
color: tokens.$bpk-private-button-link-normal-foreground-day; |
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.
color: tokens.$bpk-private-button-link-normal-foreground-day; | |
color: tokens.$bpk-text-link-day; |
@@ -31,27 +37,127 @@ type Props = { | |||
className?: string | null; | |||
backgroundColor: string; | |||
header: ReactNode; | |||
body?: { |
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.
body as a name I think might be confusing to consumers, maybe we could call this expandContent
so its clear where this would be.
wdyt?
card, | ||
className = null, | ||
header, | ||
}: Props) => { | ||
const classNames = getClassName('bpk-card-wrapper', className); | ||
|
||
return ( | ||
<CardContext.Provider value={{ elevated: false }}> | ||
const [isBodyOpen, setIsBodyOpen] = useState(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.
For this I would call this
const [isBodyOpen, setIsBodyOpen] = useState(false); | |
const [isExpanded, setIsExpanded] = useState(false); |
return ( | ||
<CardContext.Provider value={{ elevated: false }}> | ||
const [isBodyOpen, setIsBodyOpen] = useState(false); | ||
const bodyRef = useRef<HTMLDivElement>(null); |
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.
const bodyRef = useRef<HTMLDivElement>(null); | |
const expandRef = useRef<HTMLDivElement>(null); |
</div> | ||
); | ||
|
||
const headerWithBodyDiv = body && ( |
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 would call this expandableHeader
@@ -69,4 +79,56 @@ | |||
opacity: 1; | |||
} | |||
} | |||
|
|||
&--body { |
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.
&--body { | |
&--expand { |
https://skyscanner.atlassian.net/browse/QUAR-642
Figma designs: https://www.figma.com/design/22unPHkDCzqJkd9rKzTiGY/T%26Cs-Ads?node-id=79-11694&t=MTrz7gFIDvIgP4k2-4
For the inline ads, we need to have a dropdown box for T&C in the ad card wrapper. We're currently use a custom component to do this for desktop ads, but we need to add it to mobile ads as well. Instead of duplicating the custom wrapper into the mobile web ad components, we want to use the
BpkCardWrapper
component instead. To use it though we need to add themore info
button and dropdown body element.More Info
Less Info
Remember to include the following changes:
[KOA-123][BpkButton] Updating the colour
README.md
(If you have created a new component)README.md