update 30/01
This commit is contained in:
19
src/components/shared/FancyboxWrapper.tsx
Normal file
19
src/components/shared/FancyboxWrapper.tsx
Normal file
@@ -0,0 +1,19 @@
|
||||
'use client';
|
||||
|
||||
import { useEffect } from 'react';
|
||||
import { Fancybox as NativeFancybox } from '@fancyapps/ui';
|
||||
|
||||
|
||||
export default function FancyboxWrapper({ children }: { children: React.ReactNode }) {
|
||||
useEffect(() => {
|
||||
NativeFancybox.bind('[data-fancybox]', {
|
||||
// Options
|
||||
});
|
||||
|
||||
return () => {
|
||||
NativeFancybox.destroy();
|
||||
};
|
||||
}, []);
|
||||
|
||||
return <>{children}</>;
|
||||
}
|
||||
Reference in New Issue
Block a user