-
-
Notifications
You must be signed in to change notification settings - Fork 112
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
fix: fix the size of the image in CarouselCard component #431
Conversation
Pull Request Test Coverage Report for Build 442
💛 - Coveralls |
const ref = {}; | ||
expect(carouselCardContainerStyles(ref)).toBeNull(); | ||
}); | ||
it('should return an object with a heght of 100% if the parentNode the ref passed has an height set', () => { |
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.
height
height: '100%', | ||
}); | ||
}); | ||
it('should return an object with a heght of 340 if the parentNode of the ref passed does not have an height set', () => { |
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.
same ^^
src/components/CarouselCard/index.js
Outdated
@@ -5,7 +5,7 @@ import classnames from 'classnames'; | |||
import { Provider } from './context'; | |||
import Indicators from './indicators'; | |||
import AnimationButton from './animationButton'; | |||
import { getItemIndex, getChildTabNodes, insertChildOrderly } from './utils'; | |||
import { getItemIndex, getChildTabNodes, insertChildOrderly, carouselCardContainerStyles } from './utils'; |
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.
getContainerStyles since it is a function, would be carouselCardContainerStyles if it were a const.
<div> | ||
<img className="rainbow-carousel-image_image" src={src} alt={assistiveText} /> | ||
<div className="rainbow-carousel-image_content-image-container"> | ||
<div className="rainbow-carousel-image_image" style={this.getImageSrc()} alt={assistiveText} /> |
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 alt attribute is only for img element so here we need to use the AssistiveText component in order to screen readers take the assistive text. Then:
<div className="rainbow-carousel-image_content-image-container">
<div className="rainbow-carousel-image_image" style={this.getImageSrc()} />
<AssistiveText text={assistiveText} />
</div>
fix: #408