diff --git a/components/LayoutWrapper.tsx b/components/LayoutWrapper.tsx index 93f1873..689f74b 100644 --- a/components/LayoutWrapper.tsx +++ b/components/LayoutWrapper.tsx @@ -29,7 +29,7 @@ const LayoutWrapper = ({ children }: Props) => { {link.title} diff --git a/components/MediaItem.tsx b/components/MediaItem.tsx new file mode 100644 index 0000000..bf11620 --- /dev/null +++ b/components/MediaItem.tsx @@ -0,0 +1,24 @@ +import PhotoGallery from './PhotoGallery' +import YoutubeVideo from './YouTubeVideo' + +const MediaItem = (props) => { + const { type, title, data } = props + + if (type !== 'video' && type !== 'photos') return null + + const item = + type === 'video' ? ( + + ) : ( + + ) + + return ( +
+

{title}

+ {item} +
+ ) +} + +export default MediaItem diff --git a/components/PhotoGallery.tsx b/components/PhotoGallery.tsx new file mode 100644 index 0000000..7806575 --- /dev/null +++ b/components/PhotoGallery.tsx @@ -0,0 +1,21 @@ +import 'photoswipe/dist/photoswipe.css' +import { Gallery, Item } from 'react-photoswipe-gallery' +import Image from './Image' + +const PhotoGallery = (props) => { + const { title, data } = props + + return ( + + {data.length + ? data.map((d: string) => ( + + {({ ref, open }) => {title}} + + )) + : null} + + ) +} + +export default PhotoGallery diff --git a/components/ThemeSwitch.tsx b/components/ThemeSwitch.tsx deleted file mode 100644 index 5409766..0000000 --- a/components/ThemeSwitch.tsx +++ /dev/null @@ -1,38 +0,0 @@ -import { useEffect, useState } from 'react' -import { useTheme } from 'next-themes' - -const ThemeSwitch = () => { - const [mounted, setMounted] = useState(false) - const { theme, setTheme, resolvedTheme } = useTheme() - - // When mounted on client, now we can show the UI - useEffect(() => setMounted(true), []) - - return ( - - ) -} - -export default ThemeSwitch diff --git a/components/YouTubeVideo.tsx b/components/YouTubeVideo.tsx new file mode 100644 index 0000000..e32e7e9 --- /dev/null +++ b/components/YouTubeVideo.tsx @@ -0,0 +1,18 @@ +const YoutubeVideo = (props) => { + const { title, data } = props + + return ( +
+