Skip to content

Commit

Permalink
Fix: remove broken commits (#95)
Browse files Browse the repository at this point in the history
#### What problem is this solving?

Remove the broken code from v0.22.0 and v0.22.1.

#### How to test it?

The fix was linked in
`carrefourar`([workspace](https://vsseixaso--carrefourar.myvtex.com/))

#### Screenshots or example usage:

![Screenshot 2024-09-04 at 11 50
04 AM](https://github.com/user-attachments/assets/34e63681-5659-4913-b540-724709ea91be)

#### Related to / Depends on

PR to [v0.22.0](#87) and
[v0.22.1](#90)
  • Loading branch information
vsseixaso authored Sep 4, 2024
1 parent 54520c8 commit 252c666
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 16 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

### Removed

- v0.22.1 and v0.22.0

## [0.22.2] - 2024-09-03

### Added
Expand Down
6 changes: 2 additions & 4 deletions react/Image.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ export interface ImageProps
classes?: CssHandlesTypes.CustomClasses<typeof CSS_HANDLES>
preload?: boolean
loading?: 'eager' | 'lazy'
fetchpriority?: 'high' | 'low' | 'auto'
width?: string | number
height?: string | number
fetchpriority?: 'high' | 'low' | 'auto'
/**
* Warning: This property is for internal usage, please avoid using it.
* This property is used when the Image is children of the SliderTrack component and it prevents triggering the promoView event twice for cloned images.
Expand Down Expand Up @@ -131,7 +129,7 @@ function Image(props: ImageProps) {
: null

const explicitDimensionsAreAvailable =
width?.toString() &&
!width?.toString().includes('%') &&
!height?.toString().includes('%') &&
(widthWithoutUnits || heightWithoutUnits)

Expand Down
1 change: 0 additions & 1 deletion react/ImageTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ export type ImagesSchema = Array<{
experimentalSetExplicitDimensions?: boolean
loading?: 'eager' | 'lazy'
width?: number | string
height?: number | string
analyticsProperties?: 'none' | 'provide'
promotionId?: string
promotionName?: string
Expand Down
7 changes: 2 additions & 5 deletions react/modules/imageAsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@ import type { ImagesSchema } from '../ImageTypes'
export const getImagesAsJSXList = (
images: ImagesSchema,
isMobile: boolean,
maxHeight: string | number,
height: string | number,
preload?: boolean,
experimentalPreventLayoutShift?: boolean,
experimentalSetExplicitDimensions?: boolean
) => {

return images.map(
(
{
Expand All @@ -21,7 +20,6 @@ export const getImagesAsJSXList = (
experimentalPreventLayoutShift: experimentalPreventLayoutShiftChild,
experimentalSetExplicitDimensions: experimentalSetExplicitDimensionsChild,
width = '100%',
height,
...props
},
idx
Expand All @@ -30,9 +28,8 @@ export const getImagesAsJSXList = (
key={idx}
src={isMobile && mobileImage ? mobileImage : image}
alt={description}
maxHeight={maxHeight}
maxHeight={height}
width={width}
height={height}
experimentalPreventLayoutShift={
experimentalPreventLayoutShift ?? experimentalPreventLayoutShiftChild
}
Expand Down
6 changes: 0 additions & 6 deletions store/contentSchemas.json
Original file line number Diff line number Diff line change
Expand Up @@ -153,12 +153,6 @@
"$ref": "app:vtex.native-types#/definitions/text",
"default": "100%"
},
"height": {
"title": "admin/editor.image-list.images.height.title",
"description": "admin/editor.image-list.images.height.description",
"$ref": "app:vtex.native-types#/definitions/text",
"default": ""
},
"loading": {
"title": "admin/editor.store-image.loading.title",
"enum": ["eager", "lazy"],
Expand Down

0 comments on commit 252c666

Please sign in to comment.