-
Notifications
You must be signed in to change notification settings - Fork 843
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
Image component #262
Image component #262
Conversation
Putting here mainly as a reminder: We should be sure to require the |
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 will be great for the home page.
What happened to the dungeons and dragons image?
</p> | ||
<ul> | ||
<li> | ||
<EuiCode>size</EuiCode> accepts <EuiCode>s / m / l / original / fullWidth</EuiCode>. |
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.
Missing xl
option
src/components/image/image.js
Outdated
super(props); | ||
|
||
this.state = { | ||
isImageFullscreen: 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.
Should isImageFullscreen
be camel-cased and be isImageFullScreen
?
src/components/image/image.js
Outdated
this.onKeyDown = this.onKeyDown.bind(this); | ||
} | ||
|
||
onKeyDown = event => { |
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 is not passed as a prop to anything so pressing the esc
key does not close the full screen image
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.
Ha. Knew I forgot something ;-)
@nreese Feedback addressed and added an ESC to close mechanism. |
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
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.
- No shadow should not be default -- Should shadow only show if it's clickable?
- Allow full screen is harder because it should really only happen if the image is displayed much smaller than the original. Not sure what the typical implementation will be.
- I think the default size should be original.
Do we want to address the hover states (icon overlay) in this PR or later?
<ul> | ||
<li> | ||
<EuiCode>size</EuiCode> accepts <EuiCode>s / m / l / xl / original / fullWidth</EuiCode>. | ||
The later will set the figure to stretch to 100% of its container. |
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.
sp: "later" -> "latter"
</li> | ||
<li> | ||
<EuiCode>caption</EuiCode> will provide a caption to the image. | ||
</li> |
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.
title
is a prop as well
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.
Addressed
text: ( | ||
<p> | ||
Images can be sized by passing the <EuiCode>size</EuiCode> prop a value | ||
of <EuiCode>s / m / l / original / fullWidth</EuiCode>. |
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.
add 'xl' to this list as well
OK. Feedback addressed.
I also went ahead and added a small expand icon. This requires a new prop |
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.
Looks good, except for one inconsistency with fullScreenIconColor
.
allowFullScreen | ||
caption="I am a starship. Zooom!" | ||
title="Click me to see in full screen." | ||
fullScreenIconColor="default" |
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.
Should this be fullScreenIconColor="dark"
not default
?
Oh and I just saw two more things, the second one we can either address now or when we do more in-depth documentation.
|
Good spots. Flipped the alts in, adjusted their text and fixed that default/dark issue. Gonna merge. |
@alexfrancoeur Its already in 6.2 and being used on the home page |
Work in progress on an Image component. Need to discuss with @cchaos and figure out some stuff around sizing.
cc @alexfrancoeur @nreese. This will give you what you need for the expandable screenshots in the homepage v2.
Questions for review
hasShadow
be on by default?allowFullScreen
be on by default?size
be set?