Skip to content

Commit 2b9ec37

Browse files
committed
Complete mobile design
1 parent 038bf6d commit 2b9ec37

File tree

12 files changed

+154
-8
lines changed

12 files changed

+154
-8
lines changed

src/components/auth/AuthForm.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,19 @@ import { AuthMode } from '../../modules/core';
66
import palette from '../../lib/styles/palette';
77
import AuthSocialButtonGroup from './AuthSocialButtonGroup';
88
import AuthEmailSuccess from './AuthEmailSuccess';
9+
import media from '../../lib/styles/media';
910

1011
const AuthFormBlock = styled.div`
1112
display: flex;
1213
flex: 1;
1314
flex-direction: column;
1415
justify-content: space-between;
1516
line-height: 1.5;
17+
.upper-wrapper {
18+
${media.small} {
19+
margin-top: 2rem;
20+
}
21+
}
1622
h2,
1723
h4 {
1824
margin: 0;
@@ -30,6 +36,10 @@ const AuthFormBlock = styled.div`
3036
margin-top: 2.5rem;
3137
}
3238
.foot {
39+
${media.small} {
40+
margin-top: 2rem;
41+
}
42+
3343
text-align: right;
3444
span {
3545
margin-right: 0.25rem;
@@ -70,7 +80,7 @@ const AuthForm: React.FC<AuthFormProps> = ({
7080

7181
return (
7282
<AuthFormBlock>
73-
<div>
83+
<div className="upper-wrapper">
7484
<h2 data-testid="title">{modeText}</h2>
7585
<section>
7686
<h4>이메일로 {modeText}</h4>

src/components/auth/AuthModal.tsx

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import zIndexes from '../../lib/styles/zIndexes';
55
import palette from '../../lib/styles/palette';
66
import { undrawJoyride } from '../../static/images';
77
import transitions from '../../lib/styles/transitions';
8+
import media from '../../lib/styles/media';
89

910
const { useState, useEffect } = React;
1011

@@ -21,6 +22,11 @@ const AuthModalBlock = styled.div<{ visible: boolean }>`
2122
.wrapper {
2223
width: 606px;
2324
height: 480px;
25+
${media.small} {
26+
flex: 1;
27+
width: auto;
28+
height: 100%;
29+
}
2430
2531
${props =>
2632
props.visible
@@ -34,6 +40,9 @@ const AuthModalBlock = styled.div<{ visible: boolean }>`
3440
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.09);
3541
display: flex;
3642
.gray-block {
43+
${media.small} {
44+
display: none;
45+
}
3746
width: 216px;
3847
background: ${palette.gray1};
3948
padding: 1.5rem;
@@ -48,10 +57,11 @@ const AuthModalBlock = styled.div<{ visible: boolean }>`
4857
}
4958
.welcome {
5059
font-size: 2.25rem;
51-
font-weight: bold;
5260
margin-top: 1.5rem;
5361
color: ${palette.gray7};
5462
text-align: center;
63+
font-weight: 400;
64+
font-size: 2rem;
5565
}
5666
}
5767
.white-block {
@@ -60,6 +70,9 @@ const AuthModalBlock = styled.div<{ visible: boolean }>`
6070
padding: 1.5rem;
6171
display: flex;
6272
flex-direction: column;
73+
${media.small} {
74+
overflow-y: auto;
75+
}
6376
.exit-wrapper {
6477
display: flex;
6578
justify-content: flex-end;
@@ -69,6 +82,9 @@ const AuthModalBlock = styled.div<{ visible: boolean }>`
6982
svg {
7083
cursor: pointer;
7184
}
85+
${media.small} {
86+
margin-bottom: 0;
87+
}
7288
}
7389
.block-content {
7490
flex: 1;

src/components/common/Button.tsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import * as React from 'react';
22
import styled, { css } from 'styled-components';
33
import palette, { buttonColorMap } from '../../lib/styles/palette';
4+
import media from '../../lib/styles/media';
45

56
type ColorType =
67
| 'teal'
@@ -15,6 +16,7 @@ const ButtonBlock = styled.button<{
1516
color: ColorType;
1617
inline: boolean;
1718
size: ButtonSize;
19+
responsive?: boolean;
1820
}>`
1921
display: inline-flex;
2022
align-items: center;
@@ -41,6 +43,17 @@ const ButtonBlock = styled.button<{
4143
}
4244
`}
4345
46+
${props =>
47+
props.responsive &&
48+
css`
49+
${media.small} {
50+
height: 1.5rem;
51+
padding-left: 0.9375rem;
52+
padding-right: 0.9375rem;
53+
font-size: 0.75rem;
54+
}
55+
`}
56+
4457
${props =>
4558
props.size === 'medium' &&
4659
css`
@@ -77,6 +90,7 @@ interface ButtonProps extends Omit<React.HTMLProps<HTMLButtonElement>, 'size'> {
7790
color?: ColorType;
7891
inline?: boolean;
7992
size?: ButtonSize;
93+
responsive?: boolean;
8094
}
8195

8296
const Button: React.FC<ButtonProps> = ({
@@ -85,6 +99,7 @@ const Button: React.FC<ButtonProps> = ({
8599
color = 'teal',
86100
inline,
87101
size = 'medium',
102+
responsive = false,
88103
...rest
89104
}) => {
90105
const htmlProps = rest as any;
@@ -93,6 +108,7 @@ const Button: React.FC<ButtonProps> = ({
93108
color={color}
94109
inline={inline}
95110
size={size}
111+
responsive={responsive}
96112
{...htmlProps}
97113
onClick={e => {
98114
if (htmlProps.onClick) {

src/components/common/LabelInput.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import * as React from 'react';
22
import styled, { css } from 'styled-components';
33
import palette from '../../lib/styles/palette';
44
import { MdLockOutline } from 'react-icons/md';
5+
import media from '../../lib/styles/media';
56
const LabelInputBlock = styled.div<{ focus: boolean }>`
67
label,
78
input {
@@ -25,6 +26,9 @@ const LabelInputBlock = styled.div<{ focus: boolean }>`
2526
font-size: 1.5rem;
2627
border: none;
2728
outline: none;
29+
${media.small} {
30+
font-size: 1.125rem;
31+
}
2832
2933
width: 100%;
3034
color: ${palette.gray7};

src/components/common/PopupBase.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import styled, { css } from 'styled-components';
33
import OpaqueLayer from './OpaqueLayer';
44
import zIndexes from '../../lib/styles/zIndexes';
55
import transitions from '../../lib/styles/transitions';
6+
import media from '../../lib/styles/media';
67

78
const PopupBaseBlock = styled.div`
89
position: fixed;
@@ -22,6 +23,9 @@ const PopupWrapper = styled.div<{ visible: boolean }>`
2223
background: white;
2324
padding: 2rem 1.5rem;
2425
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.09);
26+
${media.small} {
27+
width: calc(100% - 2rem);
28+
}
2529
${props =>
2630
props.visible
2731
? css`

src/components/register/RegisterTemplate.tsx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import * as React from 'react';
22
import styled from 'styled-components';
33
import palette from '../../lib/styles/palette';
4+
import media from '../../lib/styles/media';
45

56
const RegisterTemplateBlock = styled.div`
67
width: 768px;
@@ -17,6 +18,19 @@ const RegisterTemplateBlock = styled.div`
1718
font-size: 1.5rem;
1819
color: ${palette.gray9};
1920
}
21+
22+
${media.small} {
23+
width: 100%;
24+
padding-left: 1rem;
25+
padding-right: 1rem;
26+
margin-top: 4rem;
27+
h1 {
28+
font-size: 3rem;
29+
}
30+
.description {
31+
font-size: 1rem;
32+
}
33+
}
2034
`;
2135

2236
export interface RegisterTemplateProps {}

src/components/setting/SettingEditButton.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ const StyledButton = styled.button`
2424
line-height: 1.5;
2525
color: ${palette.teal6};
2626
text-decoration: underline;
27+
background: none;
2728
cursor: pointer;
2829
&:hover,
2930
&:focus {

src/components/setting/SettingRow.tsx

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React from 'react';
22
import styled from 'styled-components';
33
import palette from '../../lib/styles/palette';
44
import SettingEditButton from './SettingEditButton';
5+
import media from '../../lib/styles/media';
56

67
export type SettingRowProps = {
78
title: string;
@@ -24,12 +25,14 @@ function SettingRow({
2425
<div className="title-wrapper">
2526
<h3>{title}</h3>
2627
</div>
27-
<div className="contents">{children}</div>
28-
{editButton && (
29-
<div className="edit-wrapper">
30-
<SettingEditButton onClick={onClickEdit} />
31-
</div>
32-
)}
28+
<div className="block-for-mobile">
29+
<div className="contents">{children}</div>
30+
{editButton && (
31+
<div className="edit-wrapper">
32+
<SettingEditButton onClick={onClickEdit} />
33+
</div>
34+
)}
35+
</div>
3336
</div>
3437
{description && <div className="description">{description}</div>}
3538
</Row>
@@ -41,6 +44,9 @@ const Row = styled.div`
4144
padding-bottom: 1rem;
4245
& > .wrapper {
4346
display: flex;
47+
${media.small} {
48+
flex-direction: column;
49+
}
4450
}
4551
.title-wrapper {
4652
width: 9.5rem;
@@ -50,8 +56,16 @@ const Row = styled.div`
5056
color: ${palette.gray8};
5157
margin: 0;
5258
font-size: 1.125rem;
59+
${media.small} {
60+
margin-bottom: 0.5rem;
61+
}
5362
}
5463
}
64+
.block-for-mobile {
65+
flex: 1;
66+
display: flex;
67+
align-items: center;
68+
}
5569
.contents {
5670
flex: 1;
5771
font-size: 1rem;

src/components/setting/SettingRows.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import Button from '../common/Button';
88
import { createFallbackTitle } from '../../lib/utils';
99
import { ProfileLinks } from '../../lib/graphql/user';
1010
import SettingUnregisterRow from './SettingUnregisterRow';
11+
import media from '../../lib/styles/media';
1112

1213
export type SettingRowsProps = {
1314
title: string | null;
@@ -70,6 +71,9 @@ function SettingRows({
7071

7172
const Rows = styled.section`
7273
margin-top: 4rem;
74+
${media.small} {
75+
margin-top: 0rem;
76+
}
7377
`;
7478

7579
export default SettingRows;

src/components/setting/SettingSocialInfoRow.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import useInputs from '../../lib/hooks/useInputs';
1414
import palette from '../../lib/styles/palette';
1515
import { ProfileLinks } from '../../lib/graphql/user';
1616
import SettingEditButton from './SettingEditButton';
17+
import media from '../../lib/styles/media';
1718

1819
export type SettingSocialInfoRowProps = {
1920
email?: string;
@@ -209,6 +210,9 @@ const FacebookInputBox = styled.div<{ focus: boolean }>`
209210

210211
const Form = styled.form`
211212
width: 25rem;
213+
${media.small} {
214+
width: 100%;
215+
}
212216
li + li {
213217
margin-top: 1rem;
214218
}

0 commit comments

Comments
 (0)