Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/assets/home-banner/banner-beauty-1.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions app/assets/home-banner/banner-beauty-2.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions app/assets/home-banner/banner-beauty-3.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 0 additions & 9 deletions app/assets/home-banner/banner-beauty.svg

This file was deleted.

1 change: 1 addition & 0 deletions app/assets/home-banner/banner-fashion-1.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions app/assets/home-banner/banner-fashion-2.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions app/assets/home-banner/banner-fashion-3.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 0 additions & 9 deletions app/assets/home-banner/banner-fashion.svg

This file was deleted.

38 changes: 18 additions & 20 deletions app/routes/home/components/BannerCarousel.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,29 @@
import { useEffect, useRef, useState, useCallback } from "react";
import type { CategoryKey } from "../types";
import bannerBeauty from "../../../assets/home-banner/banner-beauty.svg";
import bannerFashion from "../../../assets/home-banner/banner-fashion.svg";
import bannerBeauty1 from "../../../assets/home-banner/banner-beauty-1.svg";
import bannerBeauty2 from "../../../assets/home-banner/banner-beauty-2.svg";
import bannerBeauty3 from "../../../assets/home-banner/banner-beauty-3.svg";
import bannerFashion1 from "../../../assets/home-banner/banner-fashion-1.svg";
import bannerFashion2 from "../../../assets/home-banner/banner-fashion-2.svg";
import bannerFashion3 from "../../../assets/home-banner/banner-fashion-3.svg";

const INTERVAL = 3000;

interface BannerItem {
src: string | null;
src: string;
alt: string;
}

const beautyBanners: BannerItem[] = [
{ src: bannerBeauty, alt: "뷰티 배너 1" },
{ src: null, alt: "뷰티 배너 2" },
{ src: null, alt: "뷰티 배너 3" },
{ src: bannerBeauty1, alt: "뷰티 배너 1" },
{ src: bannerBeauty2, alt: "뷰티 배너 2" },
{ src: bannerBeauty3, alt: "뷰티 배너 3" },
];

const fashionBanners: BannerItem[] = [
{ src: bannerFashion, alt: "패션 배너 1" },
{ src: null, alt: "패션 배너 2" },
{ src: null, alt: "패션 배너 3" },
{ src: bannerFashion1, alt: "패션 배너 1" },
{ src: bannerFashion2, alt: "패션 배너 2" },
{ src: bannerFashion3, alt: "패션 배너 3" },
];

export default function BannerCarousel({ category }: { category: CategoryKey }) {
Expand Down Expand Up @@ -55,17 +59,11 @@ export default function BannerCarousel({ category }: { category: CategoryKey })
>
{banners.map((banner, i) => (
<div key={`${category}-${i}`} className="w-full shrink-0">
{banner.src ? (
<img
src={banner.src}
alt={banner.alt}
className="h-62.5 w-full object-cover"
/>
) : (
<div className="flex h-62.5 w-full items-center justify-center bg-bluegray-2 text-text-gray3">
준비중
</div>
)}
<img
src={banner.src}
alt={banner.alt}
className="h-62.5 w-full object-cover"
/>
</div>
))}
</div>
Expand Down
Loading