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

feat: add additional classname for appId in gallery #1436

Merged
merged 3 commits into from
Nov 5, 2024
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
5 changes: 5 additions & 0 deletions .changeset/cyan-pans-do.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@alfalab/core-components-gallery': patch
---

Добавление нового класса для попапа в галереи через пропс. Чтобы можно было прокидывать appId для работа изоляции стилей.
8 changes: 7 additions & 1 deletion packages/gallery/src/Component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ export type GalleryProps = {
* Обработчик изменения текущего изображения
*/
onSlideIndexChange?: (index: number) => void;

/**
* Дополнительный класс для попапа
*/
popupClassName?: string;
};

const DEFAULT_FULL_SCREEN = false;
Expand All @@ -65,6 +70,7 @@ export const Gallery: FC<GalleryProps> = ({
loop = true,
onClose,
onSlideIndexChange,
popupClassName,
}) => {
const currentSlideIndexState = useState(initialSlide);
const uncontrolled = slideIndex === undefined;
Expand Down Expand Up @@ -229,7 +235,7 @@ export const Gallery: FC<GalleryProps> = ({
<GalleryContext.Provider value={galleryContext}>
<BaseModal
open={open}
className={styles.modal}
className={cn(styles.modal, popupClassName)}
onEscapeKeyDown={handleEscapeKeyDown}
Backdrop={Backdrop}
onUnmount={onUnmount}
Expand Down
Loading