-
Notifications
You must be signed in to change notification settings - Fork 0
[FEAT] 배너 클릭으로 데모데이 페이지 이동하기 #269
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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] 데모데이 끝나면 제거 | ||
| import { | ||
| promotionBanner1, | ||
| promotionBanner2, | ||
|
|
@@ -9,13 +10,15 @@ interface MainBannerProps { | |
| id: number; | ||
| alt: string; | ||
| src: string; | ||
| link?: string; // [demo-day] 데모데이 끝나면 제거 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| } | ||
|
|
||
| const BANNERS: MainBannerProps[] = [ | ||
| { | ||
| id: 1, | ||
| alt: "AI 사진 복원 프로모션 배너", | ||
| src: promotionBanner1, | ||
| link: "/demo-day", // [demo-day] 데모데이 끝나면 제거 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| }, | ||
| { | ||
| id: 2, | ||
|
|
@@ -30,6 +33,7 @@ const BANNERS: MainBannerProps[] = [ | |
| ]; | ||
|
|
||
| export default function PromotionBanner() { | ||
| const navigate = useNavigate(); // [demo-day] 데모데이 끝나면 제거 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| const [currentIndex, setCurrentIndex] = useState(0); | ||
| const scrollRef = useRef<HTMLDivElement>(null); | ||
|
|
||
|
|
@@ -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
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| > | ||
| <div className="relative aspect-335/250 w-full overflow-hidden rounded-2xl"> | ||
| <img | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.