Skip to content

Commit

Permalink
Merge pull request #2 from Original-Gimchi/refactor/code-review
Browse files Browse the repository at this point in the history
FIX : children 컴포넌트 공급 오류 수정
  • Loading branch information
Ubinquitous authored Mar 26, 2023
2 parents fd7c59c + bfb2640 commit ac07631
Show file tree
Hide file tree
Showing 15 changed files with 78 additions and 48 deletions.
14 changes: 7 additions & 7 deletions pages/404.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import * as C from '@/components'
import * as S from '../layout/index.style'

import React from 'react'
import { NextSeoProps } from 'next-seo'
import { NextSeo, NextSeoProps } from 'next-seo'
import { Aside, Board, ScrollBtn } from '@/components'

const NotFound = () => {
const seoConfig: NextSeoProps = {
Expand All @@ -22,14 +22,14 @@ const NotFound = () => {

return (
<>
<C.Header />
<NextSeo {...seoConfig} />
<S.NotFoundWrap>
<C.Board>
<Board>
<S.NotFound>404 Not Found</S.NotFound>
</C.Board>
<C.Aside />
</Board>
<Aside />
<ScrollBtn />
</S.NotFoundWrap>
<C.Footer />
</>
)
}
Expand Down
7 changes: 4 additions & 3 deletions pages/accident/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import React, { PropsWithChildren } from 'react'
import Docs from '@/types/docs.type'
import DocsPropsType from '@/types/static/docs.props.type'
import { NextSeo, NextSeoProps } from 'next-seo'
import { AccodianMenu, Board, Classify, SubFooter } from '@/components'
import { AccodianMenu, Aside, Board, Classify, ScrollBtn, SubFooter } from '@/components'

const Accident = ({ docs, years }: DocsPropsType, { children }: PropsWithChildren) => {
const Accident = ({ docs, years }: DocsPropsType) => {
const seoConfig: NextSeoProps = {
title: '부마위키 - 사건/사고',
description: '교내에서 일어나는 모든 사건/사고를 담은 페이지입니다.',
Expand Down Expand Up @@ -52,7 +52,8 @@ const Accident = ({ docs, years }: DocsPropsType, { children }: PropsWithChildre
</S.AccidentListWrap>
<SubFooter />
</Board>
{children}
<ScrollBtn />
<Aside />
</S.AccidentWrap>
</>
)
Expand Down
7 changes: 4 additions & 3 deletions pages/club/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import * as getApi from '@/api/getDocs'
import React, { PropsWithChildren } from 'react'
import Docs from '@/types/docs.type'
import { NextSeo, NextSeoProps } from 'next-seo'
import { AccodianMenu, Board, Classify, SubFooter } from '@/components'
import { AccodianMenu, Aside, Board, Classify, ScrollBtn, SubFooter } from '@/components'

interface ClubDocsPropsType {
docs: {
Expand All @@ -13,7 +13,7 @@ interface ClubDocsPropsType {
}
}

const Club = ({ docs }: ClubDocsPropsType, { children }: PropsWithChildren) => {
const Club = ({ docs }: ClubDocsPropsType) => {
const seoConfig: NextSeoProps = {
title: '부마위키 - 동아리',
description: '교내에서 활동하는 모든 동아리를 담은 페이지입니다.',
Expand Down Expand Up @@ -64,7 +64,8 @@ const Club = ({ docs }: ClubDocsPropsType, { children }: PropsWithChildren) => {
</S.ClubListWrap>
<SubFooter />
</Board>
{children}
<ScrollBtn />
<Aside />
</S.ClubWrap>
</>
)
Expand Down
7 changes: 4 additions & 3 deletions pages/create/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ import createInitState from '@/state/createInitState'
import createDocsForm from '@/utils/document/createDocsForm'
import { NextSeo, NextSeoProps } from 'next-seo'
import useUser from '@/hooks/useUser'
import { Board, SubFooter } from '@/components'
import { Aside, Board, ScrollBtn, SubFooter } from '@/components'
import createFormInitState from '@/state/createFormInitState'

const Create = ({ children }: PropsWithChildren) => {
const Create = () => {
const router = useRouter()
const { query } = router
const years = util.getAllYear()
Expand Down Expand Up @@ -206,7 +206,8 @@ const Create = ({ children }: PropsWithChildren) => {
</S.CreateSubmit>
<SubFooter />
</Board>
{children}
<ScrollBtn />
<Aside />
</S.CreateWrap>
</>
)
Expand Down
7 changes: 4 additions & 3 deletions pages/frame/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import React, { PropsWithChildren } from 'react'
import Docs from '@/types/docs.type'
import DocsPropsType from '@/types/static/docs.props.type'
import { NextSeo, NextSeoProps } from 'next-seo'
import { AccodianMenu, Board, Classify, SubFooter } from '@/components'
import { AccodianMenu, Aside, Board, Classify, ScrollBtn, SubFooter } from '@/components'

const Frame = ({ docs }: DocsPropsType, { children }: PropsWithChildren) => {
const Frame = ({ docs }: DocsPropsType) => {
const seoConfig: NextSeoProps = {
title: `부마위키 - 틀`,
description: `부마위키의 모든 틀을 담은 페이지입니다.`,
Expand Down Expand Up @@ -48,7 +48,8 @@ const Frame = ({ docs }: DocsPropsType, { children }: PropsWithChildren) => {
</S.FrameListWrap>
<SubFooter />
</Board>
{children}
<ScrollBtn />
<Aside />
</S.FrameWrap>
</>
)
Expand Down
17 changes: 17 additions & 0 deletions pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,27 @@ import * as S from '../layout/index.style'

import React from 'react'
import { AccodianMenu, Aside, Board, Classify, ScrollBtn, SubFooter } from '@/components'
import { NextSeo, NextSeoProps } from 'next-seo'

const Home = () => {
const seoConfig: NextSeoProps = {
title: `부마위키 - 대문`,
description: `역사의 고서, 부마위키`,
openGraph: {
type: 'website',
title: `부마위키 - 대문`,
description: `역사의 고서, 부마위키`,
images: [
{
url: '/images/meta-img.png',
},
],
},
}

return (
<>
<NextSeo {...seoConfig} />
<S.HomeWrap>
<Board>
<S.HomeTitleWrap>
Expand Down
7 changes: 4 additions & 3 deletions pages/mypage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import { useRecoilValue, useSetRecoilState } from 'recoil'
import Contributors from '@/types/contributors.type'
import { Storage } from '@/lib/storage/storage'
import { NextSeo, NextSeoProps } from 'next-seo'
import { AccodianMenu, Board, Classify } from '@/components'
import { AccodianMenu, Aside, Board, Classify, ScrollBtn } from '@/components'

const MyPage = ({ children }: PropsWithChildren) => {
const MyPage = () => {
const user = useRecoilValue(userState)
const setUser = useSetRecoilState(userState)

Expand Down Expand Up @@ -91,7 +91,8 @@ const MyPage = ({ children }: PropsWithChildren) => {
)}
</S.MyPageInfoWrap>
</Board>
{children}
<ScrollBtn />
<Aside />
</S.MyPageWrap>
</>
)
Expand Down
9 changes: 5 additions & 4 deletions pages/popular/index.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import * as getApi from '@/api/getDocs'
import * as S from '../../layout/popular/style'

import React, { PropsWithChildren } from 'react'
import React from 'react'
import Docs from '@/types/docs.type'
import DocsPropsType from '@/types/static/docs.props.type'
import { NextSeo, NextSeoProps } from 'next-seo'
import { AccodianMenu, Board, Classify, SubFooter } from '@/components'
import { AccodianMenu, Aside, Board, Classify, ScrollBtn, SubFooter } from '@/components'

const Popular = ({ docs }: DocsPropsType, { children }: PropsWithChildren) => {
const Popular = ({ docs }: DocsPropsType) => {
const seoConfig: NextSeoProps = {
title: `부마위키 - 인기문서`,
description: `부마위키 문서 중 인기있는 문서를 담은 페이지입니다.`,
Expand Down Expand Up @@ -50,7 +50,8 @@ const Popular = ({ docs }: DocsPropsType, { children }: PropsWithChildren) => {
</S.PopularListWrap>
<SubFooter />
</Board>
{children}
<ScrollBtn />
<Aside />
</S.PopularWrap>
</>
)
Expand Down
7 changes: 4 additions & 3 deletions pages/search/[search].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ import Docs from '@/types/docs.type'
import { useRouter } from 'next/router'
import { GetStaticProps } from 'next'
import { NextSeo, NextSeoProps } from 'next-seo'
import { Board, Classify, SubFooter } from '@/components'
import { Aside, Board, Classify, ScrollBtn, SubFooter } from '@/components'

interface SingleDocsPropsType {
results: Docs[]
redirect: boolean
searchValue: string
}

const Search = ({ results, redirect, searchValue }: SingleDocsPropsType, { children }: PropsWithChildren) => {
const Search = ({ results, redirect, searchValue }: SingleDocsPropsType) => {
const router = useRouter()

const seoConfig: NextSeoProps = {
Expand Down Expand Up @@ -73,7 +73,8 @@ const Search = ({ results, redirect, searchValue }: SingleDocsPropsType, { child
</S.SearchResult>
<SubFooter />
</Board>
{children}
<ScrollBtn />
<Aside />
</S.SearchWrap>
</>
)
Expand Down
7 changes: 4 additions & 3 deletions pages/student/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import React, { PropsWithChildren } from 'react'
import Docs from '@/types/docs.type'
import DocsPropsType from '@/types/static/docs.props.type'
import { NextSeo, NextSeoProps } from 'next-seo'
import { AccodianMenu, Board, Classify, SubFooter } from '@/components'
import { AccodianMenu, Aside, Board, Classify, ScrollBtn, SubFooter } from '@/components'

const Student = ({ docs, years }: DocsPropsType, { children }: PropsWithChildren) => {
const Student = ({ docs, years }: DocsPropsType) => {
const seoConfig: NextSeoProps = {
title: `부마위키 - 학생`,
description: `교내의 모든 학생을 담은 페이지입니다.`,
Expand Down Expand Up @@ -53,7 +53,8 @@ const Student = ({ docs, years }: DocsPropsType, { children }: PropsWithChildren
</S.StudentListWrap>
<SubFooter />
</Board>
{children}
<ScrollBtn />
<Aside />
</S.StudentWrap>
</>
)
Expand Down
7 changes: 4 additions & 3 deletions pages/teacher/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import * as getApi from '@/api/getDocs'
import React, { PropsWithChildren } from 'react'
import Docs from '@/types/docs.type'
import { NextSeo, NextSeoProps } from 'next-seo'
import { AccodianMenu, Board, Classify, SubFooter } from '@/components'
import { AccodianMenu, Aside, Board, Classify, ScrollBtn, SubFooter } from '@/components'

interface TeacherDocsPropsType {
docs: {
Expand All @@ -14,7 +14,7 @@ interface TeacherDocsPropsType {
}
}

const Teacher = ({ docs }: TeacherDocsPropsType, { children }: PropsWithChildren) => {
const Teacher = ({ docs }: TeacherDocsPropsType) => {
const seoConfig: NextSeoProps = {
title: `부마위키 - 선생님`,
description: `교내의 모든 선생님을 담은 페이지입니다.`,
Expand Down Expand Up @@ -75,7 +75,8 @@ const Teacher = ({ docs }: TeacherDocsPropsType, { children }: PropsWithChildren
</S.TeacherList>
<SubFooter />
</Board>
{children}
<ScrollBtn />
<Aside />
</S.TeacherWrap>
</>
)
Expand Down
7 changes: 4 additions & 3 deletions pages/update/[title].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import Docs from '@/types/docs.type'
import { GetStaticProps } from 'next'
import { Storage } from '@/lib/storage/storage'
import { NextSeo, NextSeoProps } from 'next-seo'
import { Board, SubFooter } from '@/components'
import { Aside, Board, ScrollBtn, SubFooter } from '@/components'
import Image from 'next/image'
import theme from '@/styles/theme'

Expand All @@ -25,7 +25,7 @@ interface SinglDocsPropsType {
title: string
}

const Update = ({ defaultDocs, title }: SinglDocsPropsType, { children }: PropsWithChildren) => {
const Update = ({ defaultDocs, title }: SinglDocsPropsType) => {
const router = useRouter()
const user = useRecoilValue(userState)
const textareaRef = React.useRef<HTMLTextAreaElement>(null)
Expand Down Expand Up @@ -150,7 +150,8 @@ const Update = ({ defaultDocs, title }: SinglDocsPropsType, { children }: PropsW
</S.DocsContentsWrap>
<SubFooter />
</Board>
{children}
<ScrollBtn />
<Aside />
</S.DocsWrap>
</>
)
Expand Down
7 changes: 4 additions & 3 deletions pages/user/[userId].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import { useQuery } from 'react-query'
import UserType from '@/types/user.type'
import { useRouter } from 'next/router'
import { NextSeo, NextSeoProps } from 'next-seo'
import { AccodianMenu, Aside, Board, Classify } from '@/components'
import { AccodianMenu, Aside, Board, Classify, ScrollBtn } from '@/components'

const User = ({ children }: PropsWithChildren) => {
const User = () => {
const [user, setUser] = React.useState<UserType>()
const router = useRouter()
useQuery('otherUser', () => api.getOtherUser(parseInt(router.query.userId as string)), {
Expand Down Expand Up @@ -70,7 +70,8 @@ const User = ({ children }: PropsWithChildren) => {
<S.UserLine />
</S.UserInfoWrap>
</Board>
{children}
<ScrollBtn />
<Aside />
</S.UserWrap>
</div>
)
Expand Down
7 changes: 4 additions & 3 deletions pages/version/[docs]/detail/[versionId].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { VersionDocsService } from '@/types/version.type'
import { decodeContents } from '@/utils/document/requestContents'
import { GetStaticProps } from 'next'
import { NextSeo, NextSeoProps } from 'next-seo'
import { AccodianMenu, Board, Classify, SubFooter } from '@/components'
import { AccodianMenu, Aside, Board, Classify, ScrollBtn, SubFooter } from '@/components'

interface VersionDetailPropsType {
title: string
Expand All @@ -16,7 +16,7 @@ interface VersionDetailPropsType {
versionId: string
}

const VersionDetail = ({ title, docsType, docs, versionId }: VersionDetailPropsType, { children }: PropsWithChildren) => {
const VersionDetail = ({ title, docsType, docs, versionId }: VersionDetailPropsType) => {
const seoConfig: NextSeoProps = {
title: `부마위키 문서 기록 - ${title}:${versionId}`,
description: `"${title}" 문서의 예전 기록 페이지입니다.`,
Expand Down Expand Up @@ -64,7 +64,8 @@ const VersionDetail = ({ title, docsType, docs, versionId }: VersionDetailPropsT
</S.DocsContentsWrap>
<SubFooter />
</Board>
{children}
<ScrollBtn />
<Aside />
</S.DocsWrap>
</div>
)
Expand Down
9 changes: 5 additions & 4 deletions pages/version/[docs]/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@ import * as util from '@/utils'
import * as S from '../../../layout/docs/style'
import * as V from '../../../layout/version/style'

import React, { PropsWithChildren } from 'react'
import React from 'react'
import { VersionDocs } from '@/types/version.type'
import { GetStaticProps } from 'next'
import { NextSeo, NextSeoProps } from 'next-seo'
import { Board, SubFooter } from '@/components'
import { Aside, Board, ScrollBtn, SubFooter } from '@/components'

interface SingleDocsPropsType {
version: VersionDocs[]
docsName: string
}

const Version = ({ version, docsName }: SingleDocsPropsType, { children }: PropsWithChildren) => {
const Version = ({ version, docsName }: SingleDocsPropsType) => {
const seoConfig: NextSeoProps = {
title: `부마위키 문서 수정 기록 - ${docsName}`,
description: `"${docsName}" 문서의 수정 기록 페이지입니다.`,
Expand Down Expand Up @@ -55,7 +55,8 @@ const Version = ({ version, docsName }: SingleDocsPropsType, { children }: Props
</S.DocsContentsWrap>
<SubFooter />
</Board>
{children}
<ScrollBtn />
<Aside />
</S.DocsWrap>
</>
)
Expand Down

0 comments on commit ac07631

Please sign in to comment.