Skip to content

Commit

Permalink
fix: add default exports for individual plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
igordanchenko committed May 30, 2022
1 parent a9ff84b commit 5e502fa
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
10 changes: 7 additions & 3 deletions src/plugins/Fullscreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ const ExitFullscreenIcon = createIcon(
<path d="M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z" />
);

export type FullscreenButtonProps = Pick<LightboxProps, "labels"> & {
type FullscreenButtonProps = Pick<LightboxProps, "labels"> & {
auto: boolean;
render: Render;
};

export const FullscreenButton = ({ auto, labels, render }: FullscreenButtonProps) => {
const FullscreenButton = ({ auto, labels, render }: FullscreenButtonProps) => {
const [fullscreen, setFullscreen] = React.useState(false);
const latestAuto = useLatest(auto);

Expand Down Expand Up @@ -171,7 +171,7 @@ export const FullscreenButton = ({ auto, labels, render }: FullscreenButtonProps
);
};

export const Fullscreen: Plugin = ({ augment }) => {
const Fullscreen: Plugin = ({ augment }) => {
augment(({ toolbar: { buttons, ...restToolbar }, ...restProps }) => ({
toolbar: {
buttons: [
Expand All @@ -188,3 +188,7 @@ export const Fullscreen: Plugin = ({ augment }) => {
...restProps,
}));
};

export type { FullscreenButtonProps };
export { Fullscreen, FullscreenButton };
export default Fullscreen;
9 changes: 6 additions & 3 deletions src/plugins/Inline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ declare module "../types.js" {
}
}

export const InlineContainer: Component = ({ inline, children }) => <div {...inline}>{children}</div>;
const InlineContainer: Component = ({ inline, children }) => <div {...inline}>{children}</div>;

export const InlineModule = createModule("inline", InlineContainer);
const InlineModule = createModule("inline", InlineContainer);

export const Inline: Plugin = ({ augment, replace, remove }) => {
const Inline: Plugin = ({ augment, replace, remove }) => {
augment(({ toolbar: { buttons, ...restToolbar }, open, close, ...restProps }) => ({
open: true,
close: () => {},
Expand All @@ -28,3 +28,6 @@ export const Inline: Plugin = ({ augment, replace, remove }) => {
remove("no-scroll");
replace("portal", InlineModule);
};

export { Inline, InlineModule, InlineContainer };
export default Inline;
7 changes: 5 additions & 2 deletions src/plugins/Video.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ SlideTypesPropTypes.push(
})
);

export const VideoSlide = ({ slide: { sources, poster, width, height } }: { slide: SlideVideo }) => {
const VideoSlide = ({ slide: { sources, poster, width, height } }: { slide: SlideVideo }) => {
const { setContainerRef, containerRect } = useContainerRect();

const scaleWidthAndHeight = () => {
Expand Down Expand Up @@ -72,7 +72,7 @@ export const VideoSlide = ({ slide: { sources, poster, width, height } }: { slid
);
};

export const Video: Plugin = ({ augment }) => {
const Video: Plugin = ({ augment }) => {
augment(({ render: { slide: renderSlide, ...restRender }, ...restProps }) => ({
render: {
slide: (slide) => {
Expand All @@ -86,3 +86,6 @@ export const Video: Plugin = ({ augment }) => {
...restProps,
}));
};

export { Video, VideoSlide };
export default Video;

0 comments on commit 5e502fa

Please sign in to comment.