Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

모든 스케줄에 공지 추가 작업 #309

Merged
merged 1 commit into from
Aug 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading