송용우

Set frontend directory

...@@ -6,10 +6,18 @@ ...@@ -6,10 +6,18 @@
6 "@testing-library/jest-dom": "^4.2.4", 6 "@testing-library/jest-dom": "^4.2.4",
7 "@testing-library/react": "^9.3.2", 7 "@testing-library/react": "^9.3.2",
8 "@testing-library/user-event": "^7.1.2", 8 "@testing-library/user-event": "^7.1.2",
9 + "immer": "^7.0.1",
10 + "include-media": "^1.4.9",
11 + "open-color": "^1.7.0",
9 "react": "^16.13.1", 12 "react": "^16.13.1",
10 "react-dom": "^16.13.1", 13 "react-dom": "^16.13.1",
14 + "react-redux": "^7.2.0",
11 "react-router-dom": "^5.2.0", 15 "react-router-dom": "^5.2.0",
12 - "react-scripts": "3.4.1" 16 + "react-scripts": "3.4.1",
17 + "redux": "^4.0.5",
18 + "redux-actions": "^2.6.5",
19 + "redux-devtools-extension": "^2.13.8",
20 + "styled-components": "^5.1.1"
13 }, 21 },
14 "scripts": { 22 "scripts": {
15 "start": "react-scripts start", 23 "start": "react-scripts start",
......
1 import React from 'react'; 1 import React from 'react';
2 -import logo from './logo.svg'; 2 +import { Route } from 'react-router-dom';
3 import './App.css'; 3 import './App.css';
4 +import LoginPage from './pages/LoginPage';
5 +import RegisterPage from './pages/RegisterPage';
6 +import HomePage from './pages/HomePage';
4 7
5 function App() { 8 function App() {
6 return ( 9 return (
7 - <div className="App"> 10 + <>
8 - <header className="App-header"> 11 + <Route component={HomePage} path={['/@:username', '/']} exact />
9 - <img src={logo} className="App-logo" alt="logo" /> 12 + <Route component={LoginPage} path="/login" />
10 - <p> 13 + <Route component={RegisterPage} path="/register" />
11 - Edit <code>src/App.js</code> and save to reload. 14 + </>
12 - </p>
13 - <a
14 - className="App-link"
15 - href="https://reactjs.org"
16 - target="_blank"
17 - rel="noopener noreferrer"
18 - >
19 - Learn React
20 - </a>
21 - </header>
22 - </div>
23 ); 15 );
24 } 16 }
25 17
......
1 +import React from 'react';
2 +import styled from 'styled-components';
3 +import palette from '../../lib/styles/palette';
4 +
5 +const StyledButton = styled.button`
6 + border: none;
7 + border-radius: 4px;
8 + font-size: 1rem;
9 + font-weight: bold;
10 + padding: 0.25rem 1rem;
11 + color: white;
12 + outline: none;
13 + cursor: pointer;
14 +
15 + background: ${palette.gray[7]};
16 +
17 + &:hover {
18 + background: ${palette.gray[5]};
19 + }
20 +`;
21 +
22 +const Button = (props) => <StyledButton {...props} />;
23 +
24 +export default Button;
1 +import React from 'react';
2 +import styled from 'styled-components';
3 +/*
4 +Display Auth Form(Register, Login)
5 +*/
6 +const AuthFormBlock = styled.div``;
7 +
8 +const AuthForm = () => {
9 + return <AuthFormBlock>AuthForm</AuthFormBlock>;
10 +};
11 +
12 +export default AuthForm;
1 +import React from 'react';
2 +import styled from 'styled-components';
3 +/*
4 +register/login Layout
5 +*/
6 +
7 +const AuthTemplateBlock = styled.div``;
8 +
9 +const AuthTemplate = ({ children }) => {
10 + return <AuthTemplateBlock>{children}</AuthTemplateBlock>;
11 +};
12 +
13 +export default AuthTemplate;
...@@ -5,6 +5,24 @@ body { ...@@ -5,6 +5,24 @@ body {
5 sans-serif; 5 sans-serif;
6 -webkit-font-smoothing: antialiased; 6 -webkit-font-smoothing: antialiased;
7 -moz-osx-font-smoothing: grayscale; 7 -moz-osx-font-smoothing: grayscale;
8 + box-sizing: border-box;
9 + min-height: 100%;
10 +}
11 +
12 +#root {
13 + min-height: 100%;
14 +}
15 +
16 +html {
17 + height: 100%;
18 +}
19 +
20 +a {
21 + color: inherit;
22 + text-decoration: none;
23 +}
24 +* {
25 + box-sizing: inherit;
8 } 26 }
9 27
10 code { 28 code {
......
...@@ -3,12 +3,21 @@ import ReactDOM from 'react-dom'; ...@@ -3,12 +3,21 @@ import ReactDOM from 'react-dom';
3 import './index.css'; 3 import './index.css';
4 import App from './App'; 4 import App from './App';
5 import * as serviceWorker from './serviceWorker'; 5 import * as serviceWorker from './serviceWorker';
6 +import { BrowserRouter } from 'react-router-dom';
7 +import { Provider } from 'react-redux';
8 +import { createStore } from 'redux';
9 +import { composeWithDevTools } from 'redux-devtools-extension';
10 +import rootReducer from './modules';
11 +
12 +const store = createStore(rootReducer, composeWithDevTools());
6 13
7 ReactDOM.render( 14 ReactDOM.render(
8 - <React.StrictMode> 15 + <Provider store={store}>
9 - <App /> 16 + <BrowserRouter>
10 - </React.StrictMode>, 17 + <App />
11 - document.getElementById('root') 18 + </BrowserRouter>
19 + </Provider>,
20 + document.getElementById('root'),
12 ); 21 );
13 22
14 // If you want your app to work offline and load faster, you can change 23 // If you want your app to work offline and load faster, you can change
......
1 +// source: https://yeun.github.io/open-color/
2 +
3 +const palette = {
4 + gray: [
5 + '#f8f9fa',
6 + '#f1f3f5',
7 + '#e9ecef',
8 + '#dee2e6',
9 + '#ced4da',
10 + '#adb5bd',
11 + '#868e96',
12 + '#495057',
13 + '#343a40',
14 + '#212529',
15 + ],
16 + cyan: [
17 + '#e3fafc',
18 + '#c5f6fa',
19 + '#99e9f2',
20 + '#66d9e8',
21 + '#3bc9db',
22 + '#22b8cf',
23 + '#15aabf',
24 + '#1098ad',
25 + '#0c8599',
26 + '#0b7285',
27 + ],
28 +};
29 +
30 +export default palette;
1 -<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 841.9 595.3">
2 - <g fill="#61DAFB">
3 - <path d="M666.3 296.5c0-32.5-40.7-63.3-103.1-82.4 14.4-63.6 8-114.2-20.2-130.4-6.5-3.8-14.1-5.6-22.4-5.6v22.3c4.6 0 8.3.9 11.4 2.6 13.6 7.8 19.5 37.5 14.9 75.7-1.1 9.4-2.9 19.3-5.1 29.4-19.6-4.8-41-8.5-63.5-10.9-13.5-18.5-27.5-35.3-41.6-50 32.6-30.3 63.2-46.9 84-46.9V78c-27.5 0-63.5 19.6-99.9 53.6-36.4-33.8-72.4-53.2-99.9-53.2v22.3c20.7 0 51.4 16.5 84 46.6-14 14.7-28 31.4-41.3 49.9-22.6 2.4-44 6.1-63.6 11-2.3-10-4-19.7-5.2-29-4.7-38.2 1.1-67.9 14.6-75.8 3-1.8 6.9-2.6 11.5-2.6V78.5c-8.4 0-16 1.8-22.6 5.6-28.1 16.2-34.4 66.7-19.9 130.1-62.2 19.2-102.7 49.9-102.7 82.3 0 32.5 40.7 63.3 103.1 82.4-14.4 63.6-8 114.2 20.2 130.4 6.5 3.8 14.1 5.6 22.5 5.6 27.5 0 63.5-19.6 99.9-53.6 36.4 33.8 72.4 53.2 99.9 53.2 8.4 0 16-1.8 22.6-5.6 28.1-16.2 34.4-66.7 19.9-130.1 62-19.1 102.5-49.9 102.5-82.3zm-130.2-66.7c-3.7 12.9-8.3 26.2-13.5 39.5-4.1-8-8.4-16-13.1-24-4.6-8-9.5-15.8-14.4-23.4 14.2 2.1 27.9 4.7 41 7.9zm-45.8 106.5c-7.8 13.5-15.8 26.3-24.1 38.2-14.9 1.3-30 2-45.2 2-15.1 0-30.2-.7-45-1.9-8.3-11.9-16.4-24.6-24.2-38-7.6-13.1-14.5-26.4-20.8-39.8 6.2-13.4 13.2-26.8 20.7-39.9 7.8-13.5 15.8-26.3 24.1-38.2 14.9-1.3 30-2 45.2-2 15.1 0 30.2.7 45 1.9 8.3 11.9 16.4 24.6 24.2 38 7.6 13.1 14.5 26.4 20.8 39.8-6.3 13.4-13.2 26.8-20.7 39.9zm32.3-13c5.4 13.4 10 26.8 13.8 39.8-13.1 3.2-26.9 5.9-41.2 8 4.9-7.7 9.8-15.6 14.4-23.7 4.6-8 8.9-16.1 13-24.1zM421.2 430c-9.3-9.6-18.6-20.3-27.8-32 9 .4 18.2.7 27.5.7 9.4 0 18.7-.2 27.8-.7-9 11.7-18.3 22.4-27.5 32zm-74.4-58.9c-14.2-2.1-27.9-4.7-41-7.9 3.7-12.9 8.3-26.2 13.5-39.5 4.1 8 8.4 16 13.1 24 4.7 8 9.5 15.8 14.4 23.4zM420.7 163c9.3 9.6 18.6 20.3 27.8 32-9-.4-18.2-.7-27.5-.7-9.4 0-18.7.2-27.8.7 9-11.7 18.3-22.4 27.5-32zm-74 58.9c-4.9 7.7-9.8 15.6-14.4 23.7-4.6 8-8.9 16-13 24-5.4-13.4-10-26.8-13.8-39.8 13.1-3.1 26.9-5.8 41.2-7.9zm-90.5 125.2c-35.4-15.1-58.3-34.9-58.3-50.6 0-15.7 22.9-35.6 58.3-50.6 8.6-3.7 18-7 27.7-10.1 5.7 19.6 13.2 40 22.5 60.9-9.2 20.8-16.6 41.1-22.2 60.6-9.9-3.1-19.3-6.5-28-10.2zM310 490c-13.6-7.8-19.5-37.5-14.9-75.7 1.1-9.4 2.9-19.3 5.1-29.4 19.6 4.8 41 8.5 63.5 10.9 13.5 18.5 27.5 35.3 41.6 50-32.6 30.3-63.2 46.9-84 46.9-4.5-.1-8.3-1-11.3-2.7zm237.2-76.2c4.7 38.2-1.1 67.9-14.6 75.8-3 1.8-6.9 2.6-11.5 2.6-20.7 0-51.4-16.5-84-46.6 14-14.7 28-31.4 41.3-49.9 22.6-2.4 44-6.1 63.6-11 2.3 10.1 4.1 19.8 5.2 29.1zm38.5-66.7c-8.6 3.7-18 7-27.7 10.1-5.7-19.6-13.2-40-22.5-60.9 9.2-20.8 16.6-41.1 22.2-60.6 9.9 3.1 19.3 6.5 28.1 10.2 35.4 15.1 58.3 34.9 58.3 50.6-.1 15.7-23 35.6-58.4 50.6zM320.8 78.4z"/>
4 - <circle cx="420.9" cy="296.5" r="45.7"/>
5 - <path d="M520.5 78.1z"/>
6 - </g>
7 -</svg>
1 +import { createAction, handleActions } from 'redux-actions';
2 +
3 +const SAMPLE_ACTION = 'auth/SAMPLE_ACTION';
4 +
5 +export const sampleAction = createAction(SAMPLE_ACTION);
6 +
7 +const initialState = {};
8 +
9 +const auth = handleActions(
10 + {
11 + [SAMPLE_ACTION]: (state, action) => state,
12 + },
13 + initialState,
14 +);
15 +
16 +export default auth;
1 +import { combineReducers } from 'redux';
2 +import auth from './auth';
3 +
4 +const rootReducer = combineReducers({
5 + auth,
6 +});
7 +
8 +export default rootReducer;
1 +import React from 'react';
2 +import Button from '../components/common/Button';
3 +
4 +const HomePage = () => {
5 + return (
6 + <div>
7 + <Button>test</Button>
8 + </div>
9 + );
10 +};
11 +
12 +export default HomePage;
1 +import React from 'react';
2 +import AuthTemplate from '../components/auth/AuthTemplate';
3 +import AuthForm from '../components/auth/AuthForm';
4 +
5 +const LoginPage = () => {
6 + return (
7 + <AuthTemplate>
8 + <AuthForm />
9 + </AuthTemplate>
10 + );
11 +};
12 +
13 +export default LoginPage;
1 +import React from 'react';
2 +
3 +const RegisterPage = () => {
4 + return (
5 + <AuthTemplate>
6 + <AuthForm />
7 + </AuthTemplate>
8 + );
9 +};
10 +
11 +export default RegisterPage;
This diff could not be displayed because it is too large.