Skip to content

Commit

Permalink
✨ 세미나 편집 페이지 추가 (#56)
Browse files Browse the repository at this point in the history
* 세미나 편집 page들 추가

* footer text 크기 수정

* BasicTextInput 추가

* Fieldset에 required prop 추가

* 세미나 편집 UI 구현

* SeminarEditor 관련 타입 정리

* 내비바 디자인 리뷰 반영

* 세미나 글 작성 및 수정 페이지 틀 작성

* SeminarEditor mock 데이터 작성

* 일정 제외 세미나 편집 로직 구현

* SeminarEditor 리팩토링

* DatePicker 추가

* StaticDateTimePicker 추가

* editor 폴더 정리

* ActionButton관련 타입 이동

* 리팩토링

* ScheduleFieldset 토글 반영

* 슬라이드 쇼 관련 안내 문구 추가

* 리뷰 반영
  • Loading branch information
yeolyi authored Aug 24, 2023
1 parent 10d93f3 commit 7b9d402
Show file tree
Hide file tree
Showing 22 changed files with 1,752 additions and 303 deletions.
6 changes: 3 additions & 3 deletions app/community/news/[id]/edit/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
import { getMockNewsPostDetail } from '@/apis/news';

import PostEditor from '@/components/editor/PostEditor';
import { EditorContent } from '@/components/editor/PostEditorProp';
import { PostEditorContent } from '@/components/editor/PostEditorProps';
import PageLayout from '@/components/layout/pageLayout/PageLayout';

import { NewsTags } from '@/constants/tag';

export default function NewsEditPage() {
const handleComplete = async (content: EditorContent) => {
const handleComplete = async (content: PostEditorContent) => {
console.log(content);
// throw new Error();
};
Expand All @@ -19,7 +19,7 @@ export default function NewsEditPage() {
const handleDelete = async () => {};

return (
<PageLayout title={'새 소식 편집'} titleType="small">
<PageLayout title={'새 소식 편집'} titleType="small" titleMargin="mb-6">
<PostEditor
tags={NewsTags}
showMainImage
Expand Down
4 changes: 2 additions & 2 deletions app/community/news/create/page.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
'use client';

import PostEditor from '@/components/editor/PostEditor';
import { EditorContent } from '@/components/editor/PostEditorProp';
import { PostEditorContent } from '@/components/editor/PostEditorProps';
import PageLayout from '@/components/layout/pageLayout/PageLayout';

import { NewsTags } from '@/constants/tag';

export default function NewsCreatePage() {
const handleComplete = async (content: EditorContent) => {
const handleComplete = async (content: PostEditorContent) => {
console.log(content);
// throw new Error();
};
Expand Down
59 changes: 59 additions & 0 deletions app/community/seminar/[id]/edit/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
'use client';

import useSWR from 'swr';

import SeminarEditor from '@/components/editor/SeminarEditor';
import {
SeminarEditorContent,
seminarEditorPlaceholder,
} from '@/components/editor/SeminarEditorProps';
import PageLayout from '@/components/layout/pageLayout/PageLayout';

export default function SeminarEditPage() {
// const { data: currentSeminar } = useSWR('/');

const handleComplete = async (content: SeminarEditorContent) => {
console.log(content);
// throw new Error();
};

const handleDelete = async () => {
//
};

return (
<PageLayout title={'세미나 쓰기'} titleType="small" titleMargin="mb-3">
<SeminarEditor
actions={{
type: 'EDIT',
onComplete: handleComplete,
onDelete: handleDelete,
}}
initialContent={mockSeminarContent}
/>
</PageLayout>
);
}

const mockSeminarContent: SeminarEditorContent = {
title: '기존 글',
description: '<b>기존 글 내용</b>',
location: '위치',
schedule: {
allDay: true,
showEndDate: true,
startDate: new Date(0),
endDate: new Date(1000000000),
},
host: '주최자 이름',
speaker: {
name: '연설자 이름',
nameURL: '연설자 URL',
title: '직함',
organization: '소속',
organizationURL: '소속 URL',
description: '연사 소개개개개개',
},
attachments: [],
isPublic: false,
};
23 changes: 23 additions & 0 deletions app/community/seminar/create/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
'use client';

import SeminarEditor from '@/components/editor/SeminarEditor';
import { SeminarEditorContent } from '@/components/editor/SeminarEditorProps';
import PageLayout from '@/components/layout/pageLayout/PageLayout';

export default function SeminarCreatePage() {
const handleComplete = async (content: SeminarEditorContent) => {
console.log(content);
// throw new Error();
};

return (
<PageLayout title={'세미나 쓰기'} titleType="small" titleMargin="mb-3">
<SeminarEditor
actions={{
type: 'CREATE',
onComplete: handleComplete,
}}
/>
</PageLayout>
);
}
17 changes: 0 additions & 17 deletions components/editor/Fieldset.tsx

This file was deleted.

Loading

0 comments on commit 7b9d402

Please sign in to comment.