Skip to content

Commit

Permalink
Merge pull request #309 from mash-up-kr/feature/schedule-notice
Browse files Browse the repository at this point in the history
모든 스케줄에 공지 추가 작업
  • Loading branch information
kikiyeom authored Aug 16, 2024
2 parents 29ae79a + 636627c commit 435aeea
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 51 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,7 @@ const ScheduleTemplate = () => {
</Styled.LocationWrapper>
)}
</div>
{scheduleType === ScheduleType.PLATFORM && (
<Textarea label="공지" {...register('notice')} />
)}
<Textarea label="공지" {...register('notice')} />
</Styled.ScheduleContent>
<Styled.SessionContent>
<Styled.Title>세션 정보</Styled.Title>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,54 +30,62 @@ const ScheduleInfoList = ({
location,
notice,
}: ScheduleInfoListProps) => {
const baseScheduleInfoListItem = [
{
label: '스케줄 명',
value: name,
},
{
label: '기수',
value: `${generationNumber}기`,
},
{
label: '구분',
value: getScheduleType(scheduleType),
},
{
label: '스케줄 일시',
value: formatDate(startedAt, 'YYYY년 M월 D일 A hh시 mm분'),
},
{
label: '등록 일시',
value: formatDate(createdAt, 'YYYY년 M월 D일 A hh시 mm분'),
},
{
label: '장소',
value:
location.roadAddress === null
? location.detailAddress // ZOOM
: `${location.roadAddress}${location.detailAddress ? `, ${location.detailAddress}` : ''}`,
},
{
label: '공지',
value: notice ?? '-',
},
{
label: '배포 일시',
value: formatDate(publishedAt, 'YYYY년 M월 D일 A hh시 mm분'),
},
{
label: '배포 상태',
value: getScheduleStatusText(status),
},
];

const scheduleInfoListItem = useMemo(() => {
if (getScheduleType(scheduleType) === '전체') {
return baseScheduleInfoListItem.filter((i) => i.label !== '공지');
}
return baseScheduleInfoListItem;
}, [baseScheduleInfoListItem, scheduleType]);
return [
{
label: '스케줄 명',
value: name,
},
{
label: '기수',
value: `${generationNumber}기`,
},
{
label: '구분',
value: getScheduleType(scheduleType),
},
{
label: '스케줄 일시',
value: formatDate(startedAt, 'YYYY년 M월 D일 A hh시 mm분'),
},
{
label: '등록 일시',
value: formatDate(createdAt, 'YYYY년 M월 D일 A hh시 mm분'),
},
{
label: '장소',
value:
location.roadAddress === null
? location.detailAddress // ZOOM
: `${location.roadAddress}${
location.detailAddress ? `, ${location.detailAddress}` : ''
}`,
},
{
label: '공지',
value: notice || '-',
},
{
label: '배포 일시',
value: formatDate(publishedAt, 'YYYY년 M월 D일 A hh시 mm분'),
},
{
label: '배포 상태',
value: getScheduleStatusText(status),
},
];
}, [
createdAt,
generationNumber,
location.detailAddress,
location.roadAddress,
name,
notice,
publishedAt,
scheduleType,
startedAt,
status,
]);

return (
<Styled.ScheduleInfoList>
Expand Down
2 changes: 1 addition & 1 deletion src/utils/schedule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ export const parseFormValuesToScheduleRequest = (
startedAt,
endedAt,
eventsCreateRequests,
notice: formScheduleType === ScheduleType.ALL ? '' : notice,
notice,
};

if (locationType === LocationType.OFFLINE && locationInfo) {
Expand Down

0 comments on commit 435aeea

Please sign in to comment.