Skip to content

Commit fbffbd4

Browse files
authored
design: 대학 세부 페이지 디자인 변경 (#154)
* design: k50 색상변경 * refactor: CollegeDetail 리팩토링 * refactor: BottomSheet 리팩토링 * rename: CollegeBottomSheet 이름 파일명과 통일 * remove: 중복 파일 삭제
1 parent 1a6a11d commit fbffbd4

File tree

7 files changed

+24
-58
lines changed

7 files changed

+24
-58
lines changed

headver.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"head": 29
2+
"head": 30
33
}

src/app/university/[id]/CollegeBottomsheet.tsx renamed to src/app/university/[id]/CollegeBottomSheet.tsx

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
import { useEffect, useRef, useState } from "react";
44

5+
import clsx from "clsx";
6+
57
import {
68
deleteUniversityFavoriteApi,
79
getUniversityFavoriteStatusApi,
@@ -115,11 +117,12 @@ const CollegeBottomSheet = ({ collegeId, convertedKoreanName, reviewList, univer
115117

116118
return (
117119
<>
118-
<div className={styles.blank} />
119-
<div className={styles.bottomSheet}>
120-
<div className="absolute -top-3 ml-8 -translate-y-full font-serif text-3xl font-semibold text-white">
121-
{university.englishName || "대학명"}
120+
<div className={clsx("max-h-80", styles["flexible-height"])}>
121+
<div className="flex h-full items-end pb-3 pl-8">
122+
<span className="text-3xl font-semibold text-white">{university.englishName || "대학명"}</span>
122123
</div>
124+
</div>
125+
<div className="relative rounded-t-3xl bg-white">
123126
<div className="flex h-[69px] items-center justify-between pl-5 pr-[22px] pt-6">
124127
<div className="font-serif text-2xl font-semibold">{convertedKoreanName || "대학명"}</div>
125128
<button onClick={toggleLike} type="button">
@@ -140,7 +143,7 @@ const CollegeBottomSheet = ({ collegeId, convertedKoreanName, reviewList, univer
140143
<div className={styles.item}>
141144
<div className={"ml-5 font-serif text-base font-semibold"}>홈페이지</div>
142145
<div className="mx-5 mt-2.5 font-serif text-sm font-normal leading-normal">
143-
<a href={university.homepageUrl || ""} target="_blank" rel="noreferrer">
146+
<a className="break-words" href={university.homepageUrl || ""} target="_blank" rel="noreferrer">
144147
{university.homepageUrl || "홈페이지 없음"}
145148
</a>
146149
</div>
@@ -155,7 +158,7 @@ const CollegeBottomSheet = ({ collegeId, convertedKoreanName, reviewList, univer
155158
href={university.accommodationUrl}
156159
target="_blank"
157160
rel="noreferrer"
158-
className="font-serif text-sm font-normal leading-normal"
161+
className="break-words font-serif text-sm font-normal leading-normal"
159162
>
160163
{university.accommodationUrl}
161164
</a>
@@ -251,7 +254,7 @@ const CollegeBottomSheet = ({ collegeId, convertedKoreanName, reviewList, univer
251254
href={university.englishCourseUrl}
252255
target="_blank"
253256
rel="noreferrer"
254-
className="font-serif text-sm font-normal leading-normal"
257+
className="break-words font-serif text-sm font-normal leading-normal"
255258
>
256259
{university.englishCourseUrl}
257260
</a>

src/app/university/[id]/CollegeDetail.tsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,19 @@ import Image from "next/image";
22

33
import styles from "./college-detail.module.css";
44

5-
type CollegeDetailProps = {
6-
name: string;
5+
interface CollegeDetailProps {
76
imageUrl: string;
8-
};
7+
}
98

10-
const CollegeDetail = ({ name, imageUrl }: CollegeDetailProps) => (
9+
const CollegeDetail = ({ imageUrl }: CollegeDetailProps) => (
1110
<div className={styles.wrapper}>
1211
<div className={styles.imageWrapper}>
1312
<Image
14-
className={styles.image}
13+
className="h-full w-full object-cover"
1514
src={`${process.env.NEXT_PUBLIC_IMAGE_URL}/${imageUrl}`}
16-
alt={name}
1715
width={600}
1816
height={300}
17+
alt="학교 이미지"
1918
/>
2019
</div>
2120
</div>

src/app/university/[id]/college-bottomsheet.module.css

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,10 @@
1-
.bottomSheet {
2-
position: relative;
3-
background-color: white;
4-
border-radius: 30px 30px 0px 0px;
5-
}
6-
.bottomSheet a {
7-
overflow-wrap: break-word;
8-
}
9-
10-
.blank {
1+
.flexible-height {
112
height: calc(100vw / 2);
12-
/* opacity: 0;
13-
visibility: hidden; */
3+
background: linear-gradient(180deg, rgba(0, 0, 0, 0) 33.85%, rgba(0, 0, 0, 0.6) 86.98%);
144
}
155
@media (min-width: 600px) {
16-
.blank {
6+
.flexible-height {
177
height: 300px;
18-
/* opacity: 0;
19-
visibility: hidden; */
208
}
219
}
2210

@@ -45,7 +33,7 @@
4533

4634
/* 섹션 */
4735
.scrollOffset {
48-
/* 네비게이션 + 탭 = 56 + 47 = 103*/
36+
/* 네비게이션 + 탭 = 56 + 47 = 103 */
4937
/* 추가 42 */
5038
padding-top: 145px;
5139
margin-top: -103px;

src/app/university/[id]/college-detail.module.css

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
height: 67vw;
1616
max-height: 400px;
1717
}
18-
.imageWrapper::before {
18+
19+
/* .imageWrapper::before {
1920
content: "";
2021
position: absolute;
2122
top: 0;
@@ -24,29 +25,4 @@
2425
bottom: 0;
2526
background: linear-gradient(180deg, rgba(0, 0, 0, 0) 33.85%, rgba(0, 0, 0, 0.6) 86.98%);
2627
z-index: 1;
27-
}
28-
.image {
29-
width: 100%;
30-
height: 100%;
31-
object-fit: cover;
32-
}
33-
34-
/* .title {
35-
position: static;
36-
z-index: -1;
37-
margin-left: 30px;
38-
margin-top: calc(100vw / 2 - 58px);
39-
40-
color: #000;
41-
font-family: Pretendard;
42-
font-size: 32px;
43-
font-style: normal;
44-
font-weight: 600;
45-
line-height: normal;
46-
}
47-
48-
@media (min-width: 600px) {
49-
.title {
50-
margin-top: 242px;
51-
}
5228
} */

src/app/university/[id]/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ const CollegeDetailPage = async ({ params }: CollegeDetailPageProps) => {
6666
<title>{convertedKoreanName || "대학명"}</title>
6767
</Head>
6868
<TopDetailNavigation title={convertedKoreanName || "대학명"} />
69-
<CollegeDetail imageUrl={collegeData.backgroundImageUrl} name={convertedKoreanName || "대학명"} />
69+
<CollegeDetail imageUrl={collegeData.backgroundImageUrl} />
7070
<CollegeBottomSheet
7171
collegeId={collegeId}
7272
university={collegeData}

tailwind.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ const config: Config = {
5050
},
5151
k: {
5252
"0": "#FFFFFF",
53-
"50": "#EFEFF0",
53+
"50": "#F5F5F5",
5454
"100": "#DDDDDF",
5555
"200": "#C6C7C9",
5656
"300": "#AAACAF",

0 commit comments

Comments
 (0)