From eb3aa17d0ee32922320692c967dc803074dddb22 Mon Sep 17 00:00:00 2001 From: Photogrammer <81505228+JuneParkCode@users.noreply.github.com> Date: Fri, 6 Oct 2023 17:56:31 +0900 Subject: [PATCH] =?UTF-8?q?[Fix]=20=EB=B0=B0=EB=84=88=20=EB=A7=81=ED=81=AC?= =?UTF-8?q?=20/=20=EC=98=88=EC=95=BD=20=ED=8E=98=EC=9D=B4=EC=A7=80=20?= =?UTF-8?q?=EB=A7=81=ED=81=AC=20Pascal=20Case=EB=A1=9C=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD=20(#240)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [fix]: 배너 수정 - 링크 새탭 처리 - 배너 모바일 환경 ml 변경 - 배너 이미지 없는 경우에도 받도록 처리 * [fix]: 상단 멘토링 탭 로그인 상태 반영 * [fix]: reservation -> Reservation * [fix]: footer 42 manito 간격 모바일 중앙화 * [fix]: Mentorings 배너 링크 수정 * [fix]: 외부 사이트 경로일 경우에만 새탭으로 열도록 변경 * [fix]: profile Update hashtag.length > 1 적용 * [fix]: 409 alert 핸들링 제거 --- 42manito/src/Types/Banners/Banner.dto.tsx | 4 +-- 42manito/src/components/Banners/Banners.tsx | 24 +------------- 42manito/src/components/Banners/TopBanner.tsx | 32 ++++++++++++------- 42manito/src/components/Layout/Footer.tsx | 2 +- .../Layout/Header/components/DesktopNav.tsx | 14 ++++---- .../Layout/Header/components/Sidebar.tsx | 8 +++-- .../Profile/Update/HashtagUpdateInput.tsx | 3 +- 42manito/src/pages/Mentorings/index.tsx | 14 ++++---- .../[reservationId].tsx | 0 42manito/src/styles/banner.css | 4 +-- 42manito/src/utils/BaseQuery.ts | 3 +- 11 files changed, 50 insertions(+), 58 deletions(-) rename 42manito/src/pages/{reservation => Reservation}/[reservationId].tsx (100%) diff --git a/42manito/src/Types/Banners/Banner.dto.tsx b/42manito/src/Types/Banners/Banner.dto.tsx index 11479352..bb27cd82 100644 --- a/42manito/src/Types/Banners/Banner.dto.tsx +++ b/42manito/src/Types/Banners/Banner.dto.tsx @@ -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 } diff --git a/42manito/src/components/Banners/Banners.tsx b/42manito/src/components/Banners/Banners.tsx index 2f251f67..dc76d59e 100644 --- a/42manito/src/components/Banners/Banners.tsx +++ b/42manito/src/components/Banners/Banners.tsx @@ -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", - }, ]; diff --git a/42manito/src/components/Banners/TopBanner.tsx b/42manito/src/components/Banners/TopBanner.tsx index 9f96ce10..7711c4ce 100644 --- a/42manito/src/components/Banners/TopBanner.tsx +++ b/42manito/src/components/Banners/TopBanner.tsx @@ -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(); const timer = 3000; // 임의로 넣어뒀습니다 @@ -83,17 +87,21 @@ export default function TopBanner({ banner }: props) { )} -
-
- { +
+
+ {banner[currentIndex].image !== undefined && ( + { + )}
{banner[currentIndex].head}
diff --git a/42manito/src/components/Layout/Footer.tsx b/42manito/src/components/Layout/Footer.tsx index e561f76d..86ef1438 100644 --- a/42manito/src/components/Layout/Footer.tsx +++ b/42manito/src/components/Layout/Footer.tsx @@ -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" > - 42Manito + 42Manito 42Manito ©2023 diff --git a/42manito/src/components/Layout/Header/components/DesktopNav.tsx b/42manito/src/components/Layout/Header/components/DesktopNav.tsx index 9ece6cde..e6282b52 100644 --- a/42manito/src/components/Layout/Header/components/DesktopNav.tsx +++ b/42manito/src/components/Layout/Header/components/DesktopNav.tsx @@ -13,12 +13,14 @@ export const DesktopNav = ({ Owner }: Props) => { 42 Manito - - 멘토링 - + {Owner !== 0 && ( + + 멘토링 + + )} {Owner !== 0 && (

- -

멘토링

- + {!!uid && ( + +

멘토링

+ + )} {!!uid && (

프로필

diff --git a/42manito/src/components/Profile/Update/HashtagUpdateInput.tsx b/42manito/src/components/Profile/Update/HashtagUpdateInput.tsx index 4623c2f6..b58a4c5b 100644 --- a/42manito/src/components/Profile/Update/HashtagUpdateInput.tsx +++ b/42manito/src/components/Profile/Update/HashtagUpdateInput.tsx @@ -26,7 +26,8 @@ export default function HashtagUpdateInput({ hashtags }: props) { ] = usePostHashtagMutation(); const hashtagPostHandler = () => { - if (inputValue.length === 0) { + if (inputValue.length <= 1) { + alert("최소 2글자 이상 입력해야합니다."); return; } const doesHashtagExist = hashtags.some( diff --git a/42manito/src/pages/Mentorings/index.tsx b/42manito/src/pages/Mentorings/index.tsx index 445d9a54..4c845bfb 100644 --- a/42manito/src/pages/Mentorings/index.tsx +++ b/42manito/src/pages/Mentorings/index.tsx @@ -19,25 +19,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.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 isSociaLinkModalOpen = useSelector( (state: RootState) => state.rootReducers.reservation.isSocialLinkModalOpen diff --git a/42manito/src/pages/reservation/[reservationId].tsx b/42manito/src/pages/Reservation/[reservationId].tsx similarity index 100% rename from 42manito/src/pages/reservation/[reservationId].tsx rename to 42manito/src/pages/Reservation/[reservationId].tsx diff --git a/42manito/src/styles/banner.css b/42manito/src/styles/banner.css index a6a90072..14cb69ac 100644 --- a/42manito/src/styles/banner.css +++ b/42manito/src/styles/banner.css @@ -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 { diff --git a/42manito/src/utils/BaseQuery.ts b/42manito/src/utils/BaseQuery.ts index 4d4c29df..4159227a 100644 --- a/42manito/src/utils/BaseQuery.ts +++ b/42manito/src/utils/BaseQuery.ts @@ -44,7 +44,8 @@ export const BaseQuery = } else if (status === 404) { alert("존재하지 않는 작업입니다."); } else if (status === 409) { - alert("이미 완료된 작업입니다."); + // 409 의 경우 따로 처리해야함. + // alert("이미 완료된 작업입니다."); } else if (status === 401 || status === 403) { alert("권한이 없습니다."); Router.push("/");