From e942b14564c5a915104942b39c70a3f258f87756 Mon Sep 17 00:00:00 2001 From: Hyunmin Jung Date: Thu, 25 Nov 2021 21:21:20 +0900 Subject: [PATCH] =?UTF-8?q?Refactor:=20Grid=EC=97=90=EC=84=9C=20margin=20p?= =?UTF-8?q?adding=20=EB=B9=BC=EA=B3=A0=20=EC=8A=A4=ED=83=80=EC=9D=BC=20?= =?UTF-8?q?=EB=8C=80=ED=8F=AD=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/DashboardJobObjectives/index.tsx | 2 +- frontend/src/components/ExternalPreview/style.ts | 3 ++- frontend/src/components/Grid/index.ts | 16 ---------------- frontend/src/components/Post/index.tsx | 2 +- frontend/src/components/PostDetail/style.ts | 2 -- .../cards/DashboardBasicCard/index.tsx | 13 ++++++------- .../components/cards/DashboardLinkCard/index.tsx | 7 ++----- .../cards/DashboardTechStacksCard/index.tsx | 7 ++----- .../components/contents/ProblemContent/index.tsx | 6 +++--- .../components/contents/RepoContent/index.tsx | 8 ++++---- .../src/components/modals/BlogsModal/index.tsx | 3 --- .../src/components/modals/BlogsModal/style.ts | 3 ++- .../components/modals/PostWriteModal/index.tsx | 8 ++++---- .../components/modals/PostWriteModal/style.ts | 15 +++++++-------- .../components/modals/ProblemsModal/index.tsx | 3 --- .../src/components/modals/ProblemsModal/style.ts | 3 ++- .../src/components/modals/ReposModal/index.tsx | 3 --- .../src/components/modals/ReposModal/style.ts | 3 ++- 18 files changed, 38 insertions(+), 69 deletions(-) diff --git a/frontend/src/components/DashboardJobObjectives/index.tsx b/frontend/src/components/DashboardJobObjectives/index.tsx index fec5857c..ee59216c 100644 --- a/frontend/src/components/DashboardJobObjectives/index.tsx +++ b/frontend/src/components/DashboardJobObjectives/index.tsx @@ -15,7 +15,7 @@ function DashboardJobObjectives({ jobObjectives, onDeleteJobObjective }: Props) return ( desired job - + {jobObjectives.map((jobObjective) => (

{jobObjective}

diff --git a/frontend/src/components/ExternalPreview/style.ts b/frontend/src/components/ExternalPreview/style.ts index 110ae182..c77b83cc 100644 --- a/frontend/src/components/ExternalPreview/style.ts +++ b/frontend/src/components/ExternalPreview/style.ts @@ -3,6 +3,7 @@ import styled from '@emotion/styled'; const Wrapper = styled.div` position: relative; height: 100px; + width: 360px; overflow-y: hidden; border-radius: 16px; padding: 16px; @@ -13,7 +14,7 @@ const Cover = styled.div` right: 0; left: 0; bottom: 0; - background: linear-gradient(rgba(0, 0, 0, 0), rgba(18, 18, 18, 1)); + background: linear-gradient(rgba(0, 0, 0, 0), rgba(13, 13, 13, 1)); `; const LinkButton = styled.a` diff --git a/frontend/src/components/Grid/index.ts b/frontend/src/components/Grid/index.ts index d1eaf210..727e7590 100644 --- a/frontend/src/components/Grid/index.ts +++ b/frontend/src/components/Grid/index.ts @@ -3,12 +3,6 @@ import styled from '@emotion/styled'; interface Props { justifyContent?: string; alignItems?: string; - margin?: number; - marginTop?: number; - marginBottom?: number; - marginLeft?: number; - marginRight?: number; - padding?: number; expanded?: boolean; } @@ -17,13 +11,7 @@ const Row = styled.div` flex-direction: row; justify-content: ${({ justifyContent }) => justifyContent}; align-items: ${({ alignItems }) => alignItems}; - margin: ${({ margin }) => `${margin}px`}; - padding: ${({ padding }) => `${padding}px`}; width: ${({ expanded }) => (expanded === true ? '100%' : 'unset')}; - margin-top: ${({ marginTop }) => (marginTop ? `${marginTop}px` : `unset`)}; - margin-bottom: ${({ marginBottom }) => (marginBottom ? `${marginBottom}px` : `unset`)}; - margin-left: ${({ marginLeft }) => (marginLeft ? `${marginLeft}px` : `unset`)}; - margin-right: ${({ marginRight }) => (marginRight ? `${marginRight}px` : `unset`)}; `; const Col = styled.div` @@ -31,8 +19,6 @@ const Col = styled.div` flex-direction: column; align-items: ${({ alignItems }) => alignItems}; justify-content: ${({ justifyContent }) => justifyContent}; - margin: ${({ margin }) => `${margin}px`}; - padding: ${({ padding }) => `${padding}px`}; height: ${({ expanded }) => (expanded === true ? '100%' : 'unset')}; `; @@ -43,13 +29,11 @@ const Spacer = styled.div` Row.defaultProps = { justifyContent: 'unset', alignItems: 'unset', - margin: 0, }; Col.defaultProps = { justifyContent: 'unset', alignItems: 'unset', - margin: 0, }; export { Row, Col, Spacer }; diff --git a/frontend/src/components/Post/index.tsx b/frontend/src/components/Post/index.tsx index 5c27586f..bbfee23b 100644 --- a/frontend/src/components/Post/index.tsx +++ b/frontend/src/components/Post/index.tsx @@ -47,7 +47,7 @@ function Post({ post, onPostDelete }: Props) { return ( - + diff --git a/frontend/src/components/PostDetail/style.ts b/frontend/src/components/PostDetail/style.ts index e14280be..5b49c45b 100644 --- a/frontend/src/components/PostDetail/style.ts +++ b/frontend/src/components/PostDetail/style.ts @@ -1,7 +1,5 @@ import styled from '@emotion/styled'; -import PostComments from 'src/components/PostComments'; - import { POST_WIDTH } from 'src/globals/constants'; import { ThemeType } from 'src/types'; diff --git a/frontend/src/components/cards/DashboardBasicCard/index.tsx b/frontend/src/components/cards/DashboardBasicCard/index.tsx index 3e63909a..3b85e484 100644 --- a/frontend/src/components/cards/DashboardBasicCard/index.tsx +++ b/frontend/src/components/cards/DashboardBasicCard/index.tsx @@ -19,7 +19,6 @@ import { USER_INFO_PROFILE_IMAGE_MARGIN_RIGHT, DASHBOARD_LEFT_SECTION_CARD_WIDTH, DASHBOARD_USER_INFO_ICON_SIZE, - DASHBOARD_USER_INFO_COL_MARGIN, } from 'src/globals/constants'; import dashboardUserInfoAtom from 'src/recoil/dashboardUserInfo'; @@ -49,14 +48,14 @@ function DashboardBasicCard() { - + 이름 {name} - + 연락처 {phoneNumber} @@ -65,14 +64,14 @@ function DashboardBasicCard() { - + 생년 월일 {getBirthdayFormat(birthday)} - + 이메일 {email} @@ -81,14 +80,14 @@ function DashboardBasicCard() { - + 주소지 {region} - + 학력 {school} diff --git a/frontend/src/components/cards/DashboardLinkCard/index.tsx b/frontend/src/components/cards/DashboardLinkCard/index.tsx index 82008f50..f97bbf65 100644 --- a/frontend/src/components/cards/DashboardLinkCard/index.tsx +++ b/frontend/src/components/cards/DashboardLinkCard/index.tsx @@ -5,10 +5,7 @@ import CardCommon from 'src/components/cards/Common'; import DashboardLinkSettingButton from 'src/components/buttons/dashboardSettings/DashboardLinkSettingButton'; import { Row, Col } from 'src/components/Grid'; -import { - DASHBOARD_RIGHT_SECTION_CARD_WIDTH, - DASHBOARD_LINK_ROW_PADDING, -} from 'src/globals/constants'; +import { DASHBOARD_RIGHT_SECTION_CARD_WIDTH } from 'src/globals/constants'; import userAtom from 'src/recoil/user'; import dashboardUserInfoAtom from 'src/recoil/dashboardUserInfo'; @@ -25,7 +22,7 @@ function DashboardLinkCard() { return ( - + 희망 직군 diff --git a/frontend/src/components/cards/DashboardTechStacksCard/index.tsx b/frontend/src/components/cards/DashboardTechStacksCard/index.tsx index b2fb0172..3acf7427 100644 --- a/frontend/src/components/cards/DashboardTechStacksCard/index.tsx +++ b/frontend/src/components/cards/DashboardTechStacksCard/index.tsx @@ -4,10 +4,7 @@ import CardCommon from 'src/components/cards/Common'; import DashboardTechStacksSettingButton from 'src/components/buttons/dashboardSettings/DashboardTechStacksSettingButton'; import { Col, Row } from 'src/components/Grid'; -import { - DASHBOARD_LEFT_SECTION_CARD_WIDTH, - DASHBOARD_STACK_GRID_PADDING, -} from 'src/globals/constants'; +import { DASHBOARD_LEFT_SECTION_CARD_WIDTH } from 'src/globals/constants'; import { dashboardTechStacksSelector } from 'src/recoil/dashboardUserInfo'; @@ -20,7 +17,7 @@ function DashboardTechStacksCard() { return ( - + {fields.map((field) => ( {field} diff --git a/frontend/src/components/contents/ProblemContent/index.tsx b/frontend/src/components/contents/ProblemContent/index.tsx index 2e4eede4..549eda59 100644 --- a/frontend/src/components/contents/ProblemContent/index.tsx +++ b/frontend/src/components/contents/ProblemContent/index.tsx @@ -18,9 +18,9 @@ function ProblemContent({ content, info, link, title }: Props) { <>

{title}

-

티어 {info.tear}

-

푼 사람 {info.solvedUserCount}

-

시도 횟수 {info.totalTryCount}

+

티어 {info?.tear}

+

푼 사람 {info?.solvedUserCount}

+

시도 횟수 {info?.totalTryCount}

{/* eslint-disable-next-line react/no-danger */}
diff --git a/frontend/src/components/contents/RepoContent/index.tsx b/frontend/src/components/contents/RepoContent/index.tsx index d102e2e4..5415da3b 100644 --- a/frontend/src/components/contents/RepoContent/index.tsx +++ b/frontend/src/components/contents/RepoContent/index.tsx @@ -18,12 +18,12 @@ function RepoContent({ content, link, info, title }: Props) { <>

{title}

-

별 {info.starCount}

-

포크 {info.forkCount}

- {Object.keys(info.language ?? {}).map((language) => ( +

별 {info?.starCount}

+

포크 {info?.forkCount}

+ {Object.keys(info?.language ?? {}).map((language) => (

{language}

-

{info.language[language]}%

+

{info?.language[language]}%

))}
diff --git a/frontend/src/components/modals/BlogsModal/index.tsx b/frontend/src/components/modals/BlogsModal/index.tsx index 9d085170..a4b58f01 100644 --- a/frontend/src/components/modals/BlogsModal/index.tsx +++ b/frontend/src/components/modals/BlogsModal/index.tsx @@ -10,8 +10,6 @@ import { Col } from 'src/components/Grid'; import { Fetcher } from 'src/utils'; -import { EXTERNAL_MODAL_HEIGHT } from 'src/globals/constants'; - import { BlogType } from 'src/types'; import userAtom from 'src/recoil/user'; @@ -49,7 +47,6 @@ function BlogsModal({ onClose, onSelect }: Props) { onClose={onClose} close='취소' confirm='선택' - height={EXTERNAL_MODAL_HEIGHT} onConfirm={handleConfirm} disabled={selectedIndex === -1} title={hasExternalBlog ? '게시글을 선택하세요' : '연동된 블로그가 없습니다'} diff --git a/frontend/src/components/modals/BlogsModal/style.ts b/frontend/src/components/modals/BlogsModal/style.ts index e8617020..bc79e2e7 100644 --- a/frontend/src/components/modals/BlogsModal/style.ts +++ b/frontend/src/components/modals/BlogsModal/style.ts @@ -6,7 +6,8 @@ const Wrapper = styled.div` `; const Blogs = styled.div` - height: 200px; + height: 400px; + width: 350px; overflow-y: scroll; padding: 16px; `; diff --git a/frontend/src/components/modals/PostWriteModal/index.tsx b/frontend/src/components/modals/PostWriteModal/index.tsx index f5e08c4d..893536f1 100644 --- a/frontend/src/components/modals/PostWriteModal/index.tsx +++ b/frontend/src/components/modals/PostWriteModal/index.tsx @@ -44,22 +44,22 @@ function PostWriteModal({ onClose, onPostWrite }: Props) { }); const problemMutation = useMutation((id: string) => Fetcher.getProblem(id), { onSuccess: (problem: ExternalType) => { - setExternal(problem); setExternalType('problem'); + setExternal(problem); }, }); const repoMutation = useMutation((name: string) => Fetcher.getUserRepo(user, name), { onSuccess: (repo: ExternalType) => { - setExternal(repo); setExternalType('repo'); + setExternal(repo); }, }); const blogMutation = useMutation( (blog: BlogType) => Fetcher.getUserBlog(user, blog.identity, blog.postID), { onSuccess: (blog: ExternalType) => { - setExternal(blog); setExternalType('blog'); + setExternal(blog); }, }, ); @@ -129,7 +129,7 @@ function PostWriteModal({ onClose, onPostWrite }: Props) { onClose={onClose} disabled={content.trim() === ''} > - + diff --git a/frontend/src/components/modals/PostWriteModal/style.ts b/frontend/src/components/modals/PostWriteModal/style.ts index 99d0868f..f1fdaca9 100644 --- a/frontend/src/components/modals/PostWriteModal/style.ts +++ b/frontend/src/components/modals/PostWriteModal/style.ts @@ -1,14 +1,13 @@ import styled from '@emotion/styled'; const Textarea = styled.textarea` - width: 100%; + width: 360px; height: 164px; - border: none; border-radius: 36px; padding: 24px; - margin-bottom: 36px; - background: #1e1e1e; - box-shadow: inset 5px 5px 11px #1a1a1a, inset -5px -5px 11px #232323; + margin: 24px 0; + background: #444444; + box-shadow: inset 5px 5px 10px #3a3a3a, inset -5px -5px 10px #4e4e4e; resize: none; font-size: 16px; `; @@ -17,13 +16,13 @@ const IconHolder = styled.div` display: flex; align-items: center; justify-content: center; - align-self: start; + align-self: center; width: 48px; height: 48px; border-radius: 12px; background: #444444; - box-shadow: 11px 11px 21px #3a3a3a, -11px -11px 21px #4e4e4e; - margin-right: 12px; + box-shadow: 4px 4px 8px #3a3a3a, -4px -4px 8px #4e4e4e; + margin: 0 12px; `; export { Textarea, IconHolder }; diff --git a/frontend/src/components/modals/ProblemsModal/index.tsx b/frontend/src/components/modals/ProblemsModal/index.tsx index d87a9276..a5e298c8 100644 --- a/frontend/src/components/modals/ProblemsModal/index.tsx +++ b/frontend/src/components/modals/ProblemsModal/index.tsx @@ -9,8 +9,6 @@ import { Col, Row } from 'src/components/Grid'; import { Fetcher } from 'src/utils'; -import { EXTERNAL_MODAL_HEIGHT } from 'src/globals/constants'; - import { ProblemType } from 'src/types'; import { Wrapper, Problems } from './style'; @@ -47,7 +45,6 @@ function ProblemsModal({ onClose, onSelect }: Props) { onClose={onClose} close='취소' confirm='선택' - height={EXTERNAL_MODAL_HEIGHT} onConfirm={handleConfirm} disabled={selectedIndex === -1} title='문제를 검색하고 선택하세요' diff --git a/frontend/src/components/modals/ProblemsModal/style.ts b/frontend/src/components/modals/ProblemsModal/style.ts index 77289d67..f4388b4e 100644 --- a/frontend/src/components/modals/ProblemsModal/style.ts +++ b/frontend/src/components/modals/ProblemsModal/style.ts @@ -6,7 +6,8 @@ const Wrapper = styled.div` `; const Problems = styled.div` - height: 200px; + height: 400px; + width: 350px; overflow-y: scroll; padding: 16px; `; diff --git a/frontend/src/components/modals/ReposModal/index.tsx b/frontend/src/components/modals/ReposModal/index.tsx index 159d69bd..14b70476 100644 --- a/frontend/src/components/modals/ReposModal/index.tsx +++ b/frontend/src/components/modals/ReposModal/index.tsx @@ -12,8 +12,6 @@ import userAtom from 'src/recoil/user'; import { Fetcher } from 'src/utils'; -import { REPOS_MODAL_HEIGHT } from 'src/globals/constants'; - import { RepoType } from 'src/types'; import { Wrapper, Repos } from './style'; @@ -48,7 +46,6 @@ function ReposModal({ onClose, onSelect }: Props) { onConfirm={handleConfirm} close='취소' confirm='선택' - height={REPOS_MODAL_HEIGHT} onClose={onClose} disabled={selectedIndex === -1} title={hasExternalGithub ? '저장소를 선택하세요' : '연동된 깃헙이 없습니다'} diff --git a/frontend/src/components/modals/ReposModal/style.ts b/frontend/src/components/modals/ReposModal/style.ts index 16fe300f..55aa9984 100644 --- a/frontend/src/components/modals/ReposModal/style.ts +++ b/frontend/src/components/modals/ReposModal/style.ts @@ -6,8 +6,9 @@ const Wrapper = styled.div` `; const Repos = styled.div` - overflow-y: scroll; height: 400px; + width: 350px; + overflow-y: scroll; `; export { Wrapper, Repos };