-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: 기존코드 lint 및 코드 포매팅 resolve #8
- Loading branch information
Showing
6 changed files
with
49 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,5 +12,3 @@ export const ShowDateLink = styled.a` | |
line-height: 22px; | ||
} | ||
`; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,62 +1,79 @@ | ||
import React, { useState } from "react"; | ||
import { BiSolidMap } from "react-icons/bi"; | ||
|
||
import { Guest } from "@/components/display/Guest"; | ||
import { ShowDate } from "@/components/display/ShowData"; | ||
import { MainContent, GuestCard, GuestContainer, Date } from "./SpecialGuestPage.styled"; | ||
import { Paragraph } from "@/components/typography/Paragraph" | ||
import { Paragraph } from "@/components/typography/Paragraph"; | ||
import { Text } from "@/components/typography/Text"; | ||
import { BiSolidMap } from "react-icons/bi"; | ||
|
||
import { MainContent, GuestCard, GuestContainer, Date } from "./SpecialGuestPage.styled"; | ||
|
||
const SpecialGuestPage: React.FC = () => { | ||
const [activeDate, setActiveDate] = useState<string>("5.22"); | ||
const [activeDate, setActiveDate] = useState<string>("5.22"); | ||
|
||
const handleDateClick = (date: string) => { | ||
const handleDateClick = (date: string) => { | ||
setActiveDate(date); | ||
}; | ||
interface GuestData { | ||
[key: string]: { pic: string; name: string; }[]; | ||
[key: string]: { pic: string; name: string }[]; | ||
} | ||
|
||
const guestData: GuestData = { | ||
"5.21": [ | ||
{ pic: "./src/assets/jannavi.jpg", name: "잔나비" }, | ||
{ pic: "./src/assets/norazo.jpg", name: "노라조" }, | ||
{ pic: "./src/assets/soranband.webp", name: "소란밴드" } | ||
{ pic: "./src/assets/soranband.webp", name: "소란밴드" }, | ||
], | ||
"5.22": [ | ||
{ pic: "./src/assets/qwer.webp", name: "QWER" }, | ||
{ pic: "./src/assets/10cm.jpg", name: "10CM" }, | ||
{ pic: "./src/assets/haha.webp", name: "하하" } | ||
{ pic: "./src/assets/haha.webp", name: "하하" }, | ||
], | ||
"5.23": [ | ||
{ pic: "./src/assets/paulblanco.avif", name: "Paul Balnco" }, | ||
{ pic: "./src/assets/loykim.webp", name: "로이킴" }, | ||
{ pic: "./src/assets/bigmama.webp", name: "빅마마" } | ||
] | ||
{ pic: "./src/assets/bigmama.webp", name: "빅마마" }, | ||
], | ||
}; | ||
const renderGuests = () => { | ||
return guestData[activeDate].map((guest) => ( | ||
<Guest pic={guest.pic} name={guest.name} /> | ||
)); | ||
return guestData[activeDate].map((guest) => <Guest pic={guest.pic} name={guest.name} />); | ||
}; | ||
|
||
return ( | ||
<MainContent> | ||
<Paragraph size="44px" weight="bold" variant="darkpurple">SPECIAL GUEST</Paragraph> | ||
<Paragraph size="44px" weight="bold" variant="darkpurple"> | ||
SPECIAL GUEST | ||
</Paragraph> | ||
<GuestContainer> | ||
<Date> | ||
<ShowDate date="5.21" day="TUE" active={activeDate === "5.21"} onClick={() => handleDateClick("5.21")} /> | ||
<ShowDate date="5.22" day="WED" active={activeDate === "5.22"} onClick={() => handleDateClick("5.22")} /> | ||
<ShowDate date="5.23" day="THU" active={activeDate === "5.23"} onClick={() => handleDateClick("5.23")} /> | ||
<ShowDate | ||
date="5.21" | ||
day="TUE" | ||
active={activeDate === "5.21"} | ||
onClick={() => handleDateClick("5.21")} | ||
/> | ||
<ShowDate | ||
date="5.22" | ||
day="WED" | ||
active={activeDate === "5.22"} | ||
onClick={() => handleDateClick("5.22")} | ||
/> | ||
<ShowDate | ||
date="5.23" | ||
day="THU" | ||
active={activeDate === "5.23"} | ||
onClick={() => handleDateClick("5.23")} | ||
/> | ||
</Date> | ||
<div> | ||
<BiSolidMap size={18} color="#5d5a88" /> | ||
<Text size="m" weight="bold" variant="darkpurple">1주차장</Text> | ||
<Text size="m" weight="bold" variant="darkpurple"> | ||
1주차장 | ||
</Text> | ||
</div> | ||
<GuestCard> | ||
{ renderGuests() } | ||
</GuestCard> | ||
<GuestCard>{renderGuests()}</GuestCard> | ||
</GuestContainer> | ||
</MainContent> | ||
); | ||
} | ||
export default SpecialGuestPage; | ||
}; | ||
export default SpecialGuestPage; |