Skip to content
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 #3390: Rename previewSrc as zoomSrc #3394

Merged
merged 1 commit into from
Sep 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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