Skip to content

Commit

Permalink
Merge pull request #212 from boostcampwm-2021/feature/fe/egg-debounce
Browse files Browse the repository at this point in the history
Grid์—์„œ margin padding ๋นผ๊ณ  ์Šคํƒ€์ผ ๋Œ€ํญ ์ˆ˜์ •
  • Loading branch information
beomseok37 authored Nov 25, 2021
2 parents 10d8308 + e942b14 commit 3420f9b
Show file tree
Hide file tree
Showing 18 changed files with 38 additions and 69 deletions.
2 changes: 1 addition & 1 deletion frontend/src/components/DashboardJobObjectives/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function DashboardJobObjectives({ jobObjectives, onDeleteJobObjective }: Props)
return (
<Wrapper>
<Title>desired job</Title>
<Col padding={16} alignItems='flex-end'>
<Col alignItems='flex-end'>
{jobObjectives.map((jobObjective) => (
<Row key={jobObjective} alignItems='center'>
<p>{jobObjective}</p>
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/components/ExternalPreview/style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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`
Expand Down
16 changes: 0 additions & 16 deletions frontend/src/components/Grid/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -17,22 +11,14 @@ const Row = styled.div<Props>`
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<Props>`
display: flex;
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')};
`;

Expand All @@ -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 };
2 changes: 1 addition & 1 deletion frontend/src/components/Post/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function Post({ post, onPostDelete }: Props) {

return (
<CardCommon width={POST_WIDTH}>
<Row alignItems='center' marginBottom={10}>
<Row alignItems='center'>
<ProfileSet profileImage={targetUser!.profileImage} username={targetUser!.username!} />
<TimeFromNow time={createdAt!} />
<Spacer />
Expand Down
2 changes: 0 additions & 2 deletions frontend/src/components/PostDetail/style.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
13 changes: 6 additions & 7 deletions frontend/src/components/cards/DashboardBasicCard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -49,14 +48,14 @@ function DashboardBasicCard() {
<Col>
<Row alignItems='center'>
<IoPersonOutline size={DASHBOARD_USER_INFO_ICON_SIZE} />
<Col margin={DASHBOARD_USER_INFO_COL_MARGIN}>
<Col>
<Content>์ด๋ฆ„</Content>
<Content>{name}</Content>
</Col>
</Row>
<Row alignItems='center'>
<IoCallOutline size={DASHBOARD_USER_INFO_ICON_SIZE} />
<Col margin={DASHBOARD_USER_INFO_COL_MARGIN}>
<Col>
<Content>์—ฐ๋ฝ์ฒ˜</Content>
<Content>{phoneNumber}</Content>
</Col>
Expand All @@ -65,14 +64,14 @@ function DashboardBasicCard() {
<Col>
<Row alignItems='center'>
<IoCalendarClearOutline size={DASHBOARD_USER_INFO_ICON_SIZE} />
<Col margin={DASHBOARD_USER_INFO_COL_MARGIN}>
<Col>
<Content>์ƒ๋…„ ์›”์ผ</Content>
<Content>{getBirthdayFormat(birthday)}</Content>
</Col>
</Row>
<Row alignItems='center'>
<IoMailOutline size={DASHBOARD_USER_INFO_ICON_SIZE} />
<Col margin={DASHBOARD_USER_INFO_COL_MARGIN}>
<Col>
<Content>์ด๋ฉ”์ผ</Content>
<Content>{email}</Content>
</Col>
Expand All @@ -81,14 +80,14 @@ function DashboardBasicCard() {
<Col>
<Row alignItems='center'>
<IoLocationOutline size={DASHBOARD_USER_INFO_ICON_SIZE} />
<Col margin={DASHBOARD_USER_INFO_COL_MARGIN}>
<Col>
<Content>์ฃผ์†Œ์ง€</Content>
<Content>{region}</Content>
</Col>
</Row>
<Row alignItems='center'>
<BsPencil size={DASHBOARD_USER_INFO_ICON_SIZE} />
<Col margin={DASHBOARD_USER_INFO_COL_MARGIN}>
<Col>
<Content>ํ•™๋ ฅ</Content>
<Content>{school}</Content>
</Col>
Expand Down
7 changes: 2 additions & 5 deletions frontend/src/components/cards/DashboardLinkCard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -25,7 +22,7 @@ function DashboardLinkCard() {

return (
<CardCommon width={DASHBOARD_RIGHT_SECTION_CARD_WIDTH}>
<Row padding={DASHBOARD_LINK_ROW_PADDING} justifyContent='space-between'>
<Row justifyContent='space-between'>
<Col>
<Row>
<Title>ํฌ๋ง ์ง๊ตฐ</Title>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand All @@ -20,7 +17,7 @@ function DashboardTechStacksCard() {
return (
<CardCommon width={DASHBOARD_LEFT_SECTION_CARD_WIDTH}>
<Row justifyContent='space-between'>
<Col padding={DASHBOARD_STACK_GRID_PADDING}>
<Col>
{fields.map((field) => (
<Field key={field}>
<Title>{field}</Title>
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/components/contents/ProblemContent/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ function ProblemContent({ content, info, link, title }: Props) {
<>
<h1>{title}</h1>
<Row justifyContent='space-between'>
<p>ํ‹ฐ์–ด {info.tear}</p>
<p>ํ‘ผ ์‚ฌ๋žŒ {info.solvedUserCount}</p>
<p>์‹œ๋„ ํšŸ์ˆ˜ {info.totalTryCount}</p>
<p>ํ‹ฐ์–ด {info?.tear}</p>
<p>ํ‘ผ ์‚ฌ๋žŒ {info?.solvedUserCount}</p>
<p>์‹œ๋„ ํšŸ์ˆ˜ {info?.totalTryCount}</p>
</Row>
{/* eslint-disable-next-line react/no-danger */}
<div dangerouslySetInnerHTML={{ __html: sanitizer(content) }} />
Expand Down
8 changes: 4 additions & 4 deletions frontend/src/components/contents/RepoContent/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ function RepoContent({ content, link, info, title }: Props) {
<>
<h1>{title}</h1>
<Row justifyContent='space-between'>
<p>๋ณ„ {info.starCount}</p>
<p>ํฌํฌ {info.forkCount}</p>
{Object.keys(info.language ?? {}).map((language) => (
<p>๋ณ„ {info?.starCount}</p>
<p>ํฌํฌ {info?.forkCount}</p>
{Object.keys(info?.language ?? {}).map((language) => (
<Col key={language}>
<p>{language}</p>
<p>{info.language[language]}%</p>
<p>{info?.language[language]}%</p>
</Col>
))}
</Row>
Expand Down
3 changes: 0 additions & 3 deletions frontend/src/components/modals/BlogsModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -49,7 +47,6 @@ function BlogsModal({ onClose, onSelect }: Props) {
onClose={onClose}
close='์ทจ์†Œ'
confirm='์„ ํƒ'
height={EXTERNAL_MODAL_HEIGHT}
onConfirm={handleConfirm}
disabled={selectedIndex === -1}
title={hasExternalBlog ? '๊ฒŒ์‹œ๊ธ€์„ ์„ ํƒํ•˜์„ธ์š”' : '์—ฐ๋™๋œ ๋ธ”๋กœ๊ทธ๊ฐ€ ์—†์Šต๋‹ˆ๋‹ค'}
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/components/modals/BlogsModal/style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ const Wrapper = styled.div`
`;

const Blogs = styled.div`
height: 200px;
height: 400px;
width: 350px;
overflow-y: scroll;
padding: 16px;
`;
Expand Down
8 changes: 4 additions & 4 deletions frontend/src/components/modals/PostWriteModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
},
},
);
Expand Down Expand Up @@ -129,7 +129,7 @@ function PostWriteModal({ onClose, onPostWrite }: Props) {
onClose={onClose}
disabled={content.trim() === ''}
>
<Row justifyContent='center' alignItems='center' margin={16}>
<Row justifyContent='center' alignItems='center'>
<ImageInput onImageUpload={handleImageUpload}>
<IconHolder>
<IoMdImages />
Expand Down
15 changes: 7 additions & 8 deletions frontend/src/components/modals/PostWriteModal/style.ts
Original file line number Diff line number Diff line change
@@ -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;
`;
Expand All @@ -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 };
3 changes: 0 additions & 3 deletions frontend/src/components/modals/ProblemsModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -47,7 +45,6 @@ function ProblemsModal({ onClose, onSelect }: Props) {
onClose={onClose}
close='์ทจ์†Œ'
confirm='์„ ํƒ'
height={EXTERNAL_MODAL_HEIGHT}
onConfirm={handleConfirm}
disabled={selectedIndex === -1}
title='๋ฌธ์ œ๋ฅผ ๊ฒ€์ƒ‰ํ•˜๊ณ  ์„ ํƒํ•˜์„ธ์š”'
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/components/modals/ProblemsModal/style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ const Wrapper = styled.div`
`;

const Problems = styled.div`
height: 200px;
height: 400px;
width: 350px;
overflow-y: scroll;
padding: 16px;
`;
Expand Down
3 changes: 0 additions & 3 deletions frontend/src/components/modals/ReposModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -48,7 +46,6 @@ function ReposModal({ onClose, onSelect }: Props) {
onConfirm={handleConfirm}
close='์ทจ์†Œ'
confirm='์„ ํƒ'
height={REPOS_MODAL_HEIGHT}
onClose={onClose}
disabled={selectedIndex === -1}
title={hasExternalGithub ? '์ €์žฅ์†Œ๋ฅผ ์„ ํƒํ•˜์„ธ์š”' : '์—ฐ๋™๋œ ๊นƒํ—™์ด ์—†์Šต๋‹ˆ๋‹ค'}
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/components/modals/ReposModal/style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 };

0 comments on commit 3420f9b

Please sign in to comment.