Skip to content

Commit

Permalink
[Fix] 배너 링크 / 예약 페이지 링크 Pascal Case로 변경 (manito42#240)
Browse files Browse the repository at this point in the history
* [fix]: 배너 수정

- 링크 새탭 처리
- 배너 모바일 환경 ml 변경
- 배너 이미지 없는 경우에도 받도록 처리

* [fix]: 상단 멘토링 탭 로그인 상태 반영

* [fix]: reservation -> Reservation

* [fix]: footer 42 manito 간격 모바일 중앙화

* [fix]: Mentorings 배너 링크 수정

* [fix]: 외부 사이트 경로일 경우에만 새탭으로 열도록 변경

* [fix]: profile Update hashtag.length > 1 적용

* [fix]: 409 alert 핸들링 제거
  • Loading branch information
JuneParkCode authored and obvoso committed Oct 27, 2023
1 parent 8b39a6d commit eb3aa17
Show file tree
Hide file tree
Showing 11 changed files with 50 additions and 58 deletions.
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 && (
<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
Original file line number Diff line number Diff line change
Expand Up @@ -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(
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 @@ -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>(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
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
3 changes: 2 additions & 1 deletion 42manito/src/utils/BaseQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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("/");
Expand Down

0 comments on commit eb3aa17

Please sign in to comment.