Skip to content

Commit

Permalink
Merge pull request #374 from oduck-team/feat/373
Browse files Browse the repository at this point in the history
feat: 준비중인 기능 알림 추가
  • Loading branch information
presentKey authored Apr 22, 2024
2 parents 9757eea + 5180a99 commit 5c07cab
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
14 changes: 13 additions & 1 deletion src/components/Layout/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { BOOKMARK } from "@/features/users/hooks/useTabMenu";
import Avatar from "../Avatar";
import Button from "../Button";
import Drawer from "../Drawer";
import useSnackBar from "../SnackBar/useSnackBar";

import Navigation from "./Navigation";
import { NavItem } from "./Navigation/NavigationItem";
Expand Down Expand Up @@ -67,6 +68,7 @@ export default function Sidebar({
const { user, logout } = useAuth();
const [isLoginModalVisible, setIsLoginModalVisible] = useState(false);
const navigate = useNavigate();
const snackBar = useSnackBar();

const handleClickUserMenu = (id: string, e: React.MouseEvent) => {
e.preventDefault();
Expand All @@ -88,6 +90,12 @@ export default function Sidebar({
}
};

/** 공지사항 페이지 - 준비중인 기능 */
const handleNoticeMenu = (_: string, e: React.MouseEvent) => {
e.preventDefault();
snackBar.open({ message: "준비중인 기능입니다." });
};

const handleLogout = (_id: string, e: React.MouseEvent) => {
e.preventDefault();
logout();
Expand Down Expand Up @@ -144,7 +152,11 @@ export default function Sidebar({
<Divider />
<Navigation.Content>
{helpMenuItems.map((item) => (
<Navigation.Item key={item.id} item={item} onClick={onClickItem} />
<Navigation.Item
key={item.id}
item={item}
onClick={item.id === "notice" ? handleNoticeMenu : onClickItem}
/>
))}
{user && (
<Navigation.Item
Expand Down
13 changes: 8 additions & 5 deletions src/features/reviews/components/ReviewCard/ReviewMoreButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { useState } from "react";

import BackdropPortal from "@/components/Backdrop/BackdropPortal";
import Rating from "@/components/Rating";
import useSnackBar from "@/components/SnackBar/useSnackBar";
import useToast from "@/components/Toast/useToast";
import DropDownModal from "@/features/users/components/DropDownModal";
import useDropDownModal from "@/features/users/components/DropDownModal/useDropDownModal";
Expand All @@ -13,7 +14,7 @@ import useDebounce from "@/hooks/useDebounce";
import useEvaluation from "../../hook/useEvaluation";
import ShortReviewModal from "../ReviewRating/ShortReviewModal";

import ReviewDeleteModal from "./ReviewDeleteModal";
// import ReviewDeleteModal from "./ReviewDeleteModal";
import {
MoreButton,
MyRating,
Expand Down Expand Up @@ -42,7 +43,8 @@ export default function ReviewMoreButton({
const theme = useTheme();
const { isDropDownModalOpen, handleDropDownModalToggle } = useDropDownModal();
const [isReviewModalVisible, setIsReviewModalVisible] = useState(false);
const [isDeleteModalVisible, setIsDeleteModalVisible] = useState(false);
// const [isDeleteModalVisible, setIsDeleteModalVisible] = useState(false); // 삭제기능: 준비중
const snackBar = useSnackBar();

const evaluationMutation = useEvaluation({ animeId });

Expand All @@ -68,8 +70,9 @@ export default function ReviewMoreButton({
}, DEBOUNCE_DELAY);

const handleReviewDeleteClick = () => {
snackBar.open({ message: "준비중인 기능입니다." });
handleDropDownModalToggle();
setIsDeleteModalVisible(true);
// setIsDeleteModalVisible(true);
};

const handleBackdropClick = () => {
Expand Down Expand Up @@ -141,13 +144,13 @@ export default function ReviewMoreButton({
</ShortReviewModal>
)}

{isDeleteModalVisible && (
{/* {isDeleteModalVisible && (
<ReviewDeleteModal
reviewId={reviewId}
animeId={animeId}
onClose={() => setIsDeleteModalVisible(false)}
/>
)}
)} */}
</AnimatePresence>
</>
)}
Expand Down

0 comments on commit 5c07cab

Please sign in to comment.