Skip to content

Commit

Permalink
Merge pull request #47 from vtex-apps/feat/image-width
Browse files Browse the repository at this point in the history
Add width prop to product image block
  • Loading branch information
lucasecdb authored Mar 9, 2020
2 parents 7c0be0d + 5915452 commit f0e1a6b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Added
- Prop `width` to `product-list-image` block.

## [0.18.1] - 2020-03-09
### Changed
Expand Down
8 changes: 6 additions & 2 deletions react/Image.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ const CSS_HANDLES = [
'productImage',
] as const

const Image: FunctionComponent = () => {
interface ImageProps {
width?: number
}

const Image: FunctionComponent<ImageProps> = ({ width = 96 }) => {
const { item, loading } = useItemContext()
const handles = useCssHandles(CSS_HANDLES)

Expand All @@ -46,7 +50,7 @@ const Image: FunctionComponent = () => {
className={`${handles.productImageContainer} ${opaque(
item.availability
)}`}
style={{ width: '96px' }}
style={{ width }}
>
<a
className={handles.productImageAnchor}
Expand Down
2 changes: 1 addition & 1 deletion react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"eslint-config-vtex-react": "^5.1.0",
"prettier": "^1.19.1",
"tslint-eslint-rules": "^5.4.0",
"typescript": "3.7.3",
"typescript": "3.8.3",
"vtex.styleguide": "http://vtex.vteximg.com.br/_v/public/typings/v1/[email protected]/public/@types/vtex.styleguide",
"vtex.render-runtime": "http://vtex.vteximg.com.br/_v/public/typings/v1/[email protected]/public/@types/vtex.render-runtime",
"vtex.device-detector": "http://vtex.vteximg.com.br/_v/public/typings/v1/[email protected]/public/@types/vtex.device-detector",
Expand Down
8 changes: 4 additions & 4 deletions react/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6058,10 +6058,10 @@ typed-styles@^0.0.7:
resolved "https://registry.yarnpkg.com/typed-styles/-/typed-styles-0.0.7.tgz#93392a008794c4595119ff62dde6809dbc40a3d9"
integrity sha512-pzP0PWoZUhsECYjABgCGQlRGL1n7tOHsgwYv3oIiEpJwGhFTuty/YNeduxQYzXXa3Ge5BdT6sHYIQYpl4uJ+5Q==

typescript@3.7.3:
version "3.7.3"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.7.3.tgz#b36840668a16458a7025b9eabfad11b66ab85c69"
integrity sha512-Mcr/Qk7hXqFBXMN7p7Lusj1ktCBydylfQM/FZCk5glCNQJrCUKPkMHdo9R0MTFWsC/4kPFvDS0fDPvukfCkFsw==
typescript@3.8.3:
version "3.8.3"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.8.3.tgz#409eb8544ea0335711205869ec458ab109ee1061"
integrity sha512-MYlEfn5VrLNsgudQTVJeNaQFUAI7DkhnOjdpAp4T+ku1TfQClewlbSuTVHiA+8skNBgaf02TL/kLOvig4y3G8w==

typescript@^3.7.3:
version "3.7.4"
Expand Down

0 comments on commit f0e1a6b

Please sign in to comment.