Skip to content

Commit

Permalink
feat: 리뷰 페이지 퍼블리싱
Browse files Browse the repository at this point in the history
  • Loading branch information
dvp-tae committed Oct 21, 2024
1 parent 7b1e647 commit 3114d83
Show file tree
Hide file tree
Showing 21 changed files with 1,229 additions and 79 deletions.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"dependencies": {
"@radix-ui/react-icons": "^1.3.0",
"@radix-ui/react-progress": "^1.1.0",
"@svgr/rollup": "^8.1.0",
"@tanstack/react-query": "^5.59.0",
"@types/node": "^22.7.4",
"autoprefixer": "^10.4.20",
Expand All @@ -26,6 +27,7 @@
"recoil": "^0.7.7",
"swiper": "^11.1.14",
"tailwind-merge": "^2.5.4",
"tailwind-scrollbar-hide": "^1.1.7",
"tailwindcss": "^3.4.13",
"tailwindcss-animate": "^1.0.7"
},
Expand Down
Binary file added src/assets/images/profile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/review.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/assets/svgs/BackArrow.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions src/assets/svgs/Like.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/assets/svgs/StarRating.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions src/components/Layout/Footer/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Home from "@/assets/svgs/home.svg?react";
import Search from "@/assets/svgs/search.svg?react";
import Ticket from "@/assets/svgs/ticket.svg?react";
import User from "@/assets/svgs/user.svg?react";
import { ReactComponent as Home } from "@/assets/svgs/home.svg";
import { ReactComponent as Search } from "@/assets/svgs/search.svg";
import { ReactComponent as Ticket } from "@/assets/svgs/ticket.svg";
import { ReactComponent as User } from "@/assets/svgs/user.svg";
import { useState } from "react";

type FooterState = {
Expand Down
4 changes: 2 additions & 2 deletions src/components/Main/InformationCard/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Location_Gray from "@/assets/svgs/Location_gray.svg?react";
import Calendar from "@/assets/svgs/Calendar.svg?react";
import { ReactComponent as Location_Gray } from "@/assets/svgs/Location_gray.svg";
import { ReactComponent as Calendar } from "@/assets/svgs/Calendar.svg";
import { InfoCardProps } from "@/types/poster";
import { useTruncateText } from "@/hooks";
import { CategoryTag } from "@/components/common/CategoryTag";
Expand Down
2 changes: 1 addition & 1 deletion src/components/Main/MainPosterCard/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Poster8 from "@/assets/images/poster8.gif";
import BookMark from "@/assets/svgs/BookMark.svg?react";
import { ReactComponent as BookMark } from "@/assets/svgs/BookMark.svg";
import { CategoryTag } from "@/components/common/CategoryTag";

export const MainPosterCard = () => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/CategoryTag/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const CategoryTag = ({ categoryType, children }: Category) => {
};
return (
<div
className={`max-h-6 inline-flex items-center body4-normal text-common-white rounded-[20px] px-2 py-[3px] ${TagStyle()}`}
className={`max-h-6 inline-flex items-center caption-12 text-common-white rounded-[20px] px-2 py-[3px] ${TagStyle()}`}
>
{children}
</div>
Expand Down
10 changes: 5 additions & 5 deletions src/components/common/Genre/index.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import Grand from "@/assets/svgs/Grand.svg?react";
import Romantic from "@/assets/svgs/Romantic.svg?react";
import Elegant from "@/assets/svgs/Elegant.svg?react";
import Passionate from "@/assets/svgs/Passionate.svg?react";
import Classical from "@/assets/svgs/Classical.svg?react";
import { ReactComponent as Grand } from "@/assets/svgs/Grand.svg";
import { ReactComponent as Romantic } from "@/assets/svgs/Romantic.svg";
import { ReactComponent as Elegant } from "@/assets/svgs/Elegant.svg";
import { ReactComponent as Passionate } from "@/assets/svgs/Passionate.svg";
import { ReactComponent as Classical } from "@/assets/svgs/Classical.svg";
import { GenreProps, GenreType } from "@/types/genre";

const GENRE: GenreType[] = [
Expand Down
15 changes: 9 additions & 6 deletions src/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -150,17 +150,20 @@
.body1-regular {
@apply text-[1rem] font-normal leading-normal tracking-[-0.01em];
}
.body2-semibold {
@apply text-[0.875rem] font-semibold leading-normal tracking-[-0.01em];
}
.body2-medium {
@apply text-[0.9375rem] font-medium leading-normal tracking-[-0.01em];
@apply text-[0.875rem] font-medium leading-normal tracking-[-0.01em];
}
.body2-regular {
@apply text-[0.9375rem] font-normal leading-normal tracking-[-0.01em];
@apply text-[0.875rem] font-normal leading-normal tracking-[-0.01em];
}
.body3-normal {
@apply text-[0.8125rem] font-normal leading-normal tracking-[-0.01em];
.caption-13 {
@apply text-[0.8125rem] font-normal leading-normal tracking-[-0.02em];
}
.body4-normal {
@apply text-[0.75rem] font-normal leading-normal tracking-[-0.01em];
.caption-12 {
@apply text-[0.75rem] font-normal leading-normal tracking-[-0.02em];
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/pages/Main/containers/NearbyEventsSection.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import ClacoMain from "@/assets/svgs/Claco_Main.svg?react";
import { ReactComponent as ClacoMain } from "@/assets/svgs/Claco_Main.svg";
import { Genre } from "@/components/common/Genre";
import { MainPosterCard } from "@/components/Main/MainPosterCard";

Expand Down
2 changes: 1 addition & 1 deletion src/pages/Main/containers/SimilarCollectionSection.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Location from "@/assets/svgs/Location.svg?react";
import { ReactComponent as Location } from "@/assets/svgs/Location.svg";
import Poster6 from "@/assets/images/poster6.gif";
import Poster9 from "@/assets/images/poster9.gif";
import Poster11 from "@/assets/images/poster11.gif";
Expand Down
4 changes: 2 additions & 2 deletions src/pages/Main/containers/SimilarShowsSection.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Image1 from "@/assets/images/poster1.gif";
import Image2 from "@/assets/images/poster6.gif";
import Image3 from "@/assets/images/poster7.gif";
import Arrow from "@/assets/svgs/Arrow 2.svg?react";
import { ReactComponent as Arrow } from "@/assets/svgs/Arrow 2.svg";

const SimilarShowsSection = () => {
const images = [Image1, Image2, Image3];
Expand Down Expand Up @@ -43,7 +43,7 @@ const SimilarShowsSection = () => {
))}
</ul>
</div>
<div className="animate-bounce absolute bottom-[200px] right-6 body3-normal flex-col space-y-[11px] text-common-white cursor-pointer">
<div className="animate-bounce absolute bottom-[200px] right-6 caption-13 flex-col space-y-[11px] text-common-white cursor-pointer">
<Arrow />
<div>컬렉션 보러가기</div>
</div>
Expand Down
18 changes: 0 additions & 18 deletions src/pages/Main/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,9 @@ import {
SimilarShowsSection,
} from "./containers";

// import { Swiper, SwiperSlide } from "swiper/react";
// import "swiper/css";

export const MainPage = () => {
return (
<div className="pt-[73px]">
{/* <Swiper direction={"vertical"} className="h-full" speed={1000}>
<SwiperSlide>
<NearbyEventsSection />
</SwiperSlide>
<SwiperSlide>
<PersonalizedSection />
</SwiperSlide>
<SwiperSlide>
<SimilarCollectionSection />
</SwiperSlide>
<SwiperSlide>
<SimilarShowsSection />
</SwiperSlide>
</Swiper> */}

<NearbyEventsSection />
<PersonalizedSection />
<SimilarCollectionSection />
Expand Down
163 changes: 159 additions & 4 deletions src/pages/Review/page.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,168 @@
import BackArrow from "@/assets/svgs/BackArrow.svg?react";
import { ReactComponent as BackArrow } from "@/assets/svgs/BackArrow.svg";
import { ReactComponent as Like } from "@/assets/svgs/Like.svg";
import { ReactComponent as Star } from "@/assets/svgs/StarRating.svg";
import Review from "@/assets/images/review.png";
import Profile from "@/assets/images/profile.png";

import { CategoryTag } from "@/components/common/CategoryTag";
import { useTruncateText } from "@/hooks";
import { useEffect, useRef, useState } from "react";

const options: string[] = ["별점 높은 순", "별점 낮은 순", "최신 순"];

export const ReviewPage = () => {
const [isOpen, setIsOpen] = useState<boolean>(false);
const [selectOption, setSelectOption] = useState<string>(options[0]);
const [isLiked, setIsLiked] = useState<boolean>(false);

const dropdownRef = useRef<HTMLDivElement>(null);

useEffect(() => {
const handleClickOutside = (event: MouseEvent) => {
if (
dropdownRef.current &&
!dropdownRef.current.contains(event.target as Node)
) {
setIsOpen(false);
}
};

document.addEventListener("mousedown", handleClickOutside);
return () => {
document.removeEventListener("mousedown", handleClickOutside);
};
}, []);

const _review =
"크리스마스 밤, 클라라의 집에서 뭐가 벌어지는 것 같긴한데, 내용이 어떻게 될까요. 저는 모르겠습니다만 이렇게 두줄이 넘어가면 말줄임이 되어야 하지 않을까";
return (
<div className="pt-[60px] px-5">
<section className="flex justify-between">
<div className="pt-[60px] px-6">
<section className="flex justify-between mb-[53px]">
<BackArrow />
<div className="heading2-bold">리뷰</div>
<div className="headline2-bold">리뷰</div>
<div className="w-[11px] h-[20px] bg-inherit"></div>
</section>
<section className="flex-col space-y-[10px] mb-[3px]">
<div className="flex space-x-2">
<CategoryTag categoryType="dance">무용</CategoryTag>
<CategoryTag categoryType="ongoing">공연 중</CategoryTag>
</div>
<div className="flex-col">
<div className="heading2-bold">
유니버설발레단 〈호두까기 인형〉 - 성남
</div>
<div className="body2-medium text-grayscale-60">리뷰 72개</div>
</div>
</section>
<section>
<div
ref={dropdownRef}
className="relative flex items-center justify-end space-x-2 cursor-pointer text-common-white mb-[19px]"
onClick={() => setIsOpen((prev) => !prev)}
>
<div className="caption-13">{selectOption}</div>
<BackArrow
width="4"
height="8"
viewBox="0 0 11 20"
className={`transition-transform duration-300 ease-in-out ${isOpen ? "rotate-90" : "-rotate-90"} `}
/>
<div
className={`absolute top-6 bg-grayscale-10 py-[10px] px-5 rounded-[5px] transition-all duration-300 ease-in-out ${
isOpen ? "opacity-100 translate-y-0" : "opacity-0 -translate-y-2"
}`}
>
{isOpen ? (
<ul className="text-center caption-13 space-y-[12px] w-[65px]">
{options.map((option, index) => (
<li
key={index}
onClick={() => setSelectOption(option)}
className={`${selectOption === option ? "text-common-white" : "text-grayscale-60"}`}
>
{option}
</li>
))}
</ul>
) : null}
</div>
</div>

<div className="py-5 pl-[17px] pr-5 bg-grayscale-20 text-grayscale-80 rounded-[5px]">
<div className="flex justify-between mb-[17px]">
<div className="flex items-center space-x-[10px]">
<img
src={Profile}
alt="프로필 이미지"
className="object-fill w-8 h-8 rounded-full"
/>
<div className="headline2-bold">울랄라</div>
</div>
<div
className={`flex items-center space-x-1 ${isLiked ? "text-secondary2-100" : "text-grayscale-60"}`}
onClick={() => setIsLiked((prev) => !prev)}
>
<Like />
<span className="body2-medium">10</span>
</div>
</div>

<div className="flex space-x-[14px] max-h-[90px] mb-[19px]">
<div className="relative">
<img
src={Review}
alt="공연 이미지"
className="min-w-[90px] h-[90px] rounded-[5px]"
/>
<div className="absolute bottom-0 right-0 w-[19px] h-[19px] bg-[#8A8585] text-center caption-12 rounded-br-[5px]">
3
</div>
</div>
<div className="flex-col space-y-2">
<div className="flex items-center space-x-1">
<Star />
<div className="body2-medium text-secondary2-100/100">4.0</div>
</div>
<div className="body2-medium">{useTruncateText(_review, 50)}</div>
</div>
</div>

<div className="flex items-center justify-start space-x-2 mb-[10px]">
<div className="body2-semibold">공연장</div>
<div className="text-[12px] font-medium leading-normal tracking-[-0.02em] text-[#8A8585]">
9층 B열 14번
</div>
</div>

<div className="flex space-x-2 overflow-x-auto scrollbar-hide mb-[19px]">
<div className="rounded-[50px] bg-grayscale-30 inline-flex caption-13 px-[13px] py-[8.5px] whitespace-nowrap">
울림이 좋아요
</div>
<div className="rounded-[50px] bg-grayscale-30 inline-flex caption-13 px-[13px] py-[8.5px] whitespace-nowrap">
울림이 좋아요
</div>
<div className="rounded-[50px] bg-grayscale-30 inline-flex caption-13 px-[13px] py-[8.5px] whitespace-nowrap">
울림이 좋아요
</div>
<div className="rounded-[50px] bg-grayscale-30 inline-flex caption-13 px-[13px] py-[8.5px] whitespace-nowrap">
울림이 좋아요
</div>
</div>

<div className="flex justify-between caption-12">
<div className="text-grayscale-50">2024.11.11</div>
<div className="flex items-center space-x-2 text-grayscale-60">
<div className="">더 보기</div>
<BackArrow
width="5"
height="11"
viewBox="0 0 11 20"
className="-rotate-180"
/>
</div>
</div>
</div>
</section>
</div>
);
};
Loading

0 comments on commit 3114d83

Please sign in to comment.