Skip to content

Commit

Permalink
Merge pull request #675 from sparcs-kaist/dev
Browse files Browse the repository at this point in the history
Main branch update from Dev branch
  • Loading branch information
14KGun authored Sep 26, 2023
2 parents 3e9611d + 57612b2 commit cbd4abf
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 20 deletions.
2 changes: 1 addition & 1 deletion src/components/Header/HeaderWithLeftNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const HeaderWithLeftNav = ({ value, options = [] }: HeaderWithLeftNavProps) => (
<div css={{ display: "flex", gap: "16px" }}>
<div css={{ flexGrow: 1 }} />
{options.map(({ value: _value, label, to }) => (
<Link key={label} to={to} css={{ textDecoration: "none" }}>
<Link key={label} to={to} css={{ textDecoration: "none" }} replace>
<ButtonNav key={label} selected={_value === value}>
{label}
</ButtonNav>
Expand Down
4 changes: 2 additions & 2 deletions src/components/ModalPopup/ModalEvent2023FallItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,11 @@ const ModalEvent2023FallItem = ({
eventMode !== "2023fall"
? [true, "์ด๋ฒคํŠธ ๊ธฐ๊ฐ„์ด ์•„๋‹™๋‹ˆ๋‹ค"]
: itemInfo.stock <= 0
? [true, "๋งค์ง„๋œ ์ƒํ’ˆ์€ ๊ตฌ๋งคํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค"]
? [true, "๋งค์ง„๋œ ์ƒํ’ˆ์ž…๋‹ˆ๋‹ค"]
: !event2023FallInfo || !isLogin
? [true, "๋กœ๊ทธ์ธ ํ›„ ๊ตฌ๋งค๊ฐ€ ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค"]
: event2023FallInfo.creditAmount < itemInfo.price
? [true, "์†กํŽธ์ด ๋ถ€์กฑํ•˜์—ฌ ๊ตฌ๋งคํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค"]
? [true, "์†กํŽธ์ด ๋ถ€์กฑํ•ฉ๋‹ˆ๋‹ค"]
: [false, "๊ตฌ๋งคํ•˜๊ธฐ"],
[eventMode, event2023FallInfo, itemInfo]
);
Expand Down
13 changes: 12 additions & 1 deletion src/components/ModalPopup/ModalEvent2023FallItemInstagram.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ type ModalEvent2023FallItemInstagramProps = { item?: EventItem } & Parameters<
typeof Modal
>[0];

const Background = () => (
<div css={{ position: "absolute", top: "20%", left: 0, bottom: 0, right: 0 }}>
<div className="c2023fallevent-before"></div>
<div className="c2023fallevent-after"></div>
</div>
);

const ModalEvent2023FallItemInstagram = ({
item,
...modalProps
Expand All @@ -43,7 +50,11 @@ const ModalEvent2023FallItemInstagram = ({
};

return (
<Modal padding="16px 12px 12px" {...modalProps}>
<Modal
padding="16px 12px 12px"
backgroundChildren={<Background />}
{...modalProps}
>
<div css={styleTitle}>
<ShareRoundedIcon style={styleIcon} />
์ธ์Šคํƒ€๊ทธ๋žจ ์Šคํ† ๋ฆฌ์— ๊ณต์œ ํ•˜๊ธฐ
Expand Down
36 changes: 25 additions & 11 deletions src/components/ModalPopup/ModalEvent2023FallRandomBox.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
import { memo, useCallback, useEffect, useState } from "react";
import {
Dispatch,
SetStateAction,
memo,
useCallback,
useEffect,
useState,
} from "react";

import type { EventItem } from "types/event2023fall";

Expand All @@ -23,19 +30,29 @@ const Background = () => (
</div>
);

type ModalEvent2023FallRandomBoxProps = { item?: EventItem } & Parameters<
typeof Modal
>[0];
type ModalEvent2023FallRandomBoxProps = {
item?: EventItem;
setShareItem?: Dispatch<SetStateAction<Nullable<EventItem>>>;
} & Parameters<typeof Modal>[0];

const ModalEvent2023FallRandomBox = ({
item,
setShareItem,
...modalProps
}: ModalEvent2023FallRandomBoxProps) => {
const [isBoxOpend, setIsBoxOpend] = useState<boolean>(false);
const isDisplayRandomBox = !useDelayBoolean(!modalProps.isOpen, 500);
const isDisplayItemName = useDelay<boolean>(isBoxOpend, !isBoxOpend, 6000);
const onClickOk = useCallback(() => setIsBoxOpend(true), []);

const onChangeIsOpen = useCallback(
(isOpen: boolean) => {
if (!isOpen && item) setShareItem?.(item);
modalProps?.onChangeIsOpen?.(isOpen);
},
[item, setShareItem, modalProps]
);

useEffect(() => {
if (!modalProps.isOpen) setIsBoxOpend(false);
}, [modalProps.isOpen]);
Expand All @@ -58,10 +75,11 @@ const ModalEvent2023FallRandomBox = ({

return (
<Modal
{...modalProps}
css={{ padding: "16px 12px 12px", overflow: "hidden" }}
onEnter={onClickOk}
backgroundChildren={isBoxOpend ? <Background /> : undefined}
{...modalProps}
onEnter={onClickOk}
onChangeIsOpen={onChangeIsOpen}
>
<div css={styleTitle}>
<HelpCenterRoundedIcon style={styleIcon} />
Expand Down Expand Up @@ -102,11 +120,7 @@ const ModalEvent2023FallRandomBox = ({
...theme.font14_bold,
}}
disabled={isDisplayItemName ? false : isBoxOpend}
onClick={
isDisplayItemName
? () => modalProps?.onChangeIsOpen?.(false)
: onClickOk
}
onClick={isDisplayItemName ? () => onChangeIsOpen(false) : onClickOk}
>
{isDisplayItemName ? "ํ™•์ธ" : "๋ฐ•์Šค ์—ด๊ธฐ"}
</Button>
Expand Down
10 changes: 5 additions & 5 deletions src/pages/Event/Event2023FallHistory.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -186,13 +186,13 @@ const Event2023FallHistory = () => {
<b>๐ŸŽ ์ง€๊ธ‰ ๋ฐฉ๋ฒ• :</b> ๊ฐ ์ƒํ’ˆ ๋ณ„ ์ง€๊ธ‰ ๋ฐฉ๋ฒ•์€ ์•„๋ž˜์™€ ๊ฐ™์Šต๋‹ˆ๋‹ค.
</div>
<div css={{ ...theme.font14, marginBottom: "5px" }}>
1. ๋ถ์ธก ๋งค์  ๊ตํ™˜๊ถŒ : ๊ต์–‘๋ถ„๊ด€ SPARCS ๋™๋ฐฉ์—์„œ ๊ตํ™˜๊ถŒ์„ ์ˆ˜๋ นํ•˜์‹ค
์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
1. ๋ถ์ธก ๋งค์  ๊ตํ™˜๊ถŒ / ๊ต๋‚ด ์—”์ œ๋ฆฌ๋„ˆ์Šค ์•„์ด์Šค ์•„๋ฉ”๋ฆฌ์นด๋…ธ S: (์—”ํ„ฐ
๋„ฃ์–ด์ฃผ์„ธ์š”) ๊ต์–‘๋ถ„๊ด€ SPARCS ๋™๋ฐฉ์—์„œ ๊ตํ™˜๊ถŒ์„ ์ˆ˜๋ นํ•˜์‹ค ์ˆ˜
์žˆ์Šต๋‹ˆ๋‹ค.
</div>
<div css={{ ...theme.font14, marginBottom: "5px" }}>
2. ๊ต๋‚ด ์—”์ œ๋ฆฌ๋„ˆ์Šค ์•„์ด์Šค ์•„๋ฉ”๋ฆฌ์นด๋…ธ S / BBQ ํ™ฉ๊ธˆ์˜ฌ๋ฆฌ๋ธŒ+์ฝœ๋ผ1.25L
/ ์˜ค์ƒ‰์†กํŽธ : ์ด๋ฒคํŠธ ์ฐธ์—ฌ ๋•Œ ๋“ฑ๋กํ•œ ์—ฐ๋ฝ์ฒ˜๋กœ ๊ธฐํ”„ํ‹ฐ์ฝ˜์„ ๋ฐœ์†กํ•ด
๋“œ๋ฆฝ๋‹ˆ๋‹ค.
2. BBQ ํ™ฉ๊ธˆ์˜ฌ๋ฆฌ๋ธŒ+์ฝœ๋ผ 1.25L / ์˜ค์ƒ‰์†กํŽธ: ์ด๋ฒคํŠธ ์ฐธ์—ฌ ๋•Œ ๋“ฑ๋กํ•œ
์—ฐ๋ฝ์ฒ˜๋กœ ๊ธฐํ”„ํ‹ฐ์ฝ˜์„ ๋ฐœ์†กํ•ด ๋“œ๋ฆฝ๋‹ˆ๋‹ค.
</div>
</div>
</WhiteContainer>
Expand Down
1 change: 1 addition & 0 deletions src/pages/Event/Event2023FallStore/ItemListSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ const EventItemContainer = ({ value, fetchItems }: EventItemComponentProps) => {
isOpen={!!rewardItem}
onChangeIsOpen={() => setRewardItem(null)}
item={rewardItem || undefined}
setShareItem={setShareItem}
/>
)}
<ModalEvent2023FallItemInstagram
Expand Down

0 comments on commit cbd4abf

Please sign in to comment.