-
Notifications
You must be signed in to change notification settings - Fork 17
feat(Gallery): add image scaling #361
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
base: main
Are you sure you want to change the base?
Conversation
|
Preview is ready. |
13fbcf0 to
605bac4
Compare
ccdf0b6 to
fef5ed8
Compare
| @@ -0,0 +1,7 @@ | |||
| // Constants | |||
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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?
src/components/Gallery/hooks/useImageZoom/useImageZoomDesktop.ts
Outdated
Show resolved
Hide resolved
| return; | ||
| } | ||
|
|
||
| e.stopPropagation(); |
There was a problem hiding this comment.
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)
fef5ed8 to
2c99334
Compare
| import {checkImageFitsContainer, createConstrainPosition} from './utils'; | ||
|
|
||
| // blank props for further options | ||
| export type UseImageZoomProps = {}; |
There was a problem hiding this comment.
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
Added zoom for images in
<Gallery/>component for desktop and touch devices.Also fixed usage of
useTranslation()hook insidegetGalleryItemCopyLinkActionandgetGalleryItemDownloadAction()