Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 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
10 changes: 9 additions & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
## ⚒️ 작업 내용

> 이번 PR에서 작업한 내용을 간략히 설명해주세요.
- 이번 PR에서 작업한 내용을 간략히 설명해주세요.

## ⚙️ 관련 이슈

> (선택)

## ☎️ 관련 문의

> 1번 SERVICE/REPORT/GENERAL

## 👁️‍🗨️ 리뷰 요청사항

(선택)
9 changes: 7 additions & 2 deletions src/entities/auth/hooks/useResetPassword.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,13 @@ export const useResetPassword = () => {
mutationFn: resetPassword,
onSuccess: () => {
toast({
title: "임시 비밀번호 발송 완료",
description: "로그인 후 비밀번호를 변경해주세요.",
title: "본인 확인 완료",
description: (
<>
메일로 임시 비밀번호를 보내드렸어요. 📧 <br />{" "}
<strong>임시 비밀번호</strong>로 로그인해주세요.
</>
),
variant: "default",
});
navigate(URL_PATHS.SIGNIN);
Expand Down
3 changes: 3 additions & 0 deletions src/features/header/bookmark-header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ interface BookmarkHeaderProps {
hasBorder?: boolean;
hasBackButton?: boolean;
onBackButtonClick?: () => void;
showHamburgerButton?: boolean;
}

export default function BookmarkHeader({
title,
hasBorder,
hasBackButton,
onBackButtonClick,
showHamburgerButton,
}: BookmarkHeaderProps) {
const handleBookmark = () => {
// TODO: 북마크 기능
Expand All @@ -25,6 +27,7 @@ export default function BookmarkHeader({
hasBorder={hasBorder}
hasBackButton={hasBackButton}
onBackButtonClick={onBackButtonClick}
showHamburgerButton={showHamburgerButton}
>
<button onClick={handleBookmark} aria-label="북마크">
<img
Expand Down
3 changes: 3 additions & 0 deletions src/features/header/community-header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ interface CommunityHeaderProps {
hasWriteButton?: boolean;
category?: "TEACHER" | "PROSPECTIVE_TEACHER";
hasBorder?: boolean;
showHamburgerButton?: boolean;
}

export default function CommunityHeader({
Expand All @@ -23,6 +24,7 @@ export default function CommunityHeader({
hasWriteButton = false,
category = "TEACHER",
hasBorder = true,
showHamburgerButton,
}: CommunityHeaderProps) {
const navigate = useNavigate();

Expand All @@ -38,6 +40,7 @@ export default function CommunityHeader({
hasBackButton={hasBackButton}
onBackButtonClick={onBackButtonClick}
hasBorder={hasBorder}
showHamburgerButton={showHamburgerButton}
>
<div className="flex items-center gap-4">
<button onClick={handleSearch} aria-label="검색">
Expand Down
3 changes: 3 additions & 0 deletions src/features/header/kindergarten-header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ interface KindergartenHeaderProps {
kindergartenId?: string;
showBookmark?: boolean;
showShare?: boolean;
showHamburgerButton?: boolean;
}

export default function KindergartenHeader({
Expand All @@ -29,6 +30,7 @@ export default function KindergartenHeader({
kindergartenId,
showBookmark = false,
showShare = false,
showHamburgerButton,
}: KindergartenHeaderProps) {
const navigate = useNavigate();

Expand All @@ -43,6 +45,7 @@ export default function KindergartenHeader({
hasBorder={hasBorder}
hasBackButton={hasBackButton}
onBackButtonClick={onBackButtonClick}
showHamburgerButton={showHamburgerButton}
>
<div className="flex items-center gap-4">
{showShare && kindergartenId && isValidId(kindergartenId) && (
Expand Down
3 changes: 3 additions & 0 deletions src/features/header/save-header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ interface SaveHeaderProps {
hasBackButton?: boolean;
onBackButtonClick?: () => void;
onSave?: () => void;
showHamburgerButton?: boolean;
}

export default function SaveHeader({
Expand All @@ -16,13 +17,15 @@ export default function SaveHeader({
hasBackButton,
onBackButtonClick,
onSave,
showHamburgerButton,
}: SaveHeaderProps) {
return (
<Header
title={title}
hasBorder={hasBorder}
hasBackButton={hasBackButton}
onBackButtonClick={onBackButtonClick}
showHamburgerButton={showHamburgerButton}
>
<Button
type="button"
Expand Down
6 changes: 3 additions & 3 deletions src/pages/auth/find-password.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@ const FIND_PASSWORD_STEP_CONFIGS = {
getSubtitle: () => (
<p className="mt-2 text-sm text-primary-normal03">
가입하신 이메일 주소를 입력해 주세요. <br />
인증번호 메일을 보내드릴게요.
본인 확인을 위한 <strong>인증번호</strong>를 보내드릴게요.
</p>
),
},
2: {
title: "인증번호 메일 발송 완료",
getSubtitle: (data: Record<string, unknown>) => (
<p className="mt-2 text-sm text-primary-normal03">
{data.email as string}로 발송되었습니다. <br />
인증 후 메일로 임시 비밀번호를 발급해드릴게요.
{data.email as string}로 발송된 인증번호를 입력해주세요. <br />
인증 후 <strong>임시 비밀번호를 재발급</strong>해드릴게요.
</p>
),
},
Expand Down
13 changes: 10 additions & 3 deletions src/pages/kindergarten/detail.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Suspense, useState } from "react";
import { useLocation, useNavigate, useParams } from "react-router-dom";

import { useUrlNavigation } from "@/features/nav/lib/useUrlNavigation";
import { URL_PATHS } from "@/shared/constants/url-path";
import Error from "@/shared/ui/layout/error";
import PageLayout from "@/shared/ui/layout/page-layout";
Expand All @@ -16,13 +17,19 @@ export default function KindergartenDetailPage() {
const safeId = id || "unknown";
const [kindergartenName, setKindergartenName] = useState<string | null>(null);

const handleBackClick = () => {
const customBackHandler = () => {
if (location.state?.fromBookmarks) {
navigate(URL_PATHS.USER_FAVORITES);
return;
return true;
}

navigate(URL_PATHS.KINDERGARTEN);
return false;
};

const { handleBackNavigation } = useUrlNavigation(customBackHandler);

const handleBackClick = () => {
handleBackNavigation();
};

return (
Expand Down
55 changes: 33 additions & 22 deletions src/shared/ui/layout/page-layout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,13 @@ import CommunityHeader from "@/features/header/community-header";
import KindergartenHeader from "@/features/header/kindergarten-header";
import SaveHeader from "@/features/header/save-header";
import GlobalNavBar from "@/features/nav/ui/GlobalNavBar";
import { URL_PATHS } from "@/shared/constants/url-path";
import Metadata from "@/shared/hooks/useMetadata";
import Main from "@/shared/ui/layout/main";
import Wrapper from "@/shared/ui/layout/page-wrapper";

/**
* 페이지의 공용 레이아웃
* @param children
* @param title Metadata, 페이지 제목
* @param description Metadata, 페이지 설명
* @param ogImage Metadata, 오픈 그래프 이미지 URL
* @param ogUrl Metadata, 페이지 URL
* @param headerTitle 원바원 로고 미노출 시 빈 문자열 기입
* @param headerType base, community, kindergarten, save, bookmark
* @param headerBgColor
* @param headerHasBorder Header 하단 테두리 유무, 기본 값 true
* @param hasBackButton 헤더에 뒤로가기 버튼 표시 여부
* @param onBackButtonClick 뒤로가기 버튼 클릭 시 실행할 함수
* @param currentPath
* @param wrapperBg 기본 값 gray
* @param mainBg 기본 값 white
* @param mainClassName
* @param isGlobalNavBar 기본 값 true
* @param kindergartenId
* @param showBookmark
* @param onSave 저장 버튼 클릭 시 실행할 함수 (headerType이 save인 경우)
*/
const authPaths = [URL_PATHS.SIGNIN, URL_PATHS.SIGNUP, URL_PATHS.FIND_PASSWORD];

interface PageLayoutProps {
children: ReactNode;
title?: string;
Expand All @@ -55,8 +36,31 @@ interface PageLayoutProps {
showShare?: boolean;
onSave?: () => void;
showAlarmButton?: boolean;
showHamburgerButton?: boolean;
}

/**
* 페이지의 공용 레이아웃
* @param children
* @param title Metadata, 페이지 제목
* @param description Metadata, 페이지 설명
* @param ogImage Metadata, 오픈 그래프 이미지 URL
* @param ogUrl Metadata, 페이지 URL
* @param headerTitle 원바원 로고 미노출 시 빈 문자열 기입
* @param headerType base, community, kindergarten, save, bookmark
* @param headerBgColor
* @param headerHasBorder Header 하단 테두리 유무, 기본 값 true
* @param hasBackButton 헤더에 뒤로가기 버튼 표시 여부
* @param onBackButtonClick 뒤로가기 버튼 클릭 시 실행할 함수
* @param currentPath
* @param wrapperBg 기본 값 gray
* @param mainBg 기본 값 white
* @param mainClassName
* @param isGlobalNavBar 기본 값 true
* @param kindergartenId
* @param showBookmark
* @param onSave 저장 버튼 클릭 시 실행할 함수 (headerType이 save인 경우)
*/
export default function PageLayout({
children,
title,
Expand All @@ -80,7 +84,13 @@ export default function PageLayout({
showShare,
onSave,
showAlarmButton = false,
showHamburgerButton,
}: PageLayoutProps) {
const shouldShowHamburgerButton =
showHamburgerButton !== undefined
? showHamburgerButton
: !authPaths.includes(currentPath);

const renderHeader = () => {
if (!headerTitle && !headerLogo) return null;

Expand All @@ -92,6 +102,7 @@ export default function PageLayout({
hasBackButton: hasBackButton,
onBackButtonClick: onBackButtonClick,
showAlarmButton: showAlarmButton,
showHamburgerButton: shouldShowHamburgerButton,
};

switch (headerType) {
Expand Down
4 changes: 2 additions & 2 deletions src/widgets/all-review-list/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { REVIEW_TYPES, REVIEW_TYPE_LABELS } from "@/shared/constants/review";
import Empty from "@/shared/ui/layout/empty";
import LoadingSpinner from "@/shared/ui/loading/loading-spinner";
import { ReviewData } from "@/widgets/review-list/lib/getTotalRating";
import ReviewCard from "@/widgets/review-list/ui/ReviewCard";
import { ReviewCardList } from "@/widgets/review-list/ui/ReviewCardList";
import SortToggle from "@/widgets/review-list/ui/SortToggle";
import { getFieldConfigsByType } from "@/widgets/review-panel/lib/getFieldConfigsByType";

Expand Down Expand Up @@ -80,7 +80,7 @@ export default function AllReviewList() {
{reviews.length > 0 ? (
<>
<section>
<ReviewCard
<ReviewCardList
review={reviews as unknown as ReviewData[]}
type={reviewType}
fieldConfigs={fieldConfigs}
Expand Down
4 changes: 2 additions & 2 deletions src/widgets/community-feed/post-list/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import LoadingSpinner from "@/shared/ui/loading/loading-spinner";
import { getCategoryLabel } from "@/shared/utils/categoryUtils";
import PostCard from "@/widgets/community-feed/post-list/ui/PostCard";

const INITIAL_HEIGHT_OFFSET = 180;
const RESIZE_HEIGHT_OFFSET = 280;
const INITIAL_HEIGHT_OFFSET = 170;
const RESIZE_HEIGHT_OFFSET = 270;
const ITEM_HEIGHT = 138;

const PostItem = ({ index, style, data }: PostItemProps) => {
Expand Down
4 changes: 2 additions & 2 deletions src/widgets/review-list/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { SortType } from "@/entities/review/DTO.d";
import { REVIEW_TYPES } from "@/shared/constants/review";
import Empty from "@/shared/ui/layout/empty";
import { ReviewData } from "@/widgets/review-list/lib/getTotalRating";
import ReviewCard from "@/widgets/review-list/ui/ReviewCard";
import { ReviewCardList } from "@/widgets/review-list/ui/ReviewCardList";
import SortToggle from "@/widgets/review-list/ui/SortToggle";
import { ReviewFieldConfig } from "@/widgets/review-panel/lib/config";

Expand Down Expand Up @@ -46,7 +46,7 @@ export default function ReviewList({
{/* <RatingFilter /> */}
</div>
{displayReviews.length > 0 ? (
<ReviewCard
<ReviewCardList
review={displayReviews}
fieldConfigs={fieldConfigs}
type={type}
Expand Down
Loading