Skip to content
Merged
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
8 changes: 8 additions & 0 deletions src/components/mainPage/PromotionBanner.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { useState, useRef } from "react";
import { useNavigate } from "react-router"; // [demo-day] 데모데이 끝나면 제거
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The comment // [demo-day] 데모데이 끝나면 제거 indicates that this import is temporary. While useful for tracking, it's important to ensure these temporary flags are properly managed and removed once the demo-day period is over to avoid dead code or unexpected behavior in the future. Consider creating a follow-up task to remove this.

import {
promotionBanner1,
promotionBanner2,
Expand All @@ -9,13 +10,15 @@ interface MainBannerProps {
id: number;
alt: string;
src: string;
link?: string; // [demo-day] 데모데이 끝나면 제거
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Similar to the import, the link?: string; // [demo-day] 데모데이 끝나면 제거 comment suggests this property is temporary. This temporary nature should be clearly documented and a plan for its removal or integration into a permanent feature should be established to maintain code cleanliness.

}

const BANNERS: MainBannerProps[] = [
{
id: 1,
alt: "AI 사진 복원 프로모션 배너",
src: promotionBanner1,
link: "/demo-day", // [demo-day] 데모데이 끝나면 제거
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The link: "/demo-day", // [demo-day] 데모데이 끝나면 제거 comment highlights a temporary hardcoded link. For better maintainability and to prevent issues after the demo-day, this should either be removed or replaced with a configurable value when the feature becomes permanent.

},
{
id: 2,
Expand All @@ -30,6 +33,7 @@ const BANNERS: MainBannerProps[] = [
];

export default function PromotionBanner() {
const navigate = useNavigate(); // [demo-day] 데모데이 끝나면 제거
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The const navigate = useNavigate(); // [demo-day] 데모데이 끝나면 제거 comment indicates that the useNavigate hook is being used temporarily for the demo-day feature. Ensure that this usage is either removed or integrated into a more general navigation strategy once the demo-day is concluded.

const [currentIndex, setCurrentIndex] = useState(0);
const scrollRef = useRef<HTMLDivElement>(null);

Expand All @@ -52,6 +56,10 @@ export default function PromotionBanner() {
<div
key={banner.id}
className="min-w-[calc(100%-3px)] shrink-0 snap-center"
// [demo-day] 아래 3줄 데모데이 끝나면 제거
onClick={banner.link ? () => navigate(banner.link!) : undefined}
role={banner.link ? "link" : undefined}
style={banner.link ? { cursor: "pointer" } : undefined}
Comment on lines +59 to +62
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The comments // [demo-day] 아래 3줄 데모데이 끝나면 제거 indicate that the onClick, role, and style attributes are temporary. These conditional attributes should be reviewed and either removed or made permanent with appropriate logic after the demo-day period to avoid unnecessary complexity.

>
<div className="relative aspect-335/250 w-full overflow-hidden rounded-2xl">
<img
Expand Down