Skip to content

Commit

Permalink
Fix #3390: Rename previewSrc as zoomSrc (#3394)
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware authored Sep 30, 2022
1 parent 7cb83ed commit e886383
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions api-generator/components/image.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ const ImageProps = [
description: 'Specifies the path to the image.'
},
{
name: 'previewSrc',
name: 'zoomSrc',
type: 'string',
default: 'null',
description: 'Preview image that may be different than "src" image.'
description: 'Zoomed image that may be different than "src" image.'
},
{
name: 'downloadable',
Expand Down
14 changes: 7 additions & 7 deletions components/doc/image/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export class ImageDemo extends Component {
<Image src="https://www.primefaces.org/wp-content/uploads/2020/05/placeholder.png" alt="Image" width="250" preview />
<h5>Thumbnail</h5>
<Image src="https://www.primefaces.org/wp-content/uploads/2020/05/placeholder.png" previewSrc="https://www.primefaces.org/wp-content/uploads/2020/05/small.png" alt="Image" width="80" height="60" preview />
<Image src="https://www.primefaces.org/wp-content/uploads/2020/05/placeholder.png" zoomSrc="https://www.primefaces.org/wp-content/uploads/2020/05/small.png" alt="Image" width="80" height="60" preview />
</div>
)
}
Expand All @@ -52,7 +52,7 @@ const ImageDemo = () => {
<Image src="https://www.primefaces.org/wp-content/uploads/2020/05/placeholder.png" alt="Image" width="250" preview />
<h5>Thumbnail</h5>
<Image src="https://www.primefaces.org/wp-content/uploads/2020/05/placeholder.png" previewSrc="https://www.primefaces.org/wp-content/uploads/2020/05/small.png" alt="Image" width="80" height="60" preview />
<Image src="https://www.primefaces.org/wp-content/uploads/2020/05/placeholder.png" zoomSrc="https://www.primefaces.org/wp-content/uploads/2020/05/small.png" alt="Image" width="80" height="60" preview />
</div>
</div>
)
Expand All @@ -77,7 +77,7 @@ const ImageDemo = () => {
<Image src="https://www.primefaces.org/wp-content/uploads/2020/05/placeholder.png" alt="Image" width="250" preview />
<h5>Thumbnail</h5>
<Image src="https://www.primefaces.org/wp-content/uploads/2020/05/placeholder.png" previewSrc="https://www.primefaces.org/wp-content/uploads/2020/05/small.png" alt="Image" width="80" height="60" preview />
<Image src="https://www.primefaces.org/wp-content/uploads/2020/05/placeholder.png" zoomSrc="https://www.primefaces.org/wp-content/uploads/2020/05/small.png" alt="Image" width="80" height="60" preview />
</div>
</div>
)
Expand Down Expand Up @@ -105,7 +105,7 @@ const ImageDemo = () => {
<Image src="https://www.primefaces.org/wp-content/uploads/2020/05/placeholder.png" alt="Image" width="250" preview />
<h5>Thumbnail</h5>
<Image src="https://www.primefaces.org/wp-content/uploads/2020/05/placeholder.png" previewSrc="https://www.primefaces.org/wp-content/uploads/2020/05/small.png" alt="Image" width="80" height="60" preview />
<Image src="https://www.primefaces.org/wp-content/uploads/2020/05/placeholder.png" zoomSrc="https://www.primefaces.org/wp-content/uploads/2020/05/small.png" alt="Image" width="80" height="60" preview />
</div>
</div>
)
Expand Down Expand Up @@ -149,7 +149,7 @@ import { Image } from 'primereact/image';

<h5>Thumbnail</h5>
<p>
Allow different images or sizes for source and preview images using <i>previewSrc</i> property.
Allow different images or sizes for source and preview images using <i>zoomSrc</i> property.
</p>

<h5>Templating</h5>
Expand Down Expand Up @@ -189,10 +189,10 @@ import { Image } from 'primereact/image';
<td>Controls the preview functionality.</td>
</tr>
<tr>
<td>previewSrc</td>
<td>zoomSrc</td>
<td>string</td>
<td>null</td>
<td>Preview image that may be different than "src" image.</td>
<td>Zoomed image that may be different than "src" image.</td>
</tr>
<tr>
<td>downloadable</td>
Expand Down
4 changes: 2 additions & 2 deletions components/lib/image/Image.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ export const Image = React.memo(
onExited={onExited}
>
<div ref={previewRef}>
<img src={props.previewSrc || props.src} className="p-image-preview" style={imagePreviewStyle} onClick={onPreviewImageClick} alt={props.alt} />
<img src={props.zoomSrc || props.src} className="p-image-preview" style={imagePreviewStyle} onClick={onPreviewImageClick} alt={props.alt} />
</div>
</CSSTransition>
</div>
Expand Down Expand Up @@ -194,7 +194,7 @@ Image.defaultProps = {
imageStyle: null,
onError: null,
preview: false,
previewSrc: null,
zoomSrc: null,
src: null,
template: null,
width: null
Expand Down
2 changes: 1 addition & 1 deletion components/lib/image/image.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export interface ImageProps extends Omit<React.DetailedHTMLProps<React.HTMLAttri
imageClassName?: string;
imageStyle?: string;
preview?: boolean;
previewSrc?: string;
zoomSrc?: string;
src?: string;
template?: any;
width?: string;
Expand Down
2 changes: 1 addition & 1 deletion pages/image/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const ImageDemo = () => {
<Image src={`${contextPath}/images/galleria/galleria12.jpg`} alt="Image" width="250" preview />

<h5>Thumbnail</h5>
<Image src={`${contextPath}/images/galleria/galleria14s.jpg`} previewSrc={`${contextPath}/images/galleria/galleria14.jpg`} alt="Image" width="80" height="60" preview />
<Image src={`${contextPath}/images/galleria/galleria14s.jpg`} zoomSrc={`${contextPath}/images/galleria/galleria14.jpg`} alt="Image" width="80" height="60" preview />
</div>
</div>

Expand Down

0 comments on commit e886383

Please sign in to comment.