diff --git a/.github/workflows/s3Build.yml b/.github/workflows/s3Build.yml index cc570d7..7deb911 100644 --- a/.github/workflows/s3Build.yml +++ b/.github/workflows/s3Build.yml @@ -19,11 +19,11 @@ jobs: restore-keys: | ${{ runner.OS }}-build- ${{ runner.OS }}- - - - name: Install Dependencies # 의존 파일 설치 + + - name: Install Dependencies # 의존 파일 설치 run: npm install --legacy-peer-deps - - - name: Build # React Build + + - name: Build # React Build run: npm run build - name: Deploy # S3에 배포 @@ -34,5 +34,4 @@ jobs: aws s3 cp \ --recursive \ --region ap-northeast-2 \ - build s3://roadmakertest - + build s3://http://roadmaker.site.s3-website.ap-northeast-2.amazonaws.com diff --git a/dbDir/000007.ldb b/dbDir/000007.ldb deleted file mode 100644 index 0a998f7..0000000 Binary files a/dbDir/000007.ldb and /dev/null differ diff --git a/dbDir/000010.ldb b/dbDir/000010.ldb deleted file mode 100644 index 82446ae..0000000 Binary files a/dbDir/000010.ldb and /dev/null differ diff --git a/dbDir/000011.log b/dbDir/000011.log deleted file mode 100644 index e69de29..0000000 diff --git a/dbDir/CURRENT b/dbDir/CURRENT deleted file mode 100644 index 6ba31a3..0000000 --- a/dbDir/CURRENT +++ /dev/null @@ -1 +0,0 @@ -MANIFEST-000009 diff --git a/dbDir/LOCK b/dbDir/LOCK deleted file mode 100644 index e69de29..0000000 diff --git a/dbDir/LOG b/dbDir/LOG deleted file mode 100644 index e19d979..0000000 --- a/dbDir/LOG +++ /dev/null @@ -1,5 +0,0 @@ -2023/07/21-18:39:34.300 8204 Recovering log #8 -2023/07/21-18:39:34.301 8204 Level-0 table #10: started -2023/07/21-18:39:34.305 8204 Level-0 table #10: 401 bytes OK -2023/07/21-18:39:34.317 8204 Delete type=0 #8 -2023/07/21-18:39:34.318 8204 Delete type=3 #6 diff --git a/dbDir/LOG.old b/dbDir/LOG.old deleted file mode 100644 index 3ee6dcb..0000000 --- a/dbDir/LOG.old +++ /dev/null @@ -1,5 +0,0 @@ -2023/07/21-14:37:29.523 63b0 Recovering log #5 -2023/07/21-14:37:29.525 63b0 Level-0 table #7: started -2023/07/21-14:37:29.535 63b0 Level-0 table #7: 260 bytes OK -2023/07/21-14:37:29.556 63b0 Delete type=0 #5 -2023/07/21-14:37:29.557 63b0 Delete type=3 #4 diff --git a/dbDir/MANIFEST-000009 b/dbDir/MANIFEST-000009 deleted file mode 100644 index a682b65..0000000 Binary files a/dbDir/MANIFEST-000009 and /dev/null differ diff --git a/hydratable.config.json b/hydratable.config.json new file mode 100644 index 0000000..dd83409 --- /dev/null +++ b/hydratable.config.json @@ -0,0 +1,3 @@ +{ + "crawlingUrls": ["/", "/copyrights"] +} diff --git a/package.json b/package.json index 7165e53..ae4feaf 100644 --- a/package.json +++ b/package.json @@ -2,12 +2,10 @@ "name": "my-app", "version": "0.1.0", "private": true, - "homepage": "http://roadmakertest.s3-website.ap-northeast-2.amazonaws.com", + "homepage": "http://roadmaker.site.s3-website.ap-northeast-2.amazonaws.com/", "dependencies": { "@dagrejs/dagre": "^1.0.2", - "@egjs/infinitegrid": "^4.10.1", - "@fontsource/roboto": "^5.0.8", - "@fristys/masonry": "^1.1.7", + "@emotion/react": "^11.11.1", "@mantine/carousel": "^6.0.16", "@mantine/core": "^6.0.16", "@mantine/dates": "^6.0.16", @@ -20,14 +18,13 @@ "@mantine/prism": "^6.0.16", "@mantine/spotlight": "^6.0.16", "@mantine/tiptap": "^6.0.16", - "@monaco-editor/react": "^4.5.1", + "@reactflow/node-resizer": "^2.1.1", "@reactflow/node-toolbar": "^1.2.3", "@syncedstore/core": "^0.5.2", "@syncedstore/react": "^0.5.2", "@tabler/icons-react": "^2.25.0", "@tiptap/core": "^2.0.4", - "@tiptap/extension-collaboration": "^2.0.4", - "@tiptap/extension-collaboration-cursor": "^2.0.4", + "@tiptap/extension-code-block": "^2.0.4", "@tiptap/extension-color": "^2.0.4", "@tiptap/extension-highlight": "^2.0.4", "@tiptap/extension-history": "^2.0.4", @@ -44,9 +41,10 @@ "@tiptap/react": "^2.0.4", "@tiptap/starter-kit": "^2.0.3", "@tisoap/react-flow-smart-edge": "^3.0.0", - "@types/masonry-layout": "^4.2.5", "axios": "^1.4.0", "classcat": "^5.0.4", + "d3-drag": "^3.0.0", + "d3-selection": "^3.0.0", "draft-js": "^0.11.7", "embla-carousel-react": "^8.0.0-rc11", "fast-json-patch": "^3.1.1", @@ -54,29 +52,22 @@ "http-proxy-middleware": "^2.0.6", "jsonpatch": "^3.1.0", "lowlight": "^2.9.0", - "monaco-editor": "^0.40.0", "nanoid": "^4.0.2", - "prosemirror-keymap": "^1.2.2", - "prosemirror-model": "^1.19.3", - "prosemirror-state": "^1.4.3", - "prosemirror-view": "^1.31.6", - "react": "^17.0.0 || ^18.0.0", - "react-dom": "^17.0.0 || ^18.0.0", + "prop-types": "^15.8.1", + "react": "^18.2.0", + "react-dom": "^18.2.0", "react-draft-wysiwyg": "^1.15.0", + "react-hydratable": "^1.2.1", "react-infinite-scroller": "^1.2.6", "react-query": "^3.39.3", "react-router-dom": "^6.14.1", "react-scripts": "5.0.1", "reactflow": "^11.7.4", - "styled-components": "^6.0.7", + "styled-components": "^6.0.4", "styled-reset": "^4.5.1", "tiptap": "^1.32.2", "web-vitals": "^2.1.4", - "y-leveldb": "^0.1.2", - "y-monaco": "^0.1.4", - "y-prosemirror": "^1.2.1", - "yjs": "^13.6.7", - "zustand": "^4.3.9" + "zustand": "4.3.9" }, "scripts": { "start": "react-scripts start", @@ -85,7 +76,15 @@ "test": "env-cmd -f .env.production react-scripts test", "eject": "react-scripts eject", "lint": "yarn lint:ci --fix", - "lint:ci": "eslint src" + "lint:ci": "eslint src", + "postbuild": "react-hydratable", + "preview": "react-hydratable --preview" + }, + "reactSnap": { + "include": [ + "/", + "/roadmap/post" + ] }, "browserslist": { "production": [ @@ -108,7 +107,7 @@ "@testing-library/react": "^13.4.0", "@testing-library/user-event": "^13.5.0", "@types/jest": "^27.5.2", - "@types/node": "^16.18.38", + "@types/node": "^20.4.8", "@types/react": "^18.2.15", "@types/react-dom": "^18.2.7", "@types/react-draft-wysiwyg": "^1.13.4", diff --git a/public/img/loadingImg.gif b/public/img/loadingImg.gif new file mode 100644 index 0000000..da057f1 Binary files /dev/null and b/public/img/loadingImg.gif differ diff --git a/public/img/logo.png b/public/img/logo.png index 6b5d811..7be3d57 100644 Binary files a/public/img/logo.png and b/public/img/logo.png differ diff --git a/public/img/shortLogo.png b/public/img/shortLogo.png new file mode 100644 index 0000000..7fc1027 Binary files /dev/null and b/public/img/shortLogo.png differ diff --git a/public/img/warning.gif b/public/img/warning.gif new file mode 100644 index 0000000..e9f5084 Binary files /dev/null and b/public/img/warning.gif differ diff --git a/public/index.html b/public/index.html index 0f3b443..cad2b0c 100644 --- a/public/index.html +++ b/public/index.html @@ -1,23 +1,19 @@ + Roadmaker - + - - - + + + + - Roadmaker diff --git a/public/manifest.json b/public/manifest.json deleted file mode 100644 index 080d6c7..0000000 --- a/public/manifest.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "short_name": "React App", - "name": "Create React App Sample", - "icons": [ - { - "src": "favicon.ico", - "sizes": "64x64 32x32 24x24 16x16", - "type": "image/x-icon" - }, - { - "src": "logo192.png", - "type": "image/png", - "sizes": "192x192" - }, - { - "src": "logo512.png", - "type": "image/png", - "sizes": "512x512" - } - ], - "start_url": ".", - "display": "standalone", - "theme_color": "#000000", - "background_color": "#ffffff" -} diff --git a/src/App.tsx b/src/App.tsx index 963658b..09f50de 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,5 +1,6 @@ // import InteractionFlow from './pages/main/userRoadmap'; import { Notifications } from '@mantine/notifications'; +import RoadMapPostPage from 'pages/roadmap/posts'; import KeywordSearchRoadmaps from 'pages/roadmap/posts/byKeyword'; import { ReactElement } from 'react'; import { QueryClientProvider } from 'react-query'; @@ -12,9 +13,7 @@ import { UserProfile } from './components/user/userProfile'; import ErrorPage from './pages/error'; import LoginPage from './pages/login'; import MainPage from './pages/main'; -import ResetInfoPage from './pages/resetInfo'; import RoadMapEditor from './pages/roadmap/editor'; -import PostedRoadmap from './pages/roadmap/posts/postedRoadmap'; import SignupPage from './pages/signup'; function App(): ReactElement { @@ -29,13 +28,11 @@ function App(): ReactElement { element: , }, { path: 'users/signup', element: }, - { path: 'users/reset', element: }, { path: 'roadmap/editor', element: , }, - // { path: '/roadmap/post/:id', element: }, // origin initialMerge - { path: '/roadmap/post/:Id', element: }, + { path: '/roadmap/post/:Id', element: }, { path: '/roadmap/post/search/:keyword', element: , @@ -50,13 +47,10 @@ function App(): ReactElement { ]); return ( - {/* */}
- {/* */}
- {/*
*/}
); diff --git a/src/assets/Logo.svg b/src/assets/Logo.svg new file mode 100644 index 0000000..9a2924e --- /dev/null +++ b/src/assets/Logo.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/src/assets/Spinner.svg b/src/assets/Spinner.svg new file mode 100644 index 0000000..abe4d92 --- /dev/null +++ b/src/assets/Spinner.svg @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/assets/noImage.svg b/src/assets/noImage.svg new file mode 100644 index 0000000..8f680bc --- /dev/null +++ b/src/assets/noImage.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/src/auth/useAuth.ts b/src/auth/useAuth.ts index 1a4cb6b..019bb68 100644 --- a/src/auth/useAuth.ts +++ b/src/auth/useAuth.ts @@ -13,8 +13,8 @@ interface UseAuth { signout: () => void; isUserModalOpen: boolean; setIsUserModalOpen: (isUserModalOpen: boolean) => void; - modalText: string; // 추가: 모달에 표시할 텍스트 상태 - setModalText: (text: string) => void; // 추가: 모달 텍스트를 업데이트하는 함수 + modalText: string; + setModalText: (text: string) => void; openModal: boolean; setOpenModal: (openModal: boolean) => void; success: boolean; @@ -116,10 +116,8 @@ export function useAuth(): UseAuth { ? errorResponse?.response?.status : SERVER_ERROR; status === 403 - ? // eslint-disable-next-line no-alert - alert('이메일과 비밀번호가 일치하지 않습니다.') - : // eslint-disable-next-line no-alert - alert(`status code : ${status}!`); + ? alert('이메일과 비밀번호가 일치하지 않습니다.') + : alert(`status code : ${status}!`); } } diff --git a/src/components/comments/index.tsx b/src/components/comments/index.tsx new file mode 100644 index 0000000..633d1bd --- /dev/null +++ b/src/components/comments/index.tsx @@ -0,0 +1,207 @@ +/* eslint-disable no-console */ +/* eslint-disable @typescript-eslint/no-unused-vars */ +import { + Avatar, + Button, + Center, + createStyles, + Group, + Modal, + Paper, + rem, + SimpleGrid, + Text, + Textarea, +} from '@mantine/core'; +import { useDisclosure } from '@mantine/hooks'; +import axios from 'axios'; +import { baseUrl } from 'axiosInstance/constants'; +import { useUser } from 'components/user/hooks/useUser'; +import { Footer } from 'layout/mainLayout/footer/Footer'; +import { useCallback, useEffect, useState } from 'react'; +import InfiniteScroll from 'react-infinite-scroller'; +import { useInfiniteQuery } from 'react-query'; +import { useLocation } from 'react-router-dom'; + +const useStyles = createStyles((theme) => ({ + body: { + paddingLeft: rem(54), + paddingTop: theme.spacing.sm, + }, +})); + +function CommentSection() { + const [opened, { open, close }] = useDisclosure(false); + const { classes, theme } = useStyles(); + // const [count, handlers] = useCounter(0, { min: 0, max: 1000 }); + const [commentPage, setCommentPage] = useState(1); + const { pathname } = useLocation(); + const [title, setTitle] = useState(''); + const [content, setContent] = useState([]); + const [commentInput, setCommentInput] = useState(''); + const { user } = useUser(); + const [counts, setCounts] = useState([]); + + const fetchComments = useCallback(() => { + axios + .get( + `${baseUrl}/roadmaps/load-roadmap/${pathname.slice( + pathname.lastIndexOf('/') + 1, + )}/comments?page=${commentPage}&size=5`, + { + headers: { + 'Content-Type': 'application/json', + }, + }, + ) + .then((v) => { + setContent(v?.data); + // setCounts(new Array(commentContents.length).fill(0)); + // setNickname(v?.data?.commentNickname); + }); + // .catch((e) => // console.log(e)); + }, [commentPage, pathname]); + + const { + refetch, + data, + fetchNextPage, + hasNextPage, + isLoading, + isError, + error, + } = useInfiniteQuery( + 'comments', + ({ pageParam = initialUrl }) => fetchUrl(pageParam), + { + getNextPageParam: (lastPage) => { + // // console.log(lastPage.result); + if (lastPage.result.length !== 0) { + return lastPage.next; + } + return undefined; + }, + }, + ); + + useEffect(() => { + setCommentPage(1); + refetch(); + fetchComments(); + }, [commentPage, fetchComments, pathname, refetch, user?.accessToken]); + + const initialUrl = `${baseUrl}/roadmaps/load-roadmap/${pathname.slice( + pathname.lastIndexOf('/') + 1, + )}/comments?page=${commentPage}&size=5`; + + const fetchUrl = async (url) => { + const response = await fetch(url); + return response.json(); + }; + + if (isLoading) return
Loading...
; + if (isError) return
Error! {error.toString()}
; + + const handleCommentContentChange = (event) => { + setCommentInput(event.target.value); + }; + + function handleSubmit() { + axios + .post( + `${baseUrl}/comments/save-comment`, + { + content: commentInput, + roadmapId: Number(pathname.slice(pathname.lastIndexOf('/') + 1)), + }, + { + headers: { + Authorization: `Bearer ${user?.accessToken}`, + 'Content-Type': 'application/json', + }, + }, + ) + .then(() => { + fetchComments(); + refetch(); + }); + // .catch((e) => // console.log('err', e)); + } + return ( + <> + +
+

코멘트 작성

+
+