Skip to content

Commit

Permalink
feat: add stand-alone <TweetsSlider>
Browse files Browse the repository at this point in the history
  • Loading branch information
AmirHosseinKarimi committed Jan 22, 2024
1 parent 72d6b38 commit 4f730ef
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 15 deletions.
17 changes: 2 additions & 15 deletions src/app/components/Tweets/Tweets.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
"use client";

import TweetCard from "./TweetCard";
import Link from "next/link";
import { Swiper, SwiperSlide } from "swiper/react";
import { Autoplay } from "swiper/modules";
import "swiper/css";
import TweetsSlider from "./TweetsSlider";

const Tweets = () => {
return (
Expand All @@ -31,15 +26,7 @@ const Tweets = () => {
</div>
</div>

<div className="select-none">
<Swiper slidesPerView="auto" autoplay loop modules={[Autoplay]}>
{new Array(10).fill(0).map((_, index) => (
<SwiperSlide key={index} className="ms-4 !w-auto xl:ms-6">
<TweetCard />
</SwiperSlide>
))}
</Swiper>
</div>
<TweetsSlider />
</div>
);
};
Expand Down
22 changes: 22 additions & 0 deletions src/app/components/Tweets/TweetsSlider.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
"use client";

import TweetCard from "./TweetCard";
import { Swiper, SwiperSlide } from "swiper/react";
import { Autoplay } from "swiper/modules";
import "swiper/css";

const TweetsSlider = () => {
return (
<div className="select-none">
<Swiper slidesPerView="auto" autoplay loop modules={[Autoplay]}>
{new Array(10).fill(0).map((_, index) => (
<SwiperSlide key={index} className="ms-4 !w-auto xl:ms-6">
<TweetCard />
</SwiperSlide>
))}
</Swiper>
</div>
);
};

export default TweetsSlider;

0 comments on commit 4f730ef

Please sign in to comment.