I want to put some button that have functionality to download or share the previewed image. Is there any possible way to achieve this?
I've search for some answer and read the documentation but found solution.
Currently, antd
v5.1.5 does not support it. There is issue to request a custom or extended preview operations feature.
From the source code of rc-image
, we know the preview operations are defined internally and doesn't support custom and extension. See v5.13.0/src/Operations.tsx#L58
Only these operations:
const tools = [
{
icon: close,
onClick: onClose,
type: 'close',
},
{
icon: zoomIn,
onClick: onZoomIn,
type: 'zoomIn',
disabled: scale === MAX_SCALE,
},
{
icon: zoomOut,
onClick: onZoomOut,
type: 'zoomOut',
disabled: scale === MIN_SCALE,
},
{
icon: rotateRight,
onClick: onRotateRight,
type: 'rotateRight',
},
{
icon: rotateLeft,
onClick: onRotateLeft,
type: 'rotateLeft',
},
]