Skip to content
Merged
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
2 changes: 1 addition & 1 deletion src/components/views/Header/Header.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ const Header = ({ headerProps }) => {
<Modal
setIsOpen={setIsOpen}
handleCancel={handleCancel}
title={TEXT.cartModal.split("\n").map((line, index) => (
title={TEXT.cartModal.split("\n")?.map((line, index) => (
<React.Fragment key={index}>
{line}
<br />
Expand Down
2 changes: 1 addition & 1 deletion src/components/views/Home/Banner/Banner.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const Banner = () => {
<div className="home_event">
<div className="home_event_slider_benner_wrapper">
<Slider {...settings} >
{eventBanners.map((item) => {
{eventBanners?.map((item) => {
return (
<div
className="home_event_slider_benner"
Expand Down
2 changes: 1 addition & 1 deletion src/components/views/ProgressBar/ProgressBar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const Progressbar = ({ degree }) => {
</div>
</div>
<div className="status-explain-wrapper">
{statusList.map((e, i) => (
{statusList?.map((e, i) => (
<div
key={i}
className={`status-explain ${i <= degree ? "selected" : ""}`}
Expand Down
8 changes: 4 additions & 4 deletions src/components/views/StoreList/StoreList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ const StoreList = ({ searchTerm = "", cafe = false, booth = false }) => {
if (cafe && booth) {
displayStores = stores;
} else if (cafe) {
displayStores = stores.filter((item) => item.idx < 10);
displayStores = stores?.filter((item) => item.idx < 10);
} else if (booth) {
displayStores = stores.filter((item) => item.idx >= 10);
displayStores = stores?.filter((item) => item.idx >= 10);
}

// 검색어에 따라 필터링된 목록을 반환하는 로직
const filteredStores = stores.filter((item) => {
const filteredStores = stores?.filter((item) => {
return item.name.toLowerCase().includes(searchTerm.toLowerCase());
});

Expand All @@ -27,7 +27,7 @@ const StoreList = ({ searchTerm = "", cafe = false, booth = false }) => {

return (
<div className="store_list">
{displayStores.map((item) => (
{displayStores?.map((item) => (
<div
key={item.idx}
className="store_list_item"
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useDeleteCartItem.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const useDeleteCartItem = () => {
});

// 로컬 상태 갱신
const updatedCarts = paymentData.carts.filter(
const updatedCarts = paymentData.carts?.filter(
(cartItem) => cartItem.idx !== itemId
);
setPaymentData({ ...paymentData, carts: updatedCarts });
Expand Down
10 changes: 5 additions & 5 deletions src/pages/CartPage/CartPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const CartPage = () => {

const handleDecrease = (item) => {
if (item?.count > 1) {
const updatedCarts = paymentData.carts.map((cartItem) =>
const updatedCarts = paymentData.carts?.map((cartItem) =>
cartItem.idx === item.idx
? { ...cartItem, count: cartItem?.count - 1 }
: cartItem
Expand All @@ -38,7 +38,7 @@ const CartPage = () => {
};

const handleIncrease = (item) => {
const updatedCarts = paymentData.carts.map((cartItem) =>
const updatedCarts = paymentData.carts?.map((cartItem) =>
cartItem.idx === item.idx
? { ...cartItem, count: cartItem?.count + 1 }
: cartItem
Expand All @@ -61,7 +61,7 @@ const CartPage = () => {
});

// 로컬 상태 및 렌더링 갱신
const updatedCarts = paymentData.carts.filter(
const updatedCarts = paymentData.carts?.filter(
(cartItem) => cartItem.idx !== itemId
);
setPaymentData({ ...paymentData, carts: updatedCarts });
Expand Down Expand Up @@ -180,7 +180,7 @@ const CartPage = () => {
</div>

<div className="cart-page__order-info">
{paymentData?.carts.map((item) => (
{paymentData?.carts?.map((item) => (
<div>
<div className="cart-page__order-info__item">
<img
Expand All @@ -195,7 +195,7 @@ const CartPage = () => {
</div>

<div className="cart-page__order-info__item__option">
{item.options.map((option) => (
{item.options?.map((option) => (
<div key={option.optionId}>
•[{option.categoryName}] {option.name} (+
{option.price
Expand Down
2 changes: 1 addition & 1 deletion src/pages/CouponPage/CouponPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const CouponPage = () => {
</div>
) : coupons && coupons.length > 0 ? (
<div className="coupon-page__coupon-list">
{coupons.map((item) => (
{coupons?.map((item) => (
<div
className="coupon-page__coupon-item"
key={item.couponId}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/HomePage/Homepage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ const HomePage = () => {

<div className="home_individual_quick_order_container">
{quickOrder.length > 0 ? (
quickOrder.map((item, index) => (
quickOrder?.map((item, index) => (
<div
className={`home_individual_quick_order_list ${
index === 0 ? "first-item" : ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function FrequentlyAskedQuestionPage() {
/>
<main className="faq-container">
<div className="faq-box">
{TEXT.faqQuestionTitle.split("\n").map((title, index) => (
{TEXT.faqQuestionTitle.split("\n")?.map((title, index) => (
<React.Fragment key={index}>
<span className="faq-title">{title}</span>
<br />
Expand All @@ -25,7 +25,7 @@ function FrequentlyAskedQuestionPage() {
{TEXT.faqQuestion
.split("#")
[index].split("\n")
.map((e, i) =>
?.map((e, i) =>
e.trim().startsWith("-") ? (
<li key={i}>{e.trim().slice(1)}</li>
) : (
Expand Down
2 changes: 1 addition & 1 deletion src/pages/MembershipPage/MembershipPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function MembershipPage() {
<span>멤버십 내역</span>
</div>
{pointHistory?.length ? (
pointHistory.map((e, i) => (
pointHistory?.map((e, i) => (
// {/* 매핑될 요소 */}
<div
className="membershippage-use-point-box-content"
Expand Down
2 changes: 1 addition & 1 deletion src/pages/MyPage/EventingPage/EventingPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function EventingPage() {
{events && events?.length > 0 ? (
<div className="eventing-img">
<Slider className="eventing_slider_benner" {...settings}>
{events.map((item) => (
{events?.map((item) => (
<div key={item} onClick={() => navigate(item.redirectUrl)}>
<img src={item.imgUrl} alt="eventing" />
{console.log(item)}
Expand Down
4 changes: 2 additions & 2 deletions src/pages/MyPage/PolicyPage/PositionpolicyPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function PositionpolicyPage() {
}}
/>

{TEXT.positionPolicyTitle.split("\n").map((title, index) => (
{TEXT.positionPolicyTitle.split("\n")?.map((title, index) => (
<React.Fragment key={index}>
<span
style={{ fontSize: "14px", fontFamily: "Bold", marginTop: "5px" }}
Expand All @@ -27,7 +27,7 @@ function PositionpolicyPage() {
{TEXT.positionPolicy
.split("#")
[index].split("\n")
.map((e) => (
?.map((e) => (
<div>{e}</div>
))}
</span>
Expand Down
4 changes: 2 additions & 2 deletions src/pages/MyPage/PolicyPage/PrivacypolicyPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function PrivacypolicyPage() {
}}
/>

{TEXT.privacyPolicyTitle.split("\n").map((title, index) => (
{TEXT.privacyPolicyTitle.split("\n")?.map((title, index) => (
<React.Fragment key={index}>
<span
style={{
Expand All @@ -32,7 +32,7 @@ function PrivacypolicyPage() {
{TEXT.privacyPolicy
.split("#")
[index].split("\n")
.map((e) => (
?.map((e) => (
<div>{e}</div>
))}
</span>
Expand Down
4 changes: 2 additions & 2 deletions src/pages/MyPage/PolicyPage/TermsofusePage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function TermsofusePage() {
// linkTo: "/policy",
}}
/>
{TEXT.tuermsoTitle.split("\n").map((title, index) => (
{TEXT.tuermsoTitle.split("\n")?.map((title, index) => (
<React.Fragment key={index}>
<span
style={{ fontSize: "14px", fontFamily: "Bold", marginTop: "5px" }}
Expand All @@ -26,7 +26,7 @@ function TermsofusePage() {
{TEXT.termsofuse
.split("#")
[index].split("\n")
.map((e) => (
?.map((e) => (
<div>{e}</div>
))}
</span>
Expand Down
4 changes: 2 additions & 2 deletions src/pages/MyPage/PolicyPage/ThirdpartyPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function ThirdpartyPage() {
}}
/>
<div style={{ fontSize: "12px", fontFamily: "Regular" }}>
{TEXT.thirdPartyTitle.split("\n").map((title, index) => (
{TEXT.thirdPartyTitle.split("\n")?.map((title, index) => (
<React.Fragment key={index}>
<span
style={{ fontSize: "14px", fontFamily: "Bold", marginTop: "5px" }}
Expand All @@ -27,7 +27,7 @@ function ThirdpartyPage() {
{TEXT.thirdParty
.split("#")
[index].split("\n")
.map((e) => (
?.map((e) => (
<div>{e}</div>
))}
</span>
Expand Down
26 changes: 13 additions & 13 deletions src/pages/OrderProcessPage/OrderProcessPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const OrderProcessPage = () => {
const [isOpen, setIsOpen] = useState(false);
const [modalTitle, setModalTitle] = useState("");
const [activeToggles, setActiveToggles] = useState(
category?.filter((el) => el?.essential).map(() => false)
category?.filter((el) => el?.essential)?.map(() => false)
);
const [selectedRadioTexts, setSelectedRadioTexts] = useState([]);
const [totalAmount, setTotalAmount] = useState(price);
Expand All @@ -43,7 +43,7 @@ const OrderProcessPage = () => {

const handleCartUpdate = () => {
// 주점 포장/매장 옵션 선택 여부 확인
const pickupIdx = category.filter((item) => item.name === "포장/매장")[0]?.options[0]?.idx;
const pickupIdx = category?.filter((item) => item.name === "포장/매장")[0]?.options[0]?.idx;
console.log(pickupIdx, essentialOptionIdx);
if (pickupIdx && essentialOptionIdx.includes(pickupIdx)) {
setIsBoothOpen(true);
Expand Down Expand Up @@ -164,7 +164,7 @@ const OrderProcessPage = () => {
: setTotalAmount((prevAmount) => prevAmount - price);
e.target.checked
? setOptionIdx((prev) => [...prev, idx])
: setOptionIdx((prev) => prev.filter((e) => e !== idx));
: setOptionIdx((prev) => prev?.filter((e) => e !== idx));
};

// 수량 증가
Expand All @@ -182,8 +182,8 @@ const OrderProcessPage = () => {
useEffect(() => {
if (category && category.length > 0) {
const essentialOptions = category
.filter((el) => el?.essential)
.map((e) => e.options[0]?.name);
?.filter((el) => el?.essential)
?.map((e) => e.options[0]?.name);

setSelectedRadioTexts(essentialOptions);
}
Expand All @@ -194,7 +194,7 @@ const OrderProcessPage = () => {
parseInt(
category
?.filter((el) => el?.essential)
.map((e) => parseInt(e?.options[0]?.price))
?.map((e) => parseInt(e?.options[0]?.price))
.reduce((prev, curr) => prev + curr, 0)
)
);
Expand All @@ -212,7 +212,7 @@ const OrderProcessPage = () => {
}, [category]);

useEffect(() => {
setActiveToggles(category?.filter((e) => e?.essential).map(() => false));
setActiveToggles(category?.filter((e) => e?.essential)?.map(() => false));
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [price])

Expand All @@ -236,8 +236,8 @@ const OrderProcessPage = () => {
<div className="order-process-page__toggle">
{category?.length ? (
category
.filter((c, i) => c?.essential)
.map((category, index) => (
?.filter((c, i) => c?.essential)
?.map((category, index) => (
<div
className="order-process-page__toggle__container"
key={index}
Expand Down Expand Up @@ -350,8 +350,8 @@ const OrderProcessPage = () => {
{optionOpen &&
category?.length &&
category
.filter((c, i) => !c.essential)
.map((category, index) => (
?.filter((c, i) => !c.essential)
?.map((category, index) => (
<React.Fragment key={index}>
{index !== 0 && <div className="option__line"></div>}
<span className="order-process-page__option__title__wrapper">
Expand Down Expand Up @@ -455,7 +455,7 @@ const OrderProcessPage = () => {
<Modal
setIsOpen={setIsOpen}
handleCancel={handleCancel}
title={modalTitle.split("\n").map((line, index) => (
title={modalTitle.split("\n")?.map((line, index) => (
<React.Fragment key={index}>
{line}
<br />
Expand All @@ -470,7 +470,7 @@ const OrderProcessPage = () => {
<Modal
setIsOpen={setIsBoothOpen}
handleCancel={() => setIsBoothOpen(false)}
title={boothModalTitle.map((line, index) => (
title={boothModalTitle?.map((line, index) => (
<React.Fragment key={index}>
{line}
<br />
Expand Down
4 changes: 2 additions & 2 deletions src/pages/PaymentPage/PaymentPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ const PaymentPage = () => {
</div>

<div className="payment-page__order-info">
{carts.map((item) => (
{carts?.map((item) => (
<div>
<div className="payment-page__order-info__item">
<img
Expand All @@ -117,7 +117,7 @@ const PaymentPage = () => {
</div>

<div className="payment-page__order-info__item__option">
{item.options.map((option) => (
{item.options?.map((option) => (
<div>
•{option.name} (+{option.price}원)
</div>
Expand Down
6 changes: 3 additions & 3 deletions src/pages/StoreDetailPage/StoreDetailPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ const StoreDetailPage = () => {
<span className="store-detail-page__caffeeInfo__list__title">
영업 시간
</span>
{openTime.split("\n").map((line, index) => (
{openTime.split("\n")?.map((line, index) => (
<React.Fragment key={index}>
{line}
<br />
Expand All @@ -98,7 +98,7 @@ const StoreDetailPage = () => {

<div className="store-detail-page__menuCategory-scroll">
{menu && menu.menu && Array.isArray(menu.menu) ? (
menu.menu.map((category, index) => (
menu.menu?.map((category, index) => (
<span
key={index}
className={`store-detail-page__menuCategory__item ${
Expand Down Expand Up @@ -130,7 +130,7 @@ const StoreDetailPage = () => {
{selectedCategory &&
selectedCategory.menuItems &&
Array.isArray(selectedCategory.menuItems) ? (
selectedCategory.menuItems.map((item, index) => (
selectedCategory.menuItems?.map((item, index) => (
<div
className="store-detail-page__menuList__item"
key={index}
Expand Down
Loading