-
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.
Browse files
Browse the repository at this point in the history
타임테이블 페이지 구현
- Loading branch information
Showing
27 changed files
with
580 additions
and
159 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Binary file not shown.
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import styled from "styled-components"; | ||
|
||
export const Date = styled.div` | ||
width: 100%; | ||
display: flex; | ||
flex-direction: row; | ||
justify-content: center; | ||
gap: 33px; | ||
`; |
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import React from "react"; | ||
|
||
import { Date } from "@/components/display/DateSelector.styled"; | ||
import { ShowDate } from "@/components/display/ShowDate"; | ||
|
||
interface DateSelectorProps { | ||
activeDate: string; | ||
onDateClick: (date: string) => void; | ||
dates: { date: string; day: string }[]; | ||
} | ||
|
||
const DateSelector: React.FC<DateSelectorProps> = ({ activeDate, onDateClick, dates }) => { | ||
return ( | ||
<Date> | ||
{dates.map(({ date, day }) => ( | ||
<ShowDate | ||
key={date} | ||
date={date} | ||
day={day} | ||
active={activeDate === date} | ||
onClick={() => onDateClick(date)} | ||
/> | ||
))} | ||
</Date> | ||
); | ||
}; | ||
|
||
export default DateSelector; |
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
File renamed without changes.
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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import styled from "styled-components"; | ||
|
||
import { Text } from "@/components/typography/Text"; | ||
|
||
export const TimeTableSectionWrapper = styled.div` | ||
margin: 20px 0; | ||
padding: 20px; | ||
width: 80%; | ||
background: rgba(255, 255, 255, 0.1); | ||
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); | ||
border-radius: 12px; | ||
color: #333; | ||
`; | ||
|
||
export const LocationWrapper = styled.div` | ||
display: flex; | ||
align-items: center; | ||
gap: 8px; | ||
`; | ||
|
||
export const EventWrapper = styled.div<{ isCurrent: boolean }>` | ||
display: flex; | ||
justify-content: flex-start; | ||
gap: 20px; | ||
padding: 20px 0; | ||
border-bottom: 1px solid rgba(0, 0, 0, 0.1); | ||
background-color: ${({ isCurrent }) => (isCurrent ? "#e8e6ff" : "transparent")}; | ||
&:last-child { | ||
border-bottom: none; | ||
} | ||
`; | ||
|
||
export const EventTime = styled(Text)` | ||
font-weight: bold; | ||
font-family: "DM Sans", sans-serif; | ||
`; | ||
|
||
export const EventText = styled(Text)` | ||
display: flex; | ||
align-items: center; | ||
`; |
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 |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import React from "react"; | ||
import { BiSolidMap } from "react-icons/bi"; | ||
|
||
import { Paragraph } from "@/components/typography/Paragraph"; | ||
|
||
import { Text } from "../typography/Text"; | ||
import { | ||
TimeTableSectionWrapper, | ||
LocationWrapper, | ||
EventWrapper, | ||
EventTime, | ||
EventText, | ||
} from "./TimeTableSection.styled"; | ||
|
||
interface TimeTableSectionProps { | ||
title: string; | ||
data: { time: string; event: string }[]; | ||
locationRef: React.RefObject<HTMLDivElement>; | ||
currentTime: Date; | ||
} | ||
|
||
export const TimeTableSection: React.FC<TimeTableSectionProps> = ({ title, data, locationRef, currentTime }) => { | ||
const isCurrentEvent = (eventTime: string): boolean => { | ||
const [startTime, endTime] = eventTime.split(" ~ ").map((time) => new Date(`2024-05-21T${time}:00`)); | ||
return currentTime >= startTime && currentTime <= endTime; | ||
}; | ||
|
||
return ( | ||
<TimeTableSectionWrapper ref={locationRef}> | ||
<Paragraph size="m" weight="bold" variant="darkpurple"> | ||
<LocationWrapper> | ||
<BiSolidMap size={18} color="#5d5a88" /> | ||
<Text size="xs" weight="bold" variant="darkpurple"> | ||
{title} | ||
</Text> | ||
</LocationWrapper> | ||
</Paragraph> | ||
{data.map((entry, index) => ( | ||
<EventWrapper key={index} isCurrent={isCurrentEvent(entry.time)}> | ||
<EventTime size="s" weight="bold" variant="darkpurple"> | ||
{entry.time} | ||
</EventTime> | ||
<EventText size="xs" weight="normal" variant="black"> | ||
{entry.event} | ||
</EventText> | ||
</EventWrapper> | ||
))} | ||
</TimeTableSectionWrapper> | ||
); | ||
}; |
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import styled from "styled-components"; | ||
|
||
export const MainContent = styled.div<{ isHomePage: boolean }>` | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
justify-content: center; | ||
margin-top: ${({ isHomePage }) => (isHomePage ? "0px" : "50px")}; | ||
position: relative; | ||
`; |
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,15 +1,23 @@ | ||
import styled from "styled-components"; | ||
|
||
import { IText, Text } from "./Text"; | ||
|
||
export interface IParagraph extends IText { | ||
children: React.ReactNode; | ||
isTitle?: boolean; | ||
} | ||
|
||
export const Paragraph: React.FC<IParagraph> = ({ size, weight, variant, children }) => { | ||
const ParagraphStyled = styled.p<{ isTitle?: boolean }>` | ||
text-shadow: ${({ isTitle }) => (isTitle ? "0px 4px 4px rgba(0, 0, 0, 0.1)" : "none")}; | ||
font-family: ${({ isTitle }) => (isTitle ? "Blinker SemiBold" : "Pretendard")}; | ||
`; | ||
|
||
export const Paragraph: React.FC<IParagraph> = ({ size, weight, variant, children, isTitle }) => { | ||
return ( | ||
<p> | ||
<ParagraphStyled isTitle={isTitle}> | ||
<Text size={size} weight={weight} variant={variant}> | ||
{children} | ||
</Text> | ||
</p> | ||
</ParagraphStyled> | ||
); | ||
}; |
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
Oops, something went wrong.