diff --git a/src/components/Carousel/DynamicSlides/UnitSlide/CarouselDataCard/index.tsx b/src/components/Carousel/DynamicSlides/UnitSlide/CarouselDataCard/index.tsx index e8ebc16..8308c3d 100644 --- a/src/components/Carousel/DynamicSlides/UnitSlide/CarouselDataCard/index.tsx +++ b/src/components/Carousel/DynamicSlides/UnitSlide/CarouselDataCard/index.tsx @@ -1,19 +1,10 @@ import { CarouselData } from "@components/Carousel/carouselData"; -import { CarouselCardProps } from "@interfaces/CardProps"; +import { CarouselCardProps, CarouselDataCardProps } from "@interfaces/CardProps"; import { Card, Typography, alpha, styled } from "@mui/material"; import { navbar } from "@theme/constants"; import React from "react"; import ProgressBar from "./ProgressBar"; -import { SplideInstance } from "../.."; -interface CarouselDataCardProps extends CarouselCardProps { - link: CarouselData['link']; - tagline: CarouselData['tagline']; - title: CarouselData['title']; - description: CarouselData['description']; - pauseTime: CarouselData['pauseTime']; - splide?: SplideInstance | null; -}; const Tagline = styled(Typography)(({ theme }) => ({ color: theme.palette.text.secondary, diff --git a/src/components/Carousel/DynamicSlides/UnitSlide/index.tsx b/src/components/Carousel/DynamicSlides/UnitSlide/index.tsx index bc8e465..b0e2d85 100644 --- a/src/components/Carousel/DynamicSlides/UnitSlide/index.tsx +++ b/src/components/Carousel/DynamicSlides/UnitSlide/index.tsx @@ -4,7 +4,7 @@ import { CarouselData } from '../../carouselData'; import { styled } from '@mui/material'; import { SplideSlide } from '@splidejs/react-splide'; import CarouselDataCard from './CarouselDataCard'; -import { SplideInstance } from '..'; +import { UnitSlideProps } from '@interfaces/SplideInterface'; const StyledImage = styled(Image)(({ theme }) => ({ @@ -13,10 +13,6 @@ const StyledImage = styled(Image)(({ theme }) => ({ objectFit: 'cover', })); -interface UnitSlideProps extends CarouselData { - splide: SplideInstance | null; -}; - const UnitSlide: React.FC = ({ image, tagline, diff --git a/src/components/Carousel/DynamicSlides/index.tsx b/src/components/Carousel/DynamicSlides/index.tsx index 9c27600..c629f8f 100644 --- a/src/components/Carousel/DynamicSlides/index.tsx +++ b/src/components/Carousel/DynamicSlides/index.tsx @@ -5,20 +5,7 @@ import { Splide, SplideProps, SplideTrack } from '@splidejs/react-splide'; import '@splidejs/splide/dist/css/themes/splide-default.min.css'; import ProgressBarPlaceholder from './ProgressBarPlaceholder'; import theme from '@theme/index'; - -export interface SplideInstance { - index: number; - length: number; - Components: { - Autoplay: { - pause: () => void; - play: () => void; - mount: () => void; - isPaused: () => boolean; - destroy: () => void; - } - } -}; +import { SplideInstance } from '@interfaces/SplideInterface'; const options: SplideProps["options"] = { type: 'loop', diff --git a/src/interfaces/CardProps.ts b/src/interfaces/CardProps.ts index d265d2f..1d3b0c7 100644 --- a/src/interfaces/CardProps.ts +++ b/src/interfaces/CardProps.ts @@ -1,4 +1,6 @@ +import { CarouselData } from '@components/Carousel/carouselData'; import { CardProps as MuiCardProps } from '@mui/material'; +import { SplideInstance } from './SplideInterface'; export interface CardProps extends MuiCardProps { component?: React.ElementType; @@ -24,4 +26,13 @@ export interface ThemeChangerWrapperProps extends CardProps { export interface CarouselCardProps extends CardProps { elevation?: number; active?: boolean; +}; + +export interface CarouselDataCardProps extends CarouselCardProps { + link: CarouselData['link']; + tagline: CarouselData['tagline']; + title: CarouselData['title']; + description: CarouselData['description']; + pauseTime: CarouselData['pauseTime']; + splide?: SplideInstance | null; }; \ No newline at end of file diff --git a/src/interfaces/SplideInterface.ts b/src/interfaces/SplideInterface.ts new file mode 100644 index 0000000..c5a0098 --- /dev/null +++ b/src/interfaces/SplideInterface.ts @@ -0,0 +1,19 @@ +import { CarouselData } from "@components/Carousel/carouselData"; + +export interface SplideInstance { + index: number; + length: number; + Components: { + Autoplay: { + pause: () => void; + play: () => void; + mount: () => void; + isPaused: () => boolean; + destroy: () => void; + } + } +}; + +export interface UnitSlideProps extends CarouselData { + splide: SplideInstance | null; +};