Skip to content

Commit

Permalink
๐Ÿš€ ver3.0.1
Browse files Browse the repository at this point in the history
๋ณ€๊ฒฝ์‚ฌํ•ญ
๋ชจ์ž„์นด๋“œ ์‹œ๊ฐ„ ํ‘œ์‹œ ํฌ๋ฉง ์ˆ˜์ •
์ง„ํ–‰์ค‘์ธ ๋ชจ์ž„ ๋ฆฌ์ŠคํŠธ ํ‘œ์‹œ ๋ถ„๊ธฐ ์ฒ˜๋ฆฌ
  • Loading branch information
Changyu-Ryou authored Dec 14, 2021
2 parents 8d5ca11 + 259b23f commit 874ba09
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,12 @@ function MeetingCard({ idx, data, setMeetings }: Props): ReactElement {
<ContentsWrapper className="meeting-card__contents">
<InfoWrapper>
<MeetingTime className="body3 meeting-card__time">
{getStartTimeForm(data.start_time, data.live_status, true)}
{getStartTimeForm(
data.date,
data.start_time,
data.live_status,
true,
)}
</MeetingTime>

<MeetingTitle className="title3 meeting-card__title">
Expand Down
27 changes: 13 additions & 14 deletions src/components/LandingPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ const LandingPage: React.FC = () => {
</CreateBtn>
</CreateBtnWrapper>
{meetings.length === 0 && <SkeletonCard />}
{meetings.filter(el => el.live_status === 'live') && (
{meetings.filter(el => el.live_status === 'live').length !== 0 && (
<div>
<CurrMeetingList
className="landing__current"
Expand All @@ -118,19 +118,18 @@ const LandingPage: React.FC = () => {
<Divider className="landing__divider" size="1rem" />
</div>
)}
{
<div>
<MeetingList
className="landing__upoming"
meetings={meetings.filter(
el => el.live_status !== 'live' && el.live_status !== 'finish',
)}
hasMeetings={meetings.length !== 0}
setMeetings={setMeetings}
/>
<Divider className="landing__divider" size="1rem" />
</div>
}

<div>
<MeetingList
className="landing__upoming"
meetings={meetings.filter(
el => el.live_status !== 'live' && el.live_status !== 'finish',
)}
hasMeetings={meetings.length !== 0}
setMeetings={setMeetings}
/>
<Divider className="landing__divider" size="1rem" />
</div>
</PageWrapper>
);
};
Expand Down
9 changes: 7 additions & 2 deletions src/util/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,21 @@ export const getDateToText = (start_time: string) => {
};

export const getStartTimeForm = (
date: string,
start_time: string,
live_status: LiveStatus,
head_text?: boolean,
) => {
let text = '';
const startTimeArr = start_time.split(':');
const startDate = dayjs(
`${date} ${start_time}`,
'YYYY-MM-DD HH:mm:ss',
).format('a hh:mm');

if (head_text && live_status === 'tomorrow') text += '๋‚ด์ผ ';
else if (head_text && live_status === 'today') text += '์˜ค๋Š˜ ';
text += getTimeText(parseInt(startTimeArr[0]), parseInt(startTimeArr[1]));

text += startDate;
return text;
};

Expand Down

0 comments on commit 874ba09

Please sign in to comment.