-
Notifications
You must be signed in to change notification settings - Fork 6
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
DSD-1521: Add sizeBasedOn prop to Image #1465
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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 looks good but I'm not sure if it's working when sizeBasedOn
is set to height and the aspect ratios are updated. Or rather, is it only supposed to work when aspectRatio is original?
src/components/Image/Image.tsx
Outdated
@@ -29,9 +29,11 @@ export const imageSizesArray = [ | |||
"large", | |||
] as const; | |||
export const imageTypesArray = ["default", "circle"] as const; | |||
export const imageSizeBasedOnArray = ["height", "width"] as const; |
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 can try to reuse the logoSizeBasedOnArray
but rename it to something more generic for image and logo and any other component that may use height and width as values.
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.
Added dimensionTypeArray
to types.ts and changed the imports.
height: "auto", | ||
overflow: "hidden", | ||
const sizes = { | ||
xxxsmall: 32, |
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.
Do you not need the specific "px" text in the value? Don't think you need to change anything but I wonder if the number 64 is the same as the string "64px" in css.
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.
Ah, I now see how you're using this. Never mind the comment!
I tested sizeBasedOn height with different aspect ratio on the Storybook With Controls page and it works correctly. Let me know if I am misunderstanding. |
This matches the behavior of size based on width. The height of the image will be determined by the |
Hmm yeah that makes more sense. Let's wait on Marty to review this but looks good otherwise. |
Overall, this is working well, but I am seeing one issue. When I think this is what @EdwinGuzman was also seeing. |
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.
Very nice. The last update works great.
Fixes JIRA ticket DSD-1521
This PR does the following:
How has this been tested?
Locally on Storybook
Accessibility concerns or updates
N/A
Checklist:
Front End Review: