diff --git a/.pnp.cjs b/.pnp.cjs index 4139659..c890adf 100755 --- a/.pnp.cjs +++ b/.pnp.cjs @@ -43,6 +43,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["@types/node", "npm:17.0.18"], ["@types/prop-types", "npm:15.7.4"], ["@types/react", "npm:17.0.39"], + ["@types/react-calendar", "npm:3.5.0"], ["@types/react-cookies", "npm:0.1.0"], ["@types/react-dom", "npm:17.0.11"], ["@types/react-is", "npm:17.0.3"], @@ -58,6 +59,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["postinstall-postinstall", "npm:2.1.0"], ["prop-types", "npm:15.8.1"], ["react", "npm:17.0.2"], + ["react-calendar", "virtual:e55f5d8a64d261101d4ce49052d1b4e178c551e22c9d001620c4808dceb69acff3dc375e5436e3048d50cf62bcfeb3a8c2631e92fab243033d7734adf684bf67#npm:3.7.0"], ["react-cookies", "npm:0.1.1"], ["react-dom", "virtual:e55f5d8a64d261101d4ce49052d1b4e178c551e22c9d001620c4808dceb69acff3dc375e5436e3048d50cf62bcfeb3a8c2631e92fab243033d7734adf684bf67#npm:17.0.2"], ["react-is", "npm:17.0.2"], @@ -1015,6 +1017,16 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD", }] ]], + ["@types/react-calendar", [ + ["npm:3.5.0", { + "packageLocation": "./.yarn/cache/@types-react-calendar-npm-3.5.0-2cd1b01015-0dc7eadd0b.zip/node_modules/@types/react-calendar/", + "packageDependencies": [ + ["@types/react-calendar", "npm:3.5.0"], + ["@types/react", "npm:17.0.39"] + ], + "linkType": "HARD", + }] + ]], ["@types/react-cookies", [ ["npm:0.1.0", { "packageLocation": "./.yarn/cache/@types-react-cookies-npm-0.1.0-b56bf6191f-a7d18ad17e.zip/node_modules/@types/react-cookies/", @@ -1226,6 +1238,15 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD", }] ]], + ["@wojtekmaj/date-utils", [ + ["npm:1.0.3", { + "packageLocation": "./.yarn/cache/@wojtekmaj-date-utils-npm-1.0.3-66943d4ae0-70b7152160.zip/node_modules/@wojtekmaj/date-utils/", + "packageDependencies": [ + ["@wojtekmaj/date-utils", "npm:1.0.3"] + ], + "linkType": "HARD", + }] + ]], ["@yarnpkg/lockfile", [ ["npm:1.1.0", { "packageLocation": "./.yarn/cache/@yarnpkg-lockfile-npm-1.1.0-6e0da4acd2-05b881b486.zip/node_modules/@yarnpkg/lockfile/", @@ -3564,6 +3585,16 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD", }] ]], + ["get-user-locale", [ + ["npm:1.4.0", { + "packageLocation": "./.yarn/cache/get-user-locale-npm-1.4.0-5b0d4b8a21-d27a6cf7b1.zip/node_modules/get-user-locale/", + "packageDependencies": [ + ["get-user-locale", "npm:1.4.0"], + ["lodash.once", "npm:4.1.1"] + ], + "linkType": "HARD", + }] + ]], ["glob", [ ["npm:7.1.7", { "packageLocation": "./.yarn/cache/glob-npm-7.1.7-5698ad9c48-b61f48973b.zip/node_modules/glob/", @@ -4453,6 +4484,15 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD", }] ]], + ["lodash.once", [ + ["npm:4.1.1", { + "packageLocation": "./.yarn/cache/lodash.once-npm-4.1.1-d8ba329ead-d768fa9f9b.zip/node_modules/lodash.once/", + "packageDependencies": [ + ["lodash.once", "npm:4.1.1"] + ], + "linkType": "HARD", + }] + ]], ["lodash.sortby", [ ["npm:4.7.0", { "packageLocation": "./.yarn/cache/lodash.sortby-npm-4.7.0-fda8ab950d-db170c9396.zip/node_modules/lodash.sortby/", @@ -4529,6 +4569,15 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD", }] ]], + ["merge-class-names", [ + ["npm:1.4.2", { + "packageLocation": "./.yarn/cache/merge-class-names-npm-1.4.2-aa575a4fce-569c333ab0.zip/node_modules/merge-class-names/", + "packageDependencies": [ + ["merge-class-names", "npm:1.4.2"] + ], + "linkType": "HARD", + }] + ]], ["merge-stream", [ ["npm:2.0.0", { "packageLocation": "./.yarn/cache/merge-stream-npm-2.0.0-2ac83efea5-6fa4dcc8d8.zip/node_modules/merge-stream/", @@ -5609,6 +5658,36 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD", }] ]], + ["react-calendar", [ + ["npm:3.7.0", { + "packageLocation": "./.yarn/cache/react-calendar-npm-3.7.0-1b9ffc08c6-368084515b.zip/node_modules/react-calendar/", + "packageDependencies": [ + ["react-calendar", "npm:3.7.0"] + ], + "linkType": "SOFT", + }], + ["virtual:e55f5d8a64d261101d4ce49052d1b4e178c551e22c9d001620c4808dceb69acff3dc375e5436e3048d50cf62bcfeb3a8c2631e92fab243033d7734adf684bf67#npm:3.7.0", { + "packageLocation": "./.yarn/__virtual__/react-calendar-virtual-76f272f28c/0/cache/react-calendar-npm-3.7.0-1b9ffc08c6-368084515b.zip/node_modules/react-calendar/", + "packageDependencies": [ + ["react-calendar", "virtual:e55f5d8a64d261101d4ce49052d1b4e178c551e22c9d001620c4808dceb69acff3dc375e5436e3048d50cf62bcfeb3a8c2631e92fab243033d7734adf684bf67#npm:3.7.0"], + ["@types/react", "npm:17.0.39"], + ["@types/react-dom", "npm:17.0.11"], + ["@wojtekmaj/date-utils", "npm:1.0.3"], + ["get-user-locale", "npm:1.4.0"], + ["merge-class-names", "npm:1.4.2"], + ["prop-types", "npm:15.8.1"], + ["react", "npm:17.0.2"], + ["react-dom", "virtual:e55f5d8a64d261101d4ce49052d1b4e178c551e22c9d001620c4808dceb69acff3dc375e5436e3048d50cf62bcfeb3a8c2631e92fab243033d7734adf684bf67#npm:17.0.2"] + ], + "packagePeers": [ + "@types/react-dom", + "@types/react", + "react-dom", + "react" + ], + "linkType": "HARD", + }] + ]], ["react-cookies", [ ["npm:0.1.1", { "packageLocation": "./.yarn/cache/react-cookies-npm-0.1.1-f9d7099eb7-a31a7f5e43.zip/node_modules/react-cookies/", @@ -6606,6 +6685,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["@types/node", "npm:17.0.18"], ["@types/prop-types", "npm:15.7.4"], ["@types/react", "npm:17.0.39"], + ["@types/react-calendar", "npm:3.5.0"], ["@types/react-cookies", "npm:0.1.0"], ["@types/react-dom", "npm:17.0.11"], ["@types/react-is", "npm:17.0.3"], @@ -6621,6 +6701,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["postinstall-postinstall", "npm:2.1.0"], ["prop-types", "npm:15.8.1"], ["react", "npm:17.0.2"], + ["react-calendar", "virtual:e55f5d8a64d261101d4ce49052d1b4e178c551e22c9d001620c4808dceb69acff3dc375e5436e3048d50cf62bcfeb3a8c2631e92fab243033d7734adf684bf67#npm:3.7.0"], ["react-cookies", "npm:0.1.1"], ["react-dom", "virtual:e55f5d8a64d261101d4ce49052d1b4e178c551e22c9d001620c4808dceb69acff3dc375e5436e3048d50cf62bcfeb3a8c2631e92fab243033d7734adf684bf67#npm:17.0.2"], ["react-is", "npm:17.0.2"], diff --git a/.yarn/cache/@next-swc-win32-x64-msvc-npm-12.0.4-99b245464a-8.zip b/.yarn/cache/@next-swc-win32-x64-msvc-npm-12.0.4-99b245464a-8.zip new file mode 100644 index 0000000..48ab234 Binary files /dev/null and b/.yarn/cache/@next-swc-win32-x64-msvc-npm-12.0.4-99b245464a-8.zip differ diff --git a/src/assets/plus.svg b/src/assets/plus.svg new file mode 100644 index 0000000..01de6e4 --- /dev/null +++ b/src/assets/plus.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/src/assets/plus_white.svg b/src/assets/plus_white.svg new file mode 100644 index 0000000..068e746 --- /dev/null +++ b/src/assets/plus_white.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/src/components/challengeList/index.tsx b/src/components/challengeList/index.tsx index 5968a13..0ce4fbc 100644 --- a/src/components/challengeList/index.tsx +++ b/src/components/challengeList/index.tsx @@ -3,10 +3,10 @@ import fetcher from "@src/utils/function/fetcher"; import { ChallengeType } from "@src/utils/interfaces/challenge"; import React, { useState } from "react"; import useSWR from "swr"; -import DefaultBox from "../common/defaultBox"; import Dropdown from "../common/dropdown"; import ChallengeCard from "./ChallengeCard"; import Link from "next/link"; +import CreateBox from "../common/createBox"; const optionList = [ { @@ -21,6 +21,8 @@ const optionList = [ const ChallengeList = () => { const [option, setOption] = useState("true"); + const [isHover, setIsHover] = useState(false); + const { data, mutate } = useSWR( "/challenges/web/lists?isProgress=true", fetcher @@ -41,7 +43,7 @@ const ChallengeList = () => { <div>진행 중인 챌린지</div> <Dropdown - width={102} + width={108} height={16} selectedValue={option === "true" ? "진행중" : "완료"} name='name' @@ -57,9 +59,7 @@ const ChallengeList = () => { - - + - + {data.challenge_list?.map((i: ChallengeType) => ( diff --git a/src/components/class/seeClass/Class.tsx b/src/components/class/seeClass/Class.tsx index 1523ae8..54fc976 100644 --- a/src/components/class/seeClass/Class.tsx +++ b/src/components/class/seeClass/Class.tsx @@ -92,7 +92,9 @@ const ClassBanner = () => { - {data.teacher.name} +
+ {data.teacher.name} +

선생님

@@ -168,12 +170,13 @@ const BannerDiv2 = styled.div` `; const TeacherDiv = styled.div` + width: 100%; display: flex; - justify-content: center; align-items: center; margin-left: 54px; > p { - width: 100%; + margin-right: 10px; + width: 50px; color: ${({ theme }) => theme.color.white}; } > img { @@ -183,11 +186,13 @@ const TeacherDiv = styled.div` } `; -const TeacherName = styled.p` - width: 60px; - height: 30px; +const TeacherName = styled.h6` + width: 100%; margin-right: 4px; + height: 30px; font-size: 20px; + font-weight: normal; + color: ${({ theme }) => theme.color.white}; `; const ClassCodeDiv = styled.div` diff --git a/src/components/class/seeClass/ClassStudentList.tsx b/src/components/class/seeClass/ClassStudentList.tsx index 7bda662..e2aad3e 100644 --- a/src/components/class/seeClass/ClassStudentList.tsx +++ b/src/components/class/seeClass/ClassStudentList.tsx @@ -105,7 +105,7 @@ const ClassStudentList: FC = ({ setClassInfo }) => { padding='10px 16px' isBoard={false} /> - 엑셀로 변환 + 엑셀로 변환하기

평균 걸음 수

@@ -158,7 +158,7 @@ const TypeMenuDiv = styled.div` `; const ExcelDonwload = styled.h6` - margin-left: 900px; + margin-left: 880px; text-decoration: underline; color: ${({ theme }) => theme.color.main}; font-size: 14px; diff --git a/src/components/common/createBox/index.tsx b/src/components/common/createBox/index.tsx new file mode 100644 index 0000000..0c79910 --- /dev/null +++ b/src/components/common/createBox/index.tsx @@ -0,0 +1,56 @@ +import styled from "@emotion/styled"; +import React, { FC, useState } from "react"; +import Image from "next/image"; +import Plus from "../../../assets/plus.svg"; +import Plus_White from "../../../assets/plus_white.svg"; + +interface Props { + width: number; + height: number; +} + +const CreateBox: FC = props => { + const [isHover, setIsHover] = useState(false); + + return ( + <> + + setIsHover(true)} + onMouseOut={() => setIsHover(false)} + > + {props.children} + plus + + + + ); +}; + +export default CreateBox; + +const DefaultBoxStyle = styled.div<{ + width: number; + height: number; +}>` + width: ${({ width }) => `${width}px`}; + height: ${({ height }) => `${height}px`}; + border-radius: 12px; + border: 1px solid ${({ theme }) => theme.color.normal_gray}; + display: flex; + flex-direction: column; + justify-content: space-between; + cursor: pointer; +`; + +const PlusBtn = styled.div` + height: 100%; + display: flex; + justify-content: center; + align-items: center; +`; diff --git a/src/components/notice/MakeNotice.tsx b/src/components/notice/MakeNotice.tsx index 3873606..ee7921c 100644 --- a/src/components/notice/MakeNotice.tsx +++ b/src/components/notice/MakeNotice.tsx @@ -47,7 +47,7 @@ const MakeNotice: FC }> = ({ scope: "", }); - const noticeSubmit = async (e: React.FormEvent) => { + const noticeSubmit = async (e: React.MouseEvent) => { e.preventDefault(); try { await createNotice( @@ -73,11 +73,9 @@ const MakeNotice: FC }> = ({ case 400: return ToastError("모든 빈칸을 채워주세요"); case 401: - return ToastError("인증에 실패하였습니다. "); + return ToastError("인증에 실패하였습니다."); case 403: - return ToastError( - "권한이 존재하지 않습니다. 공지사항 작성은 ROOT 권한과 SU권한만 사용 가능합니다." - ); + return ToastError("권한이 존재하지 않습니다."); default: return ToastError("관리자에게 문의해주세요."); } @@ -113,7 +111,7 @@ const MakeNotice: FC }> = ({ return ( <> - + {isAuth ? ( }> = ({ defaultColor={false} value='취소' /> - + ); }; -const Wrapper = styled.form` +const Wrapper = styled.div` width: 100%; padding: 40px 27px 40px 27px; border-radius: 12px; diff --git a/src/components/notice/index.tsx b/src/components/notice/index.tsx index 0e39b79..0c8985a 100644 --- a/src/components/notice/index.tsx +++ b/src/components/notice/index.tsx @@ -5,6 +5,7 @@ import MakeNotice from "./MakeNotice"; import useSWR from "swr"; import fetcher from "@src/utils/function/fetcher"; import { NoticeType } from "@src/utils/interfaces/notice"; +import useAuthCheck from "@src/hooks/useAuthCheck"; const Notice = () => { const [makeState, setMakeState] = useState(true); @@ -17,18 +18,21 @@ const Notice = () => { fetcher ); + const { isAuth } = useAuthCheck(["ROOT", "SU"]); + if (!(data || error)) { return
로딩중
; } else return ( - {makeState ? ( - - 공지사항 작성하기... - - ) : ( - - )} + {isAuth && + (makeState ? ( + + 공지사항 작성하기... + + ) : ( + + ))}

공지