Skip to content

Commit 71ee21f

Browse files
committed
Revert "Add: redux toolkit"
This reverts commit f448100
1 parent 8a0f8fe commit 71ee21f

40 files changed

Lines changed: 8704 additions & 3228 deletions

toolkit/front/.babelrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
"displayName": true
77
}]
88
]
9-
}
9+
}

toolkit/front/.eslintrc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,8 @@
2828
"react/forbid-prop-types": "off",
2929
"react/jsx-filename-extension": "off",
3030
"react/jsx-one-expression-per-line": "off",
31-
"react/jsx-props-no-spreading": "off",
3231
"object-curly-newline": "off",
3332
"linebreak-style": "off",
3433
"no-param-reassign": "off"
3534
}
36-
}
35+
}

toolkit/front/.gitignore

Lines changed: 0 additions & 4 deletions
This file was deleted.

toolkit/front/actions/post.js

Lines changed: 0 additions & 124 deletions
This file was deleted.

toolkit/front/actions/user.js

Lines changed: 0 additions & 79 deletions
This file was deleted.
Lines changed: 40 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,85 +1,62 @@
1-
import React, { useState, useCallback } from 'react';
2-
import ProTypes from 'prop-types';
1+
import React, { useCallback } from 'react';
2+
import PropTypes from 'prop-types';
33
import Link from 'next/link';
4-
import {
5-
Layout, Menu, Input, Row, Col,
6-
} from 'antd';
7-
import styled, { createGlobalStyle } from 'styled-components';
4+
import { Menu, Input, Row, Col } from 'antd';
5+
import styled from 'styled-components';
86
import { useSelector } from 'react-redux';
9-
import Router, { useRouter } from 'next/router';
7+
import Router from 'next/router';
8+
109
import UserProfile from './UserProfile';
1110
import LoginForm from './LoginForm';
11+
import useInput from '../hooks/useInput';
1212

13-
const { Header, Content } = Layout;
14-
const Global = createGlobalStyle`
15-
.ant-row {
16-
margin-left: 0 !important;
17-
margin-right: 0 !important;
18-
}
19-
.ant-col:first-child {
20-
margin-left: 0 !important;
21-
}
22-
.ant-col:last-child {
23-
margin-right: 0 !important;
24-
}
25-
.ant-form-item-explain-error {
26-
font-size: 11px;
27-
}
28-
`;
2913
const SearchInput = styled(Input.Search)`
3014
vertical-align: middle;
3115
`;
16+
3217
const AppLayout = ({ children }) => {
18+
const [searchInput, onChangeSearchInput] = useInput('');
3319
const { me } = useSelector((state) => state.user);
34-
const [searchInput, setSearchInput] = useState('');
35-
const onChangeSearchInput = useCallback((e) => {
36-
setSearchInput(e.target.value);
37-
}, [searchInput]);
20+
3821
const onSearch = useCallback(() => {
3922
Router.push(`/hashtag/${searchInput}`);
4023
}, [searchInput]);
41-
const router = useRouter();
4224

4325
return (
44-
<Layout className="layout">
45-
<Global />
46-
<Header style={{ position: 'fixed', zIndex: 1, width: '100%' }}>
47-
<Menu theme="dark" mode="horizontal" defaultSelectedKeys={[router.pathname]}>
48-
<Menu.Item key="/">
49-
<Link href="/"><a>노드버드</a></Link>
50-
</Menu.Item>
51-
<Menu.Item key="/profile">
52-
<Link href="/profile"><a>프로필</a></Link>
53-
</Menu.Item>
54-
<Menu.Item key="/search">
55-
<SearchInput
56-
enterButton
57-
value={searchInput}
58-
onChange={onChangeSearchInput}
59-
onSearch={onSearch}
60-
/>
61-
</Menu.Item>
62-
</Menu>
63-
</Header>
64-
<Content style={{ padding: '0 50px', marginTop: 64 }}>
65-
<div style={{ minHeight: '400px', padding: '24px', backgroundColor: '#FFF' }}>
66-
{/* gutter 컬럼 사이의 간격 */}
67-
<Row gutter={12}>
68-
<Col xs={24} sm={24} md={8} lg={4} style={{ paddingTop: '12px' }}>
69-
{me ? <UserProfile /> : <LoginForm />}
70-
</Col>
71-
<Col xs={24} sm={24} md={16} lg={20} style={{ paddingTop: '12px' }}>
72-
{children}
73-
</Col>
74-
</Row>
75-
</div>
76-
</Content>
77-
</Layout>
26+
<div>
27+
<Menu mode="horizontal">
28+
<Menu.Item>
29+
<Link href="/"><a>노드버드</a></Link>
30+
</Menu.Item>
31+
<Menu.Item>
32+
<Link href="/profile"><a>프로필</a></Link>
33+
</Menu.Item>
34+
<Menu.Item>
35+
<SearchInput
36+
enterButton
37+
value={searchInput}
38+
onChange={onChangeSearchInput}
39+
onSearch={onSearch}
40+
/>
41+
</Menu.Item>
42+
</Menu>
43+
<Row gutter={8}>
44+
<Col xs={24} md={6}>
45+
{me ? <UserProfile /> : <LoginForm />}
46+
</Col>
47+
<Col xs={24} md={12}>
48+
{children}
49+
</Col>
50+
<Col xs={24} md={6}>
51+
<a href="https://www.zerocho.com" target="_blank" rel="noreferrer noopener">Made by ZeroCho</a>
52+
</Col>
53+
</Row>
54+
</div>
7855
);
7956
};
8057

8158
AppLayout.propTypes = {
82-
children: ProTypes.node.isRequired,
59+
children: PropTypes.node.isRequired,
8360
};
8461

8562
export default AppLayout;

0 commit comments

Comments
 (0)