diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..7a73a41 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,2 @@ +{ +} \ No newline at end of file diff --git a/components/ImageSlide.tsx b/components/ImageSlide.tsx new file mode 100644 index 0000000..e53264d --- /dev/null +++ b/components/ImageSlide.tsx @@ -0,0 +1,41 @@ +import React, { useState } from "react"; +import { AiFillLeftCircle } from "react-icons/ai"; + +export const ImageSlide = ({ children }: any) => { + const [current, setCurrent] = useState(0); + const length = children.length; + + const nextSlide = () => { + setCurrent(current === length - 1 ? 0 : current + 2); + }; + + const prevSlide = () => { + setCurrent(current === 0 ? length - 1 : current - 2); + }; + if (children.length <= 0) { + return null; + } + + return ( +
+ + + {children.map((slide: any, index: any) => { + return ( +
+ {index === current && ( + travel image + )} +
+ ); + })} +
+ ); +}; diff --git a/components/Navbar.tsx b/components/Navbar.tsx index 375f7c5..2c55f18 100644 --- a/components/Navbar.tsx +++ b/components/Navbar.tsx @@ -13,7 +13,7 @@ export const Navbar = () => { const [showMenu, setShowMenu] = useState(false); return ( -