Skip to content

Commit 33be504

Browse files
Merge pull request #90 from SSASINSA/refactor/sprint-fix(#68)
#68/디자인 최종 수정
2 parents 32db2fd + a946755 commit 33be504

3 files changed

Lines changed: 35 additions & 22 deletions

File tree

src/components/common/PageHeader/PageHeader.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ interface PageHeaderProps {
1111
rightSlot?: React.ReactNode;
1212
}
1313

14-
const HIDE_BACK_ON: string[] = ["/", "/events", "/posts", "/store", "/repair", "/approval", "/events/approval"];
14+
const HIDE_BACK_ON: string[] = ["/", "/events", "/posts", "/store", "/store/orders", "/repair", "/users", "/approval", "/events/approval", "/admin-users"];
1515

1616
const PageHeader: React.FC<PageHeaderProps> = ({ title, subtitle, rightSlot }) => {
1717
const navigate = useNavigate();

src/components/layout/Navigation/Navigation.tsx

Lines changed: 33 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,9 @@ const Navigation: React.FC = () => {
119119
const newStates: Record<string, boolean> = {};
120120
navDropdowns.forEach((dropdown) => {
121121
const isActive = dropdown.pathMatchers.some((matcher) => {
122-
if (matcher.includes("/store/")) {
123-
return location.pathname.startsWith("/store");
122+
if (matcher === "/store") {
123+
return location.pathname === "/store" ||
124+
(location.pathname.startsWith("/store/") && location.pathname !== "/store/orders");
124125
}
125126
return location.pathname === matcher || location.pathname.startsWith(matcher + "/");
126127
});
@@ -148,26 +149,33 @@ const Navigation: React.FC = () => {
148149
</div>
149150
<nav className={styles["sidebar-nav"]}>
150151
<ul>
151-
{!isRoleLoading && filteredNavItems.map((item) => (
152-
<li key={item.path} className={location.pathname === item.path ? styles["active"] : ""}>
153-
<Link to={item.path} className={styles["nav-item"]}>
154-
{item.icon.startsWith("/") ? (
155-
<img src={item.icon} alt="" />
156-
) : (
157-
<span className={styles["emoji-icon"]}>{item.icon}</span>
158-
)}
159-
<span>{item.label}</span>
160-
</Link>
161-
</li>
162-
))}
152+
{!isRoleLoading && filteredNavItems.map((item) => {
153+
const isActive = location.pathname === item.path ||
154+
(item.path !== "/" && location.pathname.startsWith(item.path + "/"));
155+
156+
return (
157+
<li key={item.path} className={isActive ? styles["active"] : ""}>
158+
<Link to={item.path} className={styles["nav-item"]}>
159+
{item.icon.startsWith("/") ? (
160+
<img src={item.icon} alt="" />
161+
) : (
162+
<span className={styles["emoji-icon"]}>{item.icon}</span>
163+
)}
164+
<span>{item.label}</span>
165+
</Link>
166+
</li>
167+
);
168+
})}
163169
{!isRoleLoading &&
164170
filteredDropdowns.map((dropdown) => {
165171
const isOpen = dropdownStates[dropdown.openStateKey];
166172
const isActive = dropdown.items.some((item) => {
167173
if (item.path === "/store") {
168-
return location.pathname === "/store" || (location.pathname.startsWith("/store/") && location.pathname !== "/store/orders");
174+
return location.pathname === "/store" ||
175+
(location.pathname.startsWith("/store/") && location.pathname !== "/store/orders");
169176
}
170-
return location.pathname === item.path || location.pathname.startsWith(item.path + "/");
177+
return location.pathname === item.path ||
178+
location.pathname.startsWith(item.path + "/");
171179
});
172180

173181
return (
@@ -182,10 +190,15 @@ const Navigation: React.FC = () => {
182190
</button>
183191
<ul className={styles["nav-dropdown-menu"]}>
184192
{dropdown.items.map((item) => {
185-
const itemIsActive =
186-
item.path === "/store"
187-
? location.pathname === "/store" || (location.pathname.startsWith("/store/") && location.pathname !== "/store/orders")
188-
: location.pathname === item.path || location.pathname.startsWith(item.path + "/");
193+
let itemIsActive: boolean;
194+
195+
if (item.path === "/store") {
196+
itemIsActive = location.pathname === "/store" ||
197+
(location.pathname.startsWith("/store/") && location.pathname !== "/store/orders");
198+
} else {
199+
itemIsActive = location.pathname === item.path ||
200+
location.pathname.startsWith(item.path + "/");
201+
}
189202

190203
return (
191204
<li key={item.path} className={itemIsActive ? styles["active"] : ""}>

src/components/pages/store/StoreManagement/StoreManagement.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ const StoreManagement: React.FC = () => {
265265
<div className={styles["admin-dashboard"]}>
266266
<main className={styles["main-content"]}>
267267
<PageHeader
268-
title="크레딧 상점 관리"
268+
title="상품 관리"
269269
subtitle="등록된 상품을 관리하고 새로운 상품을 추가하세요"
270270
rightSlot={
271271
<button className={styles["add-product-btn"]} onClick={() => navigate("/store/add")}>

0 commit comments

Comments
 (0)