Skip to content

Commit 7bf0959

Browse files
committed
Merge remote-tracking branch 'origin/feature/prepare-for-v3' into feature/prepare-for-v3
2 parents aa496a4 + 71fd338 commit 7bf0959

File tree

8 files changed

+109
-16
lines changed

8 files changed

+109
-16
lines changed

.env .env.development

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,7 @@ REACT_APP_CLIENT_V3_HOST=http://localhost:3001
44

55
REACT_APP_API_HOST=http://localhost:5002/
66

7-
REACT_APP_GRAPHQL_HOST=https://v2cdn.velog.io/
7+
REACT_APP_CLIENT_V3_HOST=http://localhost:3001/
8+
9+
REACT_APP_GRAPHQL_HOST=http://localhost:5002/
810
REACT_APP_GRAPHQL_HOST_NOCDN=https://v2.velog.io/

.env.production

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
PUBLIC_URL=/
2+
3+
REACT_APP_API_HOST=http://localhost:5002/
4+
5+
REACT_APP_CLIENT_V3_HOST=http://localhost:3001/
6+
7+
REACT_APP_GRAPHQL_HOST=https://v2.velog.io/
8+
REACT_APP_GRAPHQL_HOST_NOCDN=https://v2.velog.io/

public/index.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@
2929
work correctly both with client-side routing and a non-root public URL.
3030
Learn how to configure a non-root public URL by running `npm run build`.
3131
-->
32-
<!-- Global site tag (gtag.js) - Google Analytics -->
33-
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-125599395-1"></script>
32+
<!-- Google tag (gtag.js) -->
33+
<script async src="https://www.googletagmanager.com/gtag/js?id=G-8D0MD2S4PK"></script>
3434
<script>
3535
window.dataLayer = window.dataLayer || [];
3636
function gtag(){dataLayer.push(arguments);}
3737
gtag('js', new Date());
3838

39-
gtag('config', 'UA-125599395-1');
39+
gtag('config', 'G-8D0MD2S4PK');
4040
</script>
4141

4242

src/components/register/RegisterForm.tsx

+87-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
import * as React from 'react';
2-
import styled from 'styled-components';
2+
import styled, { css } from 'styled-components';
33
import LabelInput from '../common/LabelInput';
44
import useInputs from '../../lib/hooks/useInputs';
55
import RoundButton from '../common/RoundButton';
66
import palette from '../../lib/styles/palette';
7+
import { themedPalette } from '../../lib/styles/themes';
8+
import { CheckIcon } from '../../static/svg';
9+
import { useState, useEffect } from 'react';
710

811
const RegisterFormBlock = styled.div`
912
margin-top: 3rem;
@@ -20,6 +23,41 @@ const RegisterFormBlock = styled.div`
2023
}
2124
`;
2225

26+
const CheckRow = styled.div`
27+
display: flex;
28+
align-items: center;
29+
color: ${themedPalette.text1};
30+
gap: 0.5rem;
31+
cursor: pointer;
32+
33+
a {
34+
color: ${themedPalette.primary1};
35+
}
36+
`;
37+
38+
const Box = styled.div<{ isChecked: boolean }>`
39+
width: 1.5rem;
40+
height: 1.5rem;
41+
border: 1px solid ${themedPalette.border2};
42+
border-radius: 4px;
43+
${(props) =>
44+
props.isChecked &&
45+
css`
46+
background: ${themedPalette.primary1};
47+
border: 1px solid ${themedPalette.primary1};
48+
`}
49+
50+
display: flex;
51+
align-items: center;
52+
justify-content: center;
53+
54+
svg {
55+
color: white;
56+
width: 1rem;
57+
height: 1rem;
58+
}
59+
`;
60+
2361
export type RegisterFormType = {
2462
displayName: string;
2563
email: string;
@@ -51,6 +89,15 @@ const RegisterForm: React.FC<RegisterFormProps> = ({
5189
username: defaultInfo ? defaultInfo.username : '',
5290
shortBio: '',
5391
});
92+
const [isChecked, setIsChecked] = useState(false);
93+
const [localError, setLocalError] = useState<string | null>(null);
94+
95+
useEffect(() => {
96+
if (isChecked) {
97+
setLocalError(null);
98+
}
99+
}, [isChecked]);
100+
54101
return (
55102
<RegisterFormBlock>
56103
<LabelInput
@@ -88,18 +135,53 @@ const RegisterForm: React.FC<RegisterFormProps> = ({
88135
value={form.shortBio}
89136
size={30}
90137
/>
138+
<CheckRow
139+
onClick={() => {
140+
setIsChecked((v) => !v);
141+
}}
142+
>
143+
<Box isChecked={isChecked}>
144+
<CheckIcon />
145+
</Box>
146+
<span>
147+
<a
148+
href="https://velog.io/policy/terms"
149+
target="_blank"
150+
rel="noopener noreferrer"
151+
onClick={(e) => e.stopPropagation()}
152+
>
153+
이용약관
154+
</a>
155+
{' '}
156+
<a
157+
href="https://velog.io/policy/terms"
158+
target="_blank"
159+
rel="noopener noreferrer"
160+
onClick={(e) => e.stopPropagation()}
161+
>
162+
개인정보취급방침
163+
</a>
164+
에 동의합니다.
165+
</span>
166+
</CheckRow>
91167
<div className="form-bottom">
92-
{error && <div className="error">{error}</div>}
168+
{(error || localError) && (
169+
<div className="error">{error || localError}</div>
170+
)}
93171
<div className="buttons">
94172
<RoundButton inline color="lightGray" to="/" size="LARGE">
95173
취소
96174
</RoundButton>
97175
<RoundButton
98176
inline
99177
type="submit"
100-
onClick={() =>
101-
onSubmit({ ...form, email: fixedEmail || form.email })
102-
}
178+
onClick={() => {
179+
if (!isChecked) {
180+
setLocalError('이용약관과 개인정보취급방침에 동의해주세요.');
181+
return;
182+
}
183+
onSubmit({ ...form, email: fixedEmail || form.email });
184+
}}
103185
size="LARGE"
104186
disabled={loading}
105187
>

src/containers/base/Core.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const Core: React.FC<CoreProps> = ({ layer }) => {
3131
// adds setTimeout for page title sync
3232
// is there any better solution?
3333
setTimeout(() => {
34-
gtag('config', 'UA-125599395-1', {
34+
gtag('config', 'G-8D0MD2S4PK', {
3535
page_path: location.pathname + location.search,
3636
});
3737
}, 1000);

src/pages/home/HomePage.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import FloatingHeader from '../../components/base/FloatingHeader';
1212
export type HomePageProps = {};
1313

1414
function HomePage(props: HomePageProps) {
15+
window.location.href = process.env.REACT_APP_CLIENT_V3_HOST!;
1516
return (
1617
<MainTemplate>
1718
<Header />

src/server/Html.tsx

+5-5
Original file line numberDiff line numberDiff line change
@@ -79,15 +79,15 @@ function Html({
7979
></script>
8080
<script
8181
async
82-
src="https://www.googletagmanager.com/gtag/js?id=UA-125599395-1"
82+
src="https://www.googletagmanager.com/gtag/js?id=G-8D0MD2S4PK"
8383
></script>
8484
<script
8585
dangerouslySetInnerHTML={{
8686
__html: `window.dataLayer = window.dataLayer || [];
87-
function gtag(){dataLayer.push(arguments);}
88-
gtag('js', new Date());
89-
90-
gtag('config', 'UA-125599395-1');`,
87+
function gtag(){dataLayer.push(arguments);}
88+
gtag('js', new Date());
89+
90+
gtag('config', 'G-8D0MD2S4PK');`,
9191
}}
9292
></script>
9393
</head>

src/static/svg/icon-check.svg

+1-1
Loading

0 commit comments

Comments
 (0)