Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 89 additions & 0 deletions dev-dist/sw.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
/**
* Copyright 2018 Google Inc. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

// If the loader is already loaded, just stop.
if (!self.define) {
let registry = {};

// Used for `eval` and `importScripts` where we can't get script URL by other means.
// In both cases, it's safe to use a global var because those functions are synchronous.
let nextDefineUri;

const singleRequire = (uri, parentUri) => {
uri = new URL(uri + ".js", parentUri).href;
return registry[uri] || (

new Promise(resolve => {
if ("document" in self) {
const script = document.createElement("script");
script.src = uri;
script.onload = resolve;
document.head.appendChild(script);
} else {
nextDefineUri = uri;
importScripts(uri);
resolve();
}
})

.then(() => {
let promise = registry[uri];
if (!promise) {
throw new Error(`Module ${uri} didn’t register its module`);
}
return promise;
})
);
};

self.define = (depsNames, factory) => {
const uri = nextDefineUri || ("document" in self ? document.currentScript.src : "") || location.href;
if (registry[uri]) {
// Module is already loading or loaded.
return;
}
let exports = {};
const require = depUri => singleRequire(depUri, uri);
const specialDeps = {
module: { uri },
exports,
require
};
registry[uri] = Promise.all(depsNames.map(
depName => specialDeps[depName] || require(depName)
)).then(deps => {
factory(...deps);
return exports;
});
};
}
define(['./workbox-5a5d9309'], (function (workbox) { 'use strict';

self.skipWaiting();
workbox.clientsClaim();

/**
* The precacheAndRoute() method efficiently caches and responds to
* requests for URLs in the manifest.
* See https://goo.gl/S9QRab
*/
workbox.precacheAndRoute([{
"url": "index.html",
"revision": "0.0260f7p30q8"
}], {});
workbox.cleanupOutdatedCaches();
workbox.registerRoute(new workbox.NavigationRoute(workbox.createHandlerBoundToURL("index.html"), {
allowlist: [/^\/$/]
}));

}));
2 changes: 1 addition & 1 deletion src/assets/icons/Menu.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
59 changes: 25 additions & 34 deletions src/components/home/EventList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import useCustomFetch from "../../utils/hooks/useCustomFetch";

import Bookmark from "../../assets/icons/Bookmark.svg?react";
import BookmarkOL from "../../assets/icons/BookmarkOL.svg?react";

export default function EventList({
id,
title,
Expand All @@ -14,39 +13,31 @@ export default function EventList({
onClick,
onScrapClick,
}) {
{
const { fetchData } = useCustomFetch();

const handleScrapClick = () => {
onScrapClick(id, scraped, fetchData);
};

return (
<Component>
<Container>
<img src={poster} alt={title} onClick={onClick} />
<TextArea onClick={onClick}>
<div className="titleBox">{title}</div>
<p>{place}</p>
<p>{date}</p>
</TextArea>
<BookmarkWrapper
onClick={(e) => {
e.stopPropagation();
handleScrapClick();
}}
>
{scraped ? (
<GreenBookmark width={24} height={24} />
) : (
<GreenBookmarkOL width={24} height={24} />
)}
</BookmarkWrapper>
</Container>
<Br />
</Component>
);
}
return (
<Component>
<Container>
<img src={poster} alt={title} onClick={onClick} />
<TextArea onClick={onClick}>
<div className="titleBox">{title}</div>
<p>{place}</p>
<p>{date}</p>
</TextArea>
<BookmarkWrapper
onClick={(e) => {
e.stopPropagation(); // 1. 상세 페이지 이동(카드 클릭) 방지
onScrapClick(); // 2. 부모의 스크랩 함수만 깔끔하게 실행
}}
>
{scraped ? (
<GreenBookmark width={24} height={24} />
) : (
<GreenBookmarkOL width={24} height={24} />
)}
</BookmarkWrapper>
</Container>
<Br />
</Component>
);
}

const GreenBookmark = styled(Bookmark)`
Expand Down
2 changes: 1 addition & 1 deletion src/components/menu/MenuTrigger.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import styled from "styled-components";
import { useMenu } from "./MenuProvider.jsx";
import MenuSvg from "../../assets/icons/Menu.svg?react"; // 기본(흰색)
import HamburgerSvg from "../../assets/icons/HamburgerMenu.svg?react"; // 검정색
import { useMenu } from "./MenuProvider.jsx";

export default function MenuTrigger({
size = 24,
Expand Down
10 changes: 9 additions & 1 deletion src/pages/Detail.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ export default function Detail() {
</div>
{exhibition.dateException && (
<div className="div">
<MenuIcon width={18} height={18} color="#57B190" alt="예외사항" />
<StyledMenuIcon alt="예외사항" />
<p className="p">{exhibition.dateException}</p>
</div>
)}
Expand Down Expand Up @@ -890,3 +890,11 @@ const AutoHeightTextarea = styled.textarea`
color: ${({ theme }) => theme.colors.gray6};
}
`;

const StyledMenuIcon = styled(MenuIcon)`
width: 18px;
height: 18px;
path {
stroke: #57b190;
}
`;
5 changes: 2 additions & 3 deletions src/pages/Home.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,18 +77,17 @@ export default function Home() {
}

try {
// fetchData(여기서는 axiosInstance)를 전달
const success = await toggleScrap(fetchData, id, scraped);

if (success) {
window.location.reload();
} else {
console.error("스크랩 실패");
alert("스크랩 처리에 실패했습니다.");
}
} catch (err) {
console.error("에러 발생:", err);
}
};

return (
<Container>
{showLoginModal && (
Expand Down
2 changes: 0 additions & 2 deletions src/pages/enrollEvent/EnrollEvent.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,6 @@ export default function EnrollEvent() {
images: formattedImages,
};

console.log("🚀 전송 데이터:", body);

try {
const res = await createExhibition(body);

Expand Down
19 changes: 12 additions & 7 deletions src/pages/enrollEvent/EnrollStepOne.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,14 @@ function EnrollStepOne({ data, setData, setIsNextActive }) {
};

//전시 수정 (추가)

useEffect(() => {
if (data.link) {
setNoTicket(false);
} else if (data.link === "") {
setNoTicket(true);
}
}, []);
// 가격
setIsFree(data.price === "무료");

// 링크
setNoTicket(!data.link || data.link === "");
}, [data.price, data.link]);
//입력값 검사
useEffect(() => {
const safeStr = (val) => String(val || "").trim();
Expand Down Expand Up @@ -256,19 +257,23 @@ function EnrollStepOne({ data, setData, setIsNextActive }) {
{/* 예매 링크 */}
<Section>
<Label>예매 링크 *</Label>

<CheckBoxArea>
<CustomCheckbox
checked={noTicket}
onChange={(checked) => {
setNoTicket(checked);

update("link", checked ? "" : data.link);
}}
/>

<span>예매 필요 없음 (자유 입장) </span>
</CheckBoxArea>

{!noTicket && (
<InputBox
value={data.link || ""}
value={data.link}
onChange={(v) => update("link", v)}
textAlign="right"
/>
Expand Down