Skip to content

Commit b854b44

Browse files
authored
Merge pull request #344 from checkmo2025/style-342
[style] 책 기본 이미지 추가+헤더 호버 추가
2 parents ff8c8fe + b621353 commit b854b44

8 files changed

Lines changed: 42 additions & 38 deletions

File tree

26.3 KB
Loading

src/components/Header.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ const Header = ({
152152
{/* 프로필 */}
153153
<div
154154
onClick={() => navigate("/mypage")}
155-
className="flex gap-2 md:gap-3 items-center min-w-0 cursor-pointer"
155+
className="flex gap-2 md:gap-3 items-center min-w-0 cursor-pointer rounded-[8px] hover:bg-[#EEEEEE] px-3 py-2"
156156
>
157157
<div className="w-10 h-10 rounded-full shrink-0 overflow-hidden bg-white flex items-center justify-center">
158158
{me?.profileImageUrl ? (

src/pages/Auth/ProfilePage.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ const ProfilePage = () => {
1919
const isLoggedIn = Boolean(localStorage.getItem("nickname"));
2020
const blockedPaths = ["/", "/signup", "/profile"];
2121

22+
// /profile 주소 직접 접근 차단
23+
if (location.pathname === "/profile") {
24+
navigate("/", { replace: true });
25+
return;
26+
}
27+
2228
if (isLoggedIn && blockedPaths.includes(location.pathname)) {
2329
(async () => {
2430
try {
@@ -356,7 +362,7 @@ const ProfilePage = () => {
356362
{/* 소개 */}
357363
<div className="mb-5">
358364
<label className="block mb-1 text-[#2C2C2C] font-semibold">
359-
소개
365+
소개 (20자 이내)
360366
</label>
361367
<input
362368
type="text"

src/pages/Main/Info/My/MyGroupPage.tsx

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -132,20 +132,20 @@ const MyGroupPage = () => {
132132
>
133133
<div className="flex gap-4 md:gap-6">
134134
<div className="bg-gray-200 rounded-[16px] overflow-hidden w-[80px] h-[100px] md:w-[119px] md:h-[119px] flex-shrink-0 flex items-center justify-center">
135-
{!isErrorImage ? (
136-
<img
137-
src={imgUrl!}
138-
alt={group.name}
139-
className="w-full h-full object-cover"
140-
onError={() =>
141-
setErrorImages((prev) => ({ ...prev, [group.clubId]: true }))
142-
}
143-
/>
144-
) : (
145-
<div className="w-full h-full flex items-center justify-center text-gray-400 text-sm">
146-
No Image
147-
</div>
148-
)}
135+
<img
136+
src={
137+
!isErrorImage
138+
? imgUrl!
139+
: "/assets/basic_bookclub_image.png"
140+
}
141+
alt={group.name}
142+
className="w-full h-full object-cover"
143+
loading="lazy"
144+
onError={(e) => {
145+
e.currentTarget.src = "/assets/basic_bookclub_image.png";
146+
setErrorImages((prev) => ({ ...prev, [group.clubId]: true }));
147+
}}
148+
/>
149149
</div>
150150

151151
<div className="flex flex-col justify-between">

src/pages/Main/Info/My/MyHomePage.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const MyPage = () => {
3636
case "LIKE":
3737
return `${item.senderNickname} 님이 내 책이야기에 좋아요를 눌렀습니다.`;
3838
case "FOLLOW":
39-
return `${item.targetName}이 팔로잉을 시작했습니다.`;
39+
return `${item.targetName}님이 구독했습니다.`;
4040
case "JOIN_CLUB":
4141
return `${item.targetName}에 가입되셨습니다.`;
4242
default:
@@ -170,7 +170,7 @@ const MyPage = () => {
170170
{list.slice(0, 5).map((member) => (
171171
<div
172172
key={`${label}-${member.nickname}`}
173-
className="bg-[#F4F2F1] rounded-lg px-3 py-3 mb-3 flex items-center gap-2 cursor-pointer hover:bg-[#FAFAFA]"
173+
className="bg-[#F4F2F1] rounded-lg px-3 py-3 mb-3 flex items-center gap-2 cursor-pointer hover:bg-[#EEEEEE]"
174174
onClick={() =>
175175
navigate(`/info/others/${member.nickname}`)
176176
}

src/pages/Main/Info/My/MyNotificationPage.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -232,11 +232,7 @@ const MyNotificationPage = () => {
232232
isOpen={showSettingModal}
233233
title={
234234
<>
235-
알림 설정
236-
<br />
237-
<span className="text-sm text-[#2C2C2C]">
238-
알림 설정 기능은 추후 개발 예정입니다.
239-
</span>
235+
알림 설정은 추후 개발 예정입니다.
240236
</>
241237
}
242238
buttons={[

src/pages/Main/Info/My/MyStoryPage.tsx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,13 +174,18 @@ const MyStoryPage = () => {
174174
src={story.bookInfo.imgUrl}
175175
alt={story.bookInfo.title || "책 이미지"}
176176
className="w-[176px] h-[248px] rounded-md object-cover flex-shrink-0"
177+
loading="lazy"
177178
onError={(e) => {
178-
e.currentTarget.src = "";
179-
e.currentTarget.style.display = "none";
179+
e.currentTarget.src = "/assets/basic_book_image.png";
180180
}}
181181
/>
182182
) : (
183-
<div className="w-[176px] h-[248px] bg-gray-200 rounded-md flex-shrink-0" />
183+
<img
184+
src="/assets/basic_book_image.png"
185+
alt="기본 책 이미지"
186+
className="w-[176px] h-[248px] rounded-md object-cover flex-shrink-0"
187+
loading="lazy"
188+
/>
184189
)}
185190

186191
<div className="flex flex-col justify-between flex-1">
@@ -310,4 +315,4 @@ const MyStoryPage = () => {
310315
);
311316
};
312317

313-
export default MyStoryPage;
318+
export default MyStoryPage;

src/pages/Main/Info/OthersProfilePage.tsx

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,6 @@ const OthersProfilePage = () => {
108108
src="/assets/basic_profile.png"
109109
alt="기본 프로필"
110110
className="w-[40px] h-[40px] rounded-full bg-white object-cover scale-110"
111-
onError={(e) => {
112-
e.currentTarget.src = "/assets/basic_profile.png";
113-
}}
114111
/>
115112
)}
116113
<p className="text-[18px] font-semibold text-[#2C2C2C]">
@@ -158,19 +155,22 @@ const OthersProfilePage = () => {
158155
className="flex bg-white rounded-[12px] border border-[#EAE5E2] p-6 transition-transform duration-300 transform hover:shadow-lg hover:scale-103 cursor-pointer"
159156
onClick={() => navigate(`/bookstory/${book.bookStoryId}/detail`)}
160157
>
161-
{/* 책 이미지 */}
158+
{/* 책 이미지 (기본 이미지 적용) */}
162159
{book.bookInfo?.imgUrl ? (
163160
<img
164161
src={book.bookInfo.imgUrl}
165162
alt={book.bookInfo.title}
166163
className="w-[176px] h-[248px] rounded-[16px] object-cover flex-shrink-0"
167164
onError={(e) => {
168-
e.currentTarget.src = "";
169-
e.currentTarget.style.display = "none";
165+
e.currentTarget.src = "/assets/basic_book_image.png"; // 기본 책 이미지
170166
}}
171167
/>
172168
) : (
173-
<div className="w-[176px] h-[248px] bg-[#E0E0E0] rounded-[16px] flex-shrink-0" />
169+
<img
170+
src="/assets/basic_book_image.png"
171+
alt="기본 책 이미지"
172+
className="w-[176px] h-[248px] rounded-[16px] object-cover flex-shrink-0"
173+
/>
174174
)}
175175

176176
<div className="flex flex-col justify-between ml-6 w-full">
@@ -190,9 +190,6 @@ const OthersProfilePage = () => {
190190
src="/assets/basic_profile.png"
191191
alt="기본 프로필"
192192
className="w-[24px] h-[24px] rounded-full bg-white object-cover scale-110"
193-
onError={(e) => {
194-
e.currentTarget.src = "/assets/basic_profile.png";
195-
}}
196193
/>
197194
)}
198195
<p className="text-[14px] text-[#8D8D8D]">
@@ -294,4 +291,4 @@ const OthersProfilePage = () => {
294291
);
295292
};
296293

297-
export default OthersProfilePage;
294+
export default OthersProfilePage;

0 commit comments

Comments
 (0)