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

[Mission5/정동환] Project_Notion_VanillaJs 과제 #43

Open
wants to merge 59 commits into
base: 4/#5_DongjaJ
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
3920438
:tada: Chore: project setting
DongjaJ Jun 28, 2023
98fbf6a
:sparkles: Chore: Component 클래스
DongjaJ Jun 28, 2023
60816b6
:art: Chore: 페이지 구조 세팅
DongjaJ Jun 28, 2023
53ddc85
:sparkles: Chore: Store 클래스 생성
DongjaJ Jun 28, 2023
08ab083
:sparkles: Feat: Router 기능 구현
DongjaJ Jun 28, 2023
0645823
:sparkles: Feat: API 기능 구현
DongjaJ Jun 29, 2023
1774b79
Update README.md
DongjaJ Jun 29, 2023
fca9e36
:hammer: Script: build script 변경
DongjaJ Jun 29, 2023
fbf9cfc
:hammer: Script: 오타 수정
DongjaJ Jun 29, 2023
cbab109
Update README.md
DongjaJ Jun 29, 2023
dc1fad5
Update README.md
DongjaJ Jun 29, 2023
611f8ac
:sparkles: Feat: 작성한 글 자동으로 로컬 스토리지에 저장
DongjaJ Jun 29, 2023
71c8414
:lipstick: Design: 전체 페이지 레이아웃 설정
DongjaJ Jun 29, 2023
a16034e
:sparkles: Feat: Store 설계 및 사이드바와 PostList Store 연결
DongjaJ Jun 29, 2023
9577e4b
:sparkles: Feat: 사이드바에서 -버튼 누를시 삭제하는 기능 추가
DongjaJ Jul 2, 2023
93062fb
:sparkles: Feat: 사이드바에서 문서 추가 및 삭제 구현
DongjaJ Jul 2, 2023
d5abd6c
:sparkles: Feat: 자동으로 서버에 저장 기능 추가
DongjaJ Jul 2, 2023
3ca5a79
:sparkles: Feat: 로딩중에 로딩중 이라고 메시지 렌더링
DongjaJ Jul 2, 2023
0386bae
:sparkles: Feat: 보고 있는 메모장 삭제시 홈으로 라우팅
DongjaJ Jul 2, 2023
70e90cb
:lipstick: Design: 사이드바 제목 길어지면 말 줄임 표시
DongjaJ Jul 2, 2023
9ae3dfa
:recycle: Refactor: 절대경로 안된 것들 적용
DongjaJ Jul 2, 2023
8c38549
:lipstick: Design: 사이드바 게시글 토글 기능 구현
DongjaJ Jul 2, 2023
e6dfd7c
:sparkles: Feat: 사이드 바 클릭시 게시글로 라우팅
DongjaJ Jul 2, 2023
0d8587f
:sparkles: Refactor: SideBar 이벤트리스너 함수 분리
DongjaJ Jul 2, 2023
a778d07
:sparkles: Feat: focus 된 post 하이라이트 처리
DongjaJ Jul 2, 2023
3937f04
:bug: Fix: 자식 documents눌렀을 때 강조 안되는 것 수정
DongjaJ Jul 3, 2023
14a9b2a
:lipstick: Design: Favicon, title 적용
DongjaJ Jul 3, 2023
3e5081e
:sparkles: Feat: 게시글 추가, 삭제, 수정 알림기능
DongjaJ Jul 3, 2023
b60f130
:sparkles: Feat: 게시글 아래에 자식 문서들 렌더링
DongjaJ Jul 3, 2023
c8ed367
:lipstick: Design: grid로 전체 레이아웃 잡음
DongjaJ Jul 3, 2023
a0f650f
:sparkles: Feat: 자식 리스트 누르면 자식으로 이동
DongjaJ Jul 3, 2023
7168fdc
:recycle: Refactor: PostList store action 이름 변경
DongjaJ Jul 3, 2023
136e387
:pencil2: Fix: delete 알림 버그 수정
DongjaJ Jul 3, 2023
90fb00d
:lipstick: Design: home page ui 기초 구현
DongjaJ Jul 4, 2023
c2f698e
:sparkles: Feat: Not Found 페이지 구현
DongjaJ Jul 4, 2023
8901724
:sparkles: Feat: Home UI 수정
DongjaJ Jul 4, 2023
dbb9741
:sparkles: Feat: SideBar 로고 클릭시 홈으로 라우팅
DongjaJ Jul 4, 2023
b240061
:recycle: Refactor: footer component로 분리
DongjaJ Jul 4, 2023
7e9cf82
:sparkles: Feat: content contentEditable로 리팩토링 하고 마지막 글자에 커서 가도록 수정
DongjaJ Jul 4, 2023
aedb496
:sparkles: Feat: PostEdit 페이지 브레드컴블 추가
DongjaJ Jul 4, 2023
21a1ef7
:sparkles: Feat: contentEditable placeholder 넣음
DongjaJ Jul 5, 2023
2308a84
:sparkles: Feat: underline, 취소선 기능
DongjaJ Jul 5, 2023
ea617cf
:sparkles: Feat: Editor굵기, 기울임, 밑줄, 취소선 기능 구현
DongjaJ Jul 5, 2023
9074332
:sparkles: Feat: 가운데 정렬, 왼쪽 정렬, 오른쪽 정렬 구현
DongjaJ Jul 5, 2023
47a0cdf
:bug: Fix: PostEdit 페이지 높이 계속 늘어나는 버그, 메모장 이외에 포커스해도 수정 버튼 클릭 이벤트 일어…
DongjaJ Jul 5, 2023
5c53d32
:recycle: Refactor: 스타일 수정 함수 분리
DongjaJ Jul 5, 2023
af592e9
:sparkles: Feat: 여러 스타일을 순서에 상관없이 적용 및 제거 가능
DongjaJ Jul 6, 2023
fb982bd
:bug: Fix: 한 줄에서 부분적으로 스타일 적용후 해제 하면 텍스트 노드 분리 되는 문제 해결
DongjaJ Jul 6, 2023
2d29435
:recycle: Feat: 왼쪽 정렬하면 span 없애도록 수정
DongjaJ Jul 6, 2023
1c0d106
:sparkles: Feat: 이동한 페이지 까지 사이드바에서 드롭다운 열어서보여주는 기능
DongjaJ Jul 6, 2023
f9ab4c1
:bug: Fix: 사이드바에서 선택 한 페이지 까지 드롭다운 열리는 버그 수정
DongjaJ Jul 6, 2023
c98c104
:truck: Rename: 라우터 패스 변경
DongjaJ Jul 6, 2023
d443d63
Merge pull request #18 from DongjaJ/4/#5_DongjaJ_working
DongjaJ Jul 6, 2023
ee31d77
:bug: Fix: 홈으로 갔을 때 사이드바에 하이라이트 있는 버그 수정
DongjaJ Jul 6, 2023
d28f9ae
Delete: 빈 줄 제거
DongjaJ Jul 17, 2023
3118a7f
:recycle: Refactor: 태그들 시맨틱하게 수정
DongjaJ Jul 17, 2023
ae5176a
:recycle: Refactor: 모달 클래스로 분리
DongjaJ Jul 17, 2023
2e31f3c
:recycle: Refactor: debounce 함수 수정
DongjaJ Jul 17, 2023
875a232
:recycle: Refactor: 게시글 페이지 브레드 크럼 에서 경로 찾는 기능 클래스로 분리
DongjaJ Jul 17, 2023
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
3 changes: 3 additions & 0 deletions Notion_VanillaJS/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ export default class App extends Component {
return `
<aside class='sideBar'></aside>
<section class ='page-Container'></section>
<dialog class='modal'>
DongjaJ marked this conversation as resolved.
Show resolved Hide resolved
<p class='modal-content'>게시글이 추가 되었습니다</p>
</dialog>
DongjaJ marked this conversation as resolved.
Show resolved Hide resolved
`;
}

Expand Down
2 changes: 2 additions & 0 deletions Notion_VanillaJS/src/store/PostListStore.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Store } from '@/core';
import { fetchPostList, deletePost } from '../api/request';
import { showModal } from '@/utils';

/**
*
Expand All @@ -13,6 +14,7 @@ async function reducer({ state, actionType, payload }) {
return { ...state, postList };
case 'DELETE':
await deletePost(payload.id);
showModal('DELETE');
DongjaJ marked this conversation as resolved.
Show resolved Hide resolved
const deletedPostList = await fetchPostList();
return { ...state, postList: deletedPostList };
}
Expand Down
8 changes: 5 additions & 3 deletions Notion_VanillaJS/src/store/PostStore.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Store } from '@/core';
import { Store, push } from '@/core';
import { createPost, deletePost, fetchPost, updatePost } from '../api/request';
import { push } from '@/core';

import { showModal } from '@/utils';
/**
*
* state: postId, title, content, updated
Expand All @@ -16,14 +15,17 @@ async function reducer({ state, actionType, payload }) {
return { ...state, post: { ...post, content: post?.content ?? '' } };
case 'CREATE_POST':
const newPost = await createPost(payload?.parent);
showModal('CREATE');
push(`/posts/${newPost.id}`);
return { ...state, post: { ...newPost, content: '' } };
case 'UPDATE_POST':
await updatePost(state.post);
const updatedPost = await fetchPost(state.post.id);
showModal('UPDATE');
return { ...state, post: updatedPost };
case 'DELETE_POST':
await deletePost(payload.id);
showModal('DELETE');
return;
}
}
Expand Down
25 changes: 25 additions & 0 deletions Notion_VanillaJS/src/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,28 @@ export function debounceSaveServer(callback) {
}, delay);
};
}

export function showModal(type) {
DongjaJ marked this conversation as resolved.
Show resolved Hide resolved
const delay = 2000;

const $modal = document.body.querySelector('.modal');
fillModal(type, $modal);
toggleModal($modal);
setTimeout(() => {
toggleModal($modal);
}, delay);
}

function toggleModal($modal) {
$modal.classList.toggle('open');
}

function fillModal(type, $modal) {
const modalContent = {
CREATE: '게시글이 추가되었습니다',
UPDATE: '게시글이 수정되었습니다',
DELETE: '게시글이 삭제되었습니다',
};
const $contentContainer = $modal.querySelector('.modal-content');
$contentContainer.innerHTML = modalContent[type];
}
34 changes: 30 additions & 4 deletions Notion_VanillaJS/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@
html,
body {
font-family: 'LINESeedKR-Bd';
#app {
margin: 0 auto;
min-height: 100vh;
}
}

button {
Expand All @@ -31,4 +27,34 @@ li {
#app {
display: grid;
grid-template-columns: 20% 80%;
margin: 0 auto;
min-height: 100vh;
}

.modal {
position: fixed;

opacity: 0;
visibility: hidden;

display: flex;
flex-direction: column;
align-items: center;
justify-content: center;

top: 20%;
left: 20%;

width: 14rem;
height: 4rem;

color: whitesmoke;

background-color: #666666;
transition: all ease-in-out 700ms;
}

.modal.open {
opacity: 1;
visibility: visible;
}