Skip to content

Conversation

@d3m1d0v
Copy link
Member

@d3m1d0v d3m1d0v commented Nov 28, 2025

Added zoom for images in <Gallery/> component for desktop and touch devices.

Also fixed usage of useTranslation() hook inside getGalleryItemCopyLinkAction and getGalleryItemDownloadAction()

@gravity-ui-bot
Copy link
Contributor

Preview is ready.

@d3m1d0v d3m1d0v force-pushed the gallery-image-zoom branch from ccdf0b6 to fef5ed8 Compare December 9, 2025 16:22
@d3m1d0v d3m1d0v marked this pull request as ready for review December 11, 2025 09:19
@d3m1d0v d3m1d0v requested a review from kseniya57 as a code owner December 11, 2025 09:19
@@ -0,0 +1,7 @@
// Constants
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to delete all unnecessary comments, for example, here it is clear from the file that these are constants, and from the name of each constant it is clear why it is needed.

export type GalleryItemAction = {
id: string;
title: string;
title: string | WithTFn;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need the function?

return;
}

e.stopPropagation();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can break closing popups logic (if we render the dropdown in the top right corner of the gallery)

import {checkImageFitsContainer, createConstrainPosition} from './utils';

// blank props for further options
export type UseImageZoomProps = {};
Copy link
Contributor

@kseniya57 kseniya57 Dec 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest not adding the props until they are needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants