-
Notifications
You must be signed in to change notification settings - Fork 3
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
feat(imageType): set image types to change object fit #862
Conversation
@@ -118,7 +122,14 @@ const StoryMedia: FunctionComponent<Props> = ({ | |||
key={index} | |||
style={{width: `${imageWidth}%`}}> | |||
<div className={styles.imageContainer}> | |||
<img className={styles.photo} src={imageUrl} /> | |||
<img |
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 story gallery component is getting really big. Could you clean it up by pulling out a StoryGalleryImage component with captions for example
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.
aye 👌 will do
src/scripts/types/image-type.ts
Outdated
@@ -0,0 +1,4 @@ | |||
export enum ImageType { | |||
Photo = 'photo', | |||
Chart = 'chart' |
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.
Chart is probably not the best type here. It could be any other image which should be contained. Why not call it what it is like 'contain' and 'cover'?
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.
Sure, i can change it. I just thought contain and cover would be a bit confusing in the story mapper.
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 good point, but I guess labeling a photograph as "chart" just to display it as contained is more confusing. At least for me 😄
}}> | ||
{images.map((image, index) => { | ||
const imageCaption = imageCaptions?.find((_, i) => i === index); | ||
const imageType = imageFits?.find((_, i) => i === index); |
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 imageFit
closes #856