Skip to content
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

[Fix] 배너 링크 / 예약 페이지 링크 Pascal Case로 변경 #240

Merged
merged 9 commits into from
Oct 6, 2023
4 changes: 2 additions & 2 deletions 42manito/src/Types/Banners/Banner.dto.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ export interface BannerDto {
link: string; // image link
backgroundColor: string; // backgroundColor
textColor: string; // textColor
image: string; // image
license: string; // license
image?: string; // image
license?: string; // license
}
24 changes: 1 addition & 23 deletions 42manito/src/components/Banners/Banners.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,11 @@ export const BannersData = [
head: "가이드",
title: "마니또가 처음이신가요?",
description: "가이드와 함께 멘토링을 시작해보세요!",
link: "/Guide",
link: "https://github.com/manito42/guide/wiki",
backgroundColor: "bg-signature_color-500",
textColor: "text-white",
image: "/guide.png",
license:
"https://kor.pngtree.com/freepng/meb-map-guide_4462396.html' 의 PNG 이미지 kor.pngtree.com",
},
{
head: "가이드222",
title: "마니또가 처음이신가요?",
description: "가이드와 함께 멘토링을 시작해보세요!",
link: "/Guide",
backgroundColor: "bg-pink-500",
textColor: "text-white",
image: "/guide.png",
license:
"https://kor.pngtree.com/freepng/meb-map-guide_4462396.html' 의 PNG 이미지 kor.pngtree.com",
},
{
head: "가이드333",
title: "마니또가 처음이신가요?",
description: "가이드와 함께 멘토링을 시작해보세요!",
link: "/Guide",
backgroundColor: "bg-blue-500",
textColor: "text-white",
image: "/guide.png",
license:
"https://kor.pngtree.com/freepng/meb-map-guide_4462396.html' 의 PNG 이미지 kor.pngtree.com",
},
];
32 changes: 20 additions & 12 deletions 42manito/src/components/Banners/TopBanner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ export default function TopBanner({ banner }: props) {
const router = useRouter();
const [currentIndex, setCurrentIndex] = useState(0);
const handleBannerClick = () => {
router.push(banner[currentIndex].link);
if (banner[currentIndex].link && banner[currentIndex].link[0] === "/") {
router.push(banner[currentIndex].link);
} else {
window.open(banner[currentIndex].link, "_blank");
}
};
const [bannerTimerId, setBannerTimerId] = useState<NodeJS.Timeout>();
const timer = 3000; // 임의로 넣어뒀습니다
Expand Down Expand Up @@ -83,17 +87,21 @@ export default function TopBanner({ banner }: props) {
</button>
</div>
)}
<div className="top-banner-container">
<div className="top-banner-right" onClick={handleBannerClick}>
<Image
src={banner[currentIndex].image}
alt={
banner[currentIndex].license ? banner[currentIndex].license : ""
}
width={200}
height={200}
priority={true}
/>
<div className="top-banner-container" onClick={handleBannerClick}>
<div className="top-banner-right">
{banner[currentIndex].image !== undefined && (
<Image
src={banner[currentIndex].image as string}
alt={
banner[currentIndex].license
? (banner[currentIndex].license as string)
: ""
}
width={200}
height={200}
priority={true}
/>
)}
</div>
<div className="top-banner-left" onClick={handleBannerClick}>
<div className="top-banner-head">{banner[currentIndex].head}</div>
Expand Down
2 changes: 1 addition & 1 deletion 42manito/src/components/Layout/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default function Footer() {
href="/"
className="flex title-font font-medium items-center md:justify-start justify-center text-bg_color-900"
>
<span className="ml-3 text-xl">42Manito</span>
<span className="md:ml-3 text-xl">42Manito</span>
</Link>
<span className="text-sm text-bg_color-500 sm:ml-6 sm:mt-0 mt-4 text-center">
42Manito ©2023
Expand Down
14 changes: 8 additions & 6 deletions 42manito/src/components/Layout/Header/components/DesktopNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@ export const DesktopNav = ({ Owner }: Props) => {
<Link href="/" className="layout-desktop-link-container">
<span className="layout-desktop-title">42 Manito</span>
</Link>
<Link
href="/Mentorings"
className="layout-desktop-link-container ml-10"
>
<span className="layout-desktop-link">멘토링</span>
</Link>
{Owner !== 0 && (
<Link
href="/Mentorings"
className="layout-desktop-link-container ml-10"
>
<span className="layout-desktop-link">멘토링</span>
</Link>
)}
{Owner !== 0 && (
<Link
href={`/Profile/${Owner}`}
Expand Down
8 changes: 5 additions & 3 deletions 42manito/src/components/Layout/Header/components/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,11 @@ export default function Sidebar({ onClose, onSignIn }: props) {
<Link href="/" onClick={onClose}>
<p className="sidebar-text sidebar-text-btn"></p>
</Link>
<Link href="/Mentorings" onClick={onClose}>
<p className="sidebar-text sidebar-text-btn">멘토링</p>
</Link>
{!!uid && (
Copy link
Member

Choose a reason for hiding this comment

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

이게 로그인 안하면 멘토링 버튼이 안뜨게 하는 기능 추가하신것 맞죠?
PR에 관련 내용이 없어서 한참 들어다 봤네요

Copy link
Member Author

Choose a reason for hiding this comment

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

아 넵 맞습니다. PR에 로그인 관련 내용을 뺴먹었네요 ㅋㅋ..

<Link href="/Mentorings" onClick={onClose}>
<p className="sidebar-text sidebar-text-btn">멘토링</p>
</Link>
)}
{!!uid && (
<Link href={`/Profile/${uid}`} onClick={onClose}>
<p className="sidebar-text sidebar-text-btn">프로필</p>
Expand Down
14 changes: 7 additions & 7 deletions 42manito/src/pages/Mentorings/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,25 @@ const Mentoring = () => {
head: "멘토링",
title: "나의 멘토링",
description: "멘토링 관리 페이지입니다",
link: "/Guide",
link: "/Mentorings",
backgroundColor: "bg-signature_color-500",
textColor: "text-white",
image: "/guide.png",
license:
"https://kor.pngtree.com/freepng/meb-map-guide_4462396.html' 의 PNG 이미지 kor.pngtree.com",
// image: "/guide.png",
// license:
// "https://kor.pngtree.com/freepng/meb-map-guide_4462396.html' 의 PNG 이미지 kor.pngtree.com",
},
];
const router = useRouter();
const uid = useSelector((state: RootState) => state.rootReducers.global.uId);
const [role, setRole] = useState<ReservationRole>(ReservationRole.ALL);
const isReservationModalOpen = useSelector(
(state: RootState) => state.rootReducers.reservation.isReservationModalOpen
(state: RootState) => state.rootReducers.reservation.isReservationModalOpen,
);
const isFeedbackModalOpen = useSelector(
(state: RootState) => state.rootReducers.reservation.isFeedbackModalOpen
(state: RootState) => state.rootReducers.reservation.isFeedbackModalOpen,
);
const isCancelModalOpen = useSelector(
(state: RootState) => state.rootReducers.reservation.isCancelModalOpen
(state: RootState) => state.rootReducers.reservation.isCancelModalOpen,
);
const handleRoleSelect = (id: string) => {
if (id === "mentor") {
Expand Down
4 changes: 2 additions & 2 deletions 42manito/src/styles/banner.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@

.top-banner-container {
@apply flex flex-col md:flex-row-reverse justify-between
w-[90%] lg:w-[900px];
w-[90%] lg:w-[900px] hover:cursor-pointer;
}

.top-banner-left {
@apply ml-10 mb-10 flex flex-col justify-end
@apply ml-5 sm:ml-10 mb-10 flex flex-col justify-end
cursor-pointer;
}
.top-banner-right {
Expand Down