-
Notifications
You must be signed in to change notification settings - Fork 43
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
Chore(web): Add ImageBlock #511
Conversation
✅ Deploy Preview for reearth-web ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #511 +/- ##
==========================================
+ Coverage 26.65% 27.10% +0.44%
==========================================
Files 1342 1321 -21
Lines 144699 142442 -2257
Branches 3485 3542 +57
==========================================
+ Hits 38571 38602 +31
+ Misses 105005 102791 -2214
+ Partials 1123 1049 -74
Flags with carried forward coverage won't be shown. Click here to find out more.
|
|
||
type Props = { | ||
src: NonNullable<ImgHTMLAttributes<HTMLImageElement>["src"]>; | ||
align?: "left" | "center" | "right"; // default center |
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 shouldn't need the comments here in the props.
Can you
- remove the comments
- Inside the props destructuring(line 15) assign defaults (ie.
({src, align="center", fit="cover", .. .. . .. })
- Lastly update the styled component's props to expect a value for fit and align always and remove the fallbacks
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 code has changed.
�Above code no longer exists.
# Conflicts: # web/src/beta/components/Icon/icons.ts
if (src) { | ||
return ( |
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.
Like the Video block , please use a ternary operator with one return 🙇🏻
} | ||
return ( | ||
<BlankImageBox> | ||
<Icon icon={"image"} color={"#2e2e2e"} size={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.
Don't need { } for strings
so icon="image" color="#2e2e2e"
}; | ||
|
||
const Wrapper = styled.div` | ||
position: absolute; |
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.
Don't think you need this
src: NonNullable<React.ImgHTMLAttributes<HTMLImageElement>["src"]>; | ||
alt?: React.ImgHTMLAttributes<HTMLImageElement>["alt"]; |
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 don't need to type so specifically. For some elements, where there are specific values needed, this is good.
But for something like src and alt, any string is okay, so you can just type these as string
Overview
Add ImageBlock
https://deploy-preview-511--reearth-web.netlify.app/storybook/?path=/story/beta-components-blocks-imageblock--default