이승윤

Merge branch 'style/mantine-styled' into 'develop'

Style/mantine styled



See merge request !9
...@@ -14,7 +14,9 @@ ...@@ -14,7 +14,9 @@
14 "react-scripts": "4.0.3", 14 "react-scripts": "4.0.3",
15 "redux": "^4.0.5", 15 "redux": "^4.0.5",
16 "styled-components": "^5.2.3", 16 "styled-components": "^5.2.3",
17 - "web-vitals": "^1.0.1" 17 + "web-vitals": "^1.0.1",
18 + "@mantine/core": "^1.0.6",
19 + "@mantine/hooks": "^1.0.6"
18 }, 20 },
19 "scripts": { 21 "scripts": {
20 "start": "react-scripts start", 22 "start": "react-scripts start",
......
...@@ -31,14 +31,15 @@ const MenuContainer = styled.div` ...@@ -31,14 +31,15 @@ const MenuContainer = styled.div`
31 `; 31 `;
32 32
33 const LogoContainer = styled.div` 33 const LogoContainer = styled.div`
34 - margin-top: 20px; 34 + margin-top: 10px;
35 float: left; 35 float: left;
36 padding: 20px; 36 padding: 20px;
37 img { 37 img {
38 - width: 100px; 38 + width: 130px;
39 39
40 vertical-align: bottom; 40 vertical-align: bottom;
41 } 41 }
42 + cursor: pointer;
42 `; 43 `;
43 44
44 const SearchContainer = styled.div` 45 const SearchContainer = styled.div`
...@@ -83,8 +84,8 @@ const SortOptionContainer = styled.div` ...@@ -83,8 +84,8 @@ const SortOptionContainer = styled.div`
83 84
84 const OptionContainer = styled.div` 85 const OptionContainer = styled.div`
85 position: absolute; 86 position: absolute;
86 - top: 129px; 87 + top: 132px;
87 - left: 650px; 88 + left: 750px;
88 `; 89 `;
89 90
90 const UserContainer = styled.div` 91 const UserContainer = styled.div`
...@@ -115,7 +116,9 @@ const Header = () => { ...@@ -115,7 +116,9 @@ const Header = () => {
115 <> 116 <>
116 <MainContainer> 117 <MainContainer>
117 <HeaderTop /> 118 <HeaderTop />
118 - <LogoContainer onClick={onMainClick}>로고</LogoContainer> 119 + <LogoContainer onClick={onMainClick}>
120 + <img src="eDrive_logo_v2.png" alt="" />
121 + </LogoContainer>
119 <SearchContainer> 122 <SearchContainer>
120 <DropDownContainer> 123 <DropDownContainer>
121 <DropDownWrap> 124 <DropDownWrap>
...@@ -124,15 +127,11 @@ const Header = () => { ...@@ -124,15 +127,11 @@ const Header = () => {
124 float="left" 127 float="left"
125 fontsize="20px" 128 fontsize="20px"
126 height="50px" 129 height="50px"
127 - options={[ 130 + options={[{ id: 1, name: '전체' }]}
128 - { id: 1, name: '전체' },
129 - { id: 2, name: '개인' },
130 - { id: 3, name: '부서' },
131 - ]}
132 /> 131 />
133 </DropDownWrap> 132 </DropDownWrap>
134 </DropDownContainer> 133 </DropDownContainer>
135 - <InputBlock color="blue" size="14px" width="400px" display=""> 134 + <InputBlock color="blue" fontsize="20px" width="850px" display="">
136 <input /> 135 <input />
137 </InputBlock> 136 </InputBlock>
138 </SearchContainer> 137 </SearchContainer>
...@@ -141,34 +140,31 @@ const Header = () => { ...@@ -141,34 +140,31 @@ const Header = () => {
141 <SLink activeClassName="active" to="/search"> 140 <SLink activeClassName="active" to="/search">
142 전체 141 전체
143 </SLink> 142 </SLink>
144 - <SLink to="/search_categori1">개인</SLink>
145 - <SLink to="/search_categori2">부서</SLink>
146 </ul> 143 </ul>
147 </MenuContainer> 144 </MenuContainer>
148 <OptionContainer> 145 <OptionContainer>
149 - <SearchOptionContainer onClick={openModal}>
150 - <Button color="white">고급 검색</Button>
151 - </SearchOptionContainer>
152 - <Modal showModal={showModal} setShowModal={setShowModal} />
153 <SortOptionContainer> 146 <SortOptionContainer>
154 <DropDownButton 147 <DropDownButton
155 color="white" 148 color="white"
156 width="85px" 149 width="85px"
157 - fontsize="16px" 150 + fontsize="15px"
158 - height="38px" 151 + height="36px"
152 + title="정렬(기본)"
159 options={[ 153 options={[
160 - { value: 0, name: '정렬' }, 154 + { id: 0, name: '정렬(기본)' },
161 - { value: 1, name: '날짜빠른순' }, 155 + { id: 1, name: '날짜빠른순' },
162 - { value: 2, name: '크기높은순' }, 156 + { id: 2, name: '크기높은순' },
163 - { value: 3, name: '크기낮은순' }, 157 + { id: 3, name: '크기낮은순' },
164 ]} 158 ]}
165 - > 159 + />
166 - 정렬
167 - </DropDownButton>
168 </SortOptionContainer> 160 </SortOptionContainer>
161 + <SearchOptionContainer onClick={openModal}>
162 + <Button color="gray">고급 검색</Button>
163 + </SearchOptionContainer>
164 + <Modal showModal={showModal} setShowModal={setShowModal} />
169 </OptionContainer> 165 </OptionContainer>
170 <UserContainer> 166 <UserContainer>
171 - <Button color="white" width="100px" height="50px" fontsize="20px"> 167 + <Button color="blue" width="100px" height="50px" fontsize="20px">
172 사용자 168 사용자
173 </Button> 169 </Button>
174 </UserContainer> 170 </UserContainer>
......
1 -import React from 'react';
2 -import { Link } from 'react-router-dom';
3 -import styled from 'styled-components';
4 -import palette from '../lib/styles/palette';
5 -import Button from './common/Button';
6 -
7 -const FormBlock = styled.form`
8 - position: absolute;
9 - top: 50%;
10 - left: 50%;
11 - transform: translate(-50%, -50%);
12 - width: 25rem;
13 - padding: 2.5rem;
14 - box-sizing: border-box;
15 - border: 1px solid #dadce0;
16 - -webkit-border-radius: 8px;
17 - border-radius: 8px;
18 - text-align: center;
19 -`;
20 -
21 -const InputBox = styled.div`
22 - position: relative;
23 - input {
24 - width: 93%;
25 - padding: 0.625rem 10px;
26 - font-size: 1rem;
27 - letter-spacing: 0.062rem;
28 - margin-bottom: 1.875rem;
29 - border: 1px solid #ccc;
30 - background: transparent;
31 - border-radius: 4px;
32 - }
33 - .label {
34 - position: absolute;
35 - top: 0;
36 - left: 10px;
37 - padding: 0.625rem 0;
38 - font-size: 1rem;
39 - color: grey;
40 - pointer-events: none;
41 - transition: 0.5s;
42 - }
43 -
44 - input:focus ~ .label,
45 - input:valid ~ .label,
46 - input:not([value='']) ~ .label {
47 - top: -1.125rem;
48 - left: 10px;
49 - color: ${palette.blue6};
50 - font-size: 0.75rem;
51 - background-color: #fff;
52 - height: 10px;
53 - padding-left: 5px;
54 - padding-right: 5px;
55 - }
56 -
57 - input:focus {
58 - outline: none;
59 - border: 2px solid ${palette.blue6};
60 - }
61 - input[type='submit'] {
62 - border: none;
63 - outline: none;
64 - color: #fff;
65 - background-color: ${palette.blue6};
66 - padding: 0.625rem 1.25rem;
67 - cursor: pointer;
68 - border-radius: 0.312rem;
69 - font-size: 1rem;
70 - float: right;
71 - }
72 -
73 - input[type='submit']:hover {
74 - background-color: ${palette.blue6};
75 - box-shadow: 0 1px 1px 0 rgba(66, 133, 244, 0.45),
76 - 0 1px 3px 1px rgba(66, 133, 244, 0.3);
77 - }
78 -`;
79 -
80 -const ButtonBlock = styled.div`
81 - display: flex;
82 - justify-content: space-between;
83 - padding: 1rem;
84 -
85 - a {
86 - color: ${palette.blue6};
87 - text-decoration: none;
88 - }
89 -`;
90 -
91 -const Login = () => {
92 - return (
93 - <FormBlock>
94 - <div>Logo</div>
95 - <h1>로그인</h1>
96 - <InputBox>
97 - <input type="email" id="email" name="email" value="" />
98 - <div className="label">Email</div>
99 - </InputBox>
100 - <InputBox>
101 - <input type="text" name="text" value="" />
102 - <div className="label">Password</div>
103 - </InputBox>
104 - <ButtonBlock>
105 - <Link to="/">홈으로</Link>
106 - <Button color="blue">로그인</Button>
107 - </ButtonBlock>
108 - </FormBlock>
109 - );
110 -};
111 -
112 -export default Login;
1 import React, { useRef } from 'react'; 1 import React, { useRef } from 'react';
2 +import { Card } from '@mantine/core';
2 import styled from 'styled-components'; 3 import styled from 'styled-components';
3 import Button from './common/Button'; 4 import Button from './common/Button';
4 import Input from './common/Input'; 5 import Input from './common/Input';
5 6
6 -const Background = styled.div` 7 +const Background = styled.div``;
7 - position: fixed; 8 +
8 - display: flex;
9 - justify-content: center;
10 - align-items: center;
11 -`;
12 const ModalWrapper = styled.div` 9 const ModalWrapper = styled.div`
13 width: 400px; 10 width: 400px;
14 - height: 350px; 11 + height: 300px;
15 - box-shadow: 0 5px 16px rgba(0, 0, 0, 0.2);
16 - background: #fff;
17 - color: #000;
18 - display: grid;
19 - grid-template-columns: 1fr 1fr;
20 - position: relative;
21 - z-index: 10;
22 - border-radius: 10px;
23 `; 12 `;
24 13
25 const ModalContent = styled.div` 14 const ModalContent = styled.div`
...@@ -79,54 +68,69 @@ const Modal = ({ showModal, setShowModal }) => { ...@@ -79,54 +68,69 @@ const Modal = ({ showModal, setShowModal }) => {
79 <> 68 <>
80 {showModal ? ( 69 {showModal ? (
81 <Background onClick={closeModal}> 70 <Background onClick={closeModal}>
82 - <ModalWrapper> 71 + <Card shadow="lg">
83 - <ModalContent> 72 + <ModalWrapper>
84 - <TextWrap top="15px" right="20px" bottom="19px"> 73 + <ModalContent>
85 - 기본검색 74 + <TextWrap top="6%" right="10%" bottom="4%" height="40px">
86 - </TextWrap> 75 + 기본검색
87 - <StandardWrap> 76 + </TextWrap>
88 - <Input float="left" color="blue" width="140px" size="10px" /> 77 + <StandardWrap>
89 - </StandardWrap> 78 + <Input
90 - <TextWrap top="75px" right="20px" bottom="137px"> 79 + float="left"
91 - 고급검색 80 + color="blue"
92 - </TextWrap> 81 + width="350px"
93 - <AdvancedWrap> 82 + height="40px"
94 - <Input 83 + paddingsize="3px"
95 - float="left" 84 + fontsize="15px"
96 - color="blue" 85 + />
97 - width="140px" 86 + </StandardWrap>
98 - size="10px" 87 + <TextWrap top="24%" right="10%" bottom="31%">
99 - placeholder="단어/ 문장검색" 88 + 고급검색
100 - /> 89 + </TextWrap>
101 - <br /> <br /> 90 + <AdvancedWrap>
102 - <Input 91 + <Input
103 - float="left" 92 + float="left"
104 - color="blue" 93 + color="blue"
105 - width="140px" 94 + width="350px"
106 - size="10px" 95 + height="40px"
107 - placeholder="최초 작성자" 96 + paddingsize="3px"
108 - /> 97 + fontsize="15px"
109 - <br /> <br /> 98 + placeholder="단어/ 문장검색"
110 - <Input 99 + />
111 - float="left" 100 + <br /> <br />
112 - color="blue" 101 + <Input
113 - width="140px" 102 + float="left"
114 - size="10px" 103 + color="blue"
115 - placeholder="최종 수정자" 104 + width="350px"
116 - /> 105 + height="40px"
117 - </AdvancedWrap> 106 + paddingsize="3px"
118 - </ModalContent> 107 + fontsize="15px"
119 - <CloseWrap onClick={() => setShowModal(prev => !prev)}> 108 + placeholder="최초 작성자"
120 - <Button width="100px" color="blue"> 109 + />
121 - 닫기 110 + <br /> <br />
122 - </Button> 111 + <Input
123 - </CloseWrap> 112 + float="left"
124 - <SearchWrap> 113 + color="blue"
125 - <Button width="100px" color="gray"> 114 + width="350px"
126 - 검색 115 + height="40px"
127 - </Button> 116 + paddingsize="3px"
128 - </SearchWrap> 117 + fontsize="15px"
129 - </ModalWrapper> 118 + placeholder="최종 수정자"
119 + />
120 + </AdvancedWrap>
121 + </ModalContent>
122 + <CloseWrap onClick={() => setShowModal(prev => !prev)}>
123 + <Button width="100px" color="blue">
124 + 닫기
125 + </Button>
126 + </CloseWrap>
127 + <SearchWrap>
128 + <Button width="100px" color="gray">
129 + 검색
130 + </Button>
131 + </SearchWrap>
132 + </ModalWrapper>
133 + </Card>
130 </Background> 134 </Background>
131 ) : null} 135 ) : null}
132 </> 136 </>
......
1 import React from 'react'; 1 import React from 'react';
2 import styled from 'styled-components'; 2 import styled from 'styled-components';
3 -import { buttonColorMap } from '../../lib/styles/palette'; 3 +import { Button } from '@mantine/core';
4 4
5 -const ButtonBlock = styled.button` 5 +const ButtonBlock = styled.div`
6 width: ${props => props.width || '80px'}; 6 width: ${props => props.width || '80px'};
7 - height: ${props => props.height || '40px'};
8 font-size: ${props => props.fontsize || '15px'}; 7 font-size: ${props => props.fontsize || '15px'};
9 - background-color: ${props => buttonColorMap[props.color].background};
10 - &:hover {
11 - background-color: ${props => buttonColorMap[props.color].hoverBackground};
12 - }
13 - color: ${props => buttonColorMap[props.color].color};
14 float: ${props => props.float || ''}; 8 float: ${props => props.float || ''};
15 border-radius: 0.3em; 9 border-radius: 0.3em;
16 cursor: pointer; 10 cursor: pointer;
17 - border: 1px ${props => buttonColorMap[props.color].background};
18 `; 11 `;
19 12
20 -const Button = ({ children, color, float, width, height, fontsize }) => { 13 +const Buttons = ({ children, color, float, width, fontsize }) => {
21 return ( 14 return (
22 - <ButtonBlock 15 + <ButtonBlock float={float} width={width} fontsize={fontsize}>
23 - color={color || 'blue'} 16 + <Button fullWidth size="lg" color={color || 'blue'}>
24 - float={float} 17 + {children}
25 - width={width} 18 + </Button>
26 - height={height}
27 - fontsize={fontsize}
28 - >
29 - {children}
30 </ButtonBlock> 19 </ButtonBlock>
31 ); 20 );
32 }; 21 };
33 22
34 -export default Button; 23 +export default Buttons;
......
1 -import React from 'react'; 1 +import React, { useState, useEffect } from 'react';
2 +import { Menu, MenuItem } from '@mantine/core';
2 import styled from 'styled-components'; 3 import styled from 'styled-components';
3 import { dropdownHeaderColorMap } from '../../lib/styles/palette'; 4 import { dropdownHeaderColorMap } from '../../lib/styles/palette';
4 5
...@@ -6,30 +7,23 @@ const DropDownBlock = styled.div` ...@@ -6,30 +7,23 @@ const DropDownBlock = styled.div`
6 margin: 0 auto; 7 margin: 0 auto;
7 float: ${props => props.float || ''}; 8 float: ${props => props.float || ''};
8 `; 9 `;
9 -const DropDownHeader = styled.select` 10 +const DropDownHeader = styled(Menu)``;
10 - margin-bottom: 0.8em; 11 +
11 - padding: 0.4em; 12 +const DropDownWrap = styled.button`
12 - width: ${props => props.width || '100px'};
13 - height: ${props => props.height || '30px'};
14 - padding-right: 30px;
15 - font-size: ${props => props.fontsize || '20px'};
16 - cursor: pointer;
17 color: ${props => dropdownHeaderColorMap[props.color].color}; 13 color: ${props => dropdownHeaderColorMap[props.color].color};
18 background-color: ${props => dropdownHeaderColorMap[props.color].background}; 14 background-color: ${props => dropdownHeaderColorMap[props.color].background};
15 + cursor: pointer;
19 &:hover { 16 &:hover {
20 background-color: ${props => 17 background-color: ${props =>
21 dropdownHeaderColorMap[props.color].hoverBackground}; 18 dropdownHeaderColorMap[props.color].hoverBackground};
22 } 19 }
20 + margin-bottom: 0.8em;
21 + padding: 0.4em;
22 + width: ${props => props.width || '100px'};
23 + height: ${props => props.height || '30px'};
24 + padding-right: 7%;
25 + font-size: ${props => props.fontsize || '20px'};
23 border: 1px ${props => dropdownHeaderColorMap[props.color].background}; 26 border: 1px ${props => dropdownHeaderColorMap[props.color].background};
24 -
25 - option {
26 - color: blue;
27 - background-color: blue;
28 - display: flex;
29 - white-space: pre;
30 - min-height: 20px;
31 - padding: 0px 2px 1px;
32 - }
33 `; 27 `;
34 28
35 const DropDown = ({ 29 const DropDown = ({
...@@ -39,18 +33,36 @@ const DropDown = ({ ...@@ -39,18 +33,36 @@ const DropDown = ({
39 fontsize, 33 fontsize,
40 width, 34 width,
41 height, 35 height,
36 + title = '전체',
42 }) => { 37 }) => {
38 + const [menuTitle, setTitle] = useState('');
39 + useEffect(() => {
40 + setTitle(title);
41 + }, []);
43 return ( 42 return (
44 - <DropDownBlock float={float} color={color}> 43 + <DropDownBlock float={float} color={color} title={title}>
45 <DropDownHeader 44 <DropDownHeader
46 - options={options} 45 + control={
47 - color={color} 46 + <DropDownWrap
48 - fontsize={fontsize} 47 + options={options}
49 - width={width} 48 + color={color}
50 - height={height} 49 + fontsize={fontsize}
50 + width={width}
51 + height={height}
52 + >
53 + {menuTitle}
54 + </DropDownWrap>
55 + }
51 > 56 >
52 {options.map(friend => ( 57 {options.map(friend => (
53 - <option value={friend.id}>{friend.name}</option> 58 + <MenuItem
59 + value={friend.id}
60 + onClick={() => {
61 + setTitle(friend.name);
62 + }}
63 + >
64 + {friend.name}
65 + </MenuItem>
54 ))} 66 ))}
55 </DropDownHeader> 67 </DropDownHeader>
56 </DropDownBlock> 68 </DropDownBlock>
......
1 -import React, { useState } from 'react'; 1 +import React, { useState, useEffect } from 'react';
2 +import { TextInput } from '@mantine/core';
2 import styled from 'styled-components'; 3 import styled from 'styled-components';
3 -import { useHistory } from 'react-router-dom'; 4 +import { useHistory, useLocation } from 'react-router-dom';
4 import SearchBox from './SearchBox'; 5 import SearchBox from './SearchBox';
5 import { inputColorMap } from '../../lib/styles/palette'; 6 import { inputColorMap } from '../../lib/styles/palette';
6 7
7 const InputBlock = styled.div` 8 const InputBlock = styled.div`
8 - input { 9 + width: ${props => props.width};
9 - padding: ${props => props.size}; 10 + float: ${props => props.float || 'left'};
10 - padding-right: ${props => props.width}; 11 + height: ${props => props.height};
11 - color: ${props => inputColorMap[props.color].color}; 12 +`;
12 - box-shadow: 2px 3px 28px 1px rgba(0, 0, 0, 0.1);
13 - border: 3px solid ${props => inputColorMap[props.color].borderColor};
14 -
15 - font-size: ${props => props.size};
16 13
17 - &::placeholder { 14 +const InputWrap = styled.div`
18 - color: ${props => inputColorMap[props.color].placeholder}; 15 + padding-top: ${props => props.paddingsize};
19 - text-transform: uppercase; 16 + padding-left: 10px;
20 - } 17 + width: 70%;
21 - float: left; 18 + height: 100%;
22 - } 19 + color: ${props => inputColorMap[props.color].color};
23 - float: ${props => props.float || ''}; 20 + box-shadow: 2px 3px 28px 1px rgba(0, 0, 0, 0.1);
21 + outline: none;
22 + font-size: ${props => props.size};
23 + border: 3px solid ${props => inputColorMap[props.color].borderColor};
24 + float: left;
25 +`;
26 +const SearchIconWrap = styled.div`
27 + float: left;
24 `; 28 `;
25 -const SearchIconWrap = styled.div``;
26 29
27 -const Input = ({ 30 +const MyInput = ({
28 color, 31 color,
29 - size, 32 + paddingsize = '10px',
30 float, 33 float,
31 width, 34 width,
35 + height = '50px',
32 placeholder = '내용을 입력해 주세요.', 36 placeholder = '내용을 입력해 주세요.',
33 display, 37 display,
38 + fontsize = '20px',
34 }) => { 39 }) => {
35 const [query, setQuery] = useState(''); 40 const [query, setQuery] = useState('');
36 const history = useHistory(); 41 const history = useHistory();
42 + const search = useLocation();
43 + const name = search.search.substring(7);
44 + useEffect(() => {
45 + setQuery(name);
46 + }, []);
47 +
37 return ( 48 return (
38 <InputBlock 49 <InputBlock
39 color={color} 50 color={color}
40 - size={size} 51 + size={paddingsize}
41 float={float} 52 float={float}
42 width={width} 53 width={width}
43 placeholder={placeholder} 54 placeholder={placeholder}
44 display={display} 55 display={display}
56 + height={height}
45 > 57 >
46 - <input 58 + <InputWrap color={color} paddingsize={paddingsize} float={float}>
47 - placeholder={placeholder} 59 + <TextInput
48 - type="text" 60 + inputStyle={{
49 - value={query} 61 + fontSize: fontsize,
50 - onChange={e => setQuery(e.target.value)} 62 + }}
51 - onKeyPress={e => { 63 + variant="unstyled"
52 - if (e.key === 'Enter') { 64 + placeholder={placeholder}
53 - if (query === '') { 65 + type="text"
54 - alert('검색어를 입력 해 주세요.'); 66 + value={query}
55 - return; 67 + onChange={e => setQuery(e.target.value)}
68 + onKeyPress={e => {
69 + if (e.key === 'Enter') {
70 + if (query === '') {
71 + alert('검색어를 입력 해 주세요.');
72 + return;
73 + }
74 + const params = new URLSearchParams({ query });
75 + history.push(`search?${params.toString()}`);
56 } 76 }
57 - const params = new URLSearchParams({ query }); 77 + }}
58 - history.push(`search?${params.toString()}`); 78 + />
59 - } 79 + </InputWrap>
60 - }}
61 - />
62 <SearchIconWrap 80 <SearchIconWrap
63 onClick={() => { 81 onClick={() => {
64 const params = new URLSearchParams({ query }); 82 const params = new URLSearchParams({ query });
...@@ -71,4 +89,4 @@ const Input = ({ ...@@ -71,4 +89,4 @@ const Input = ({
71 ); 89 );
72 }; 90 };
73 91
74 -export default Input; 92 +export default MyInput;
......
...@@ -5,7 +5,7 @@ import { searchBoxColorMap } from '../../lib/styles/palette'; ...@@ -5,7 +5,7 @@ import { searchBoxColorMap } from '../../lib/styles/palette';
5 const ButtonBlock = styled.button` 5 const ButtonBlock = styled.button`
6 width: ${props => props.size}; 6 width: ${props => props.size};
7 height: ${props => props.size}; 7 height: ${props => props.size};
8 - background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-2 -3 30 30'%3E%3Cpath d='M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z'/%3E%3Cpath d='M0 0h24v24H0z' fill='none'/%3E%3C/svg%3E"); 8 + background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-2 -3 30 30'%3E%3Cpath d='M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z' fill='white'/%3E%3Cpath d='M0 0h24v24H0z' fill='none'/%3E%3C/svg%3E");
9 display: ${props => props.display}; 9 display: ${props => props.display};
10 background-color: ${props => searchBoxColorMap[props.color].background}; 10 background-color: ${props => searchBoxColorMap[props.color].background};
11 &:hover { 11 &:hover {
......
1 +import React from 'react';
2 +import { Link } from 'react-router-dom';
3 +import palette from '../../lib/styles/palette';
4 +
5 +const File = ({ filename }) => {
6 + return (
7 + <Link style={{ color: palette.blue6 }} to="/">
8 + {filename}
9 + </Link>
10 + );
11 +};
12 +export default File;
1 +import { Image, Text } from '@mantine/core';
2 +import React from 'react';
3 +
4 +const Thumbnails = () => {
5 + return (
6 + <>
7 + <Text style={{ marginTop: '1rem' }}>문서 이미지</Text>
8 + <div style={{ display: 'flex', justifyContent: 'space-between' }}>
9 + <Image width={200} height={250} radius="md" withPlaceholder />
10 + <Image width={200} height={250} radius="md" withPlaceholder />
11 + <Image width={200} height={250} radius="md" withPlaceholder />
12 + <Image width={200} height={250} radius="md" withPlaceholder />
13 + </div>
14 + </>
15 + );
16 +};
17 +export default Thumbnails;
1 +import React from 'react';
2 +import { Container, Text } from '@mantine/core';
3 +import File from './File';
4 +import Thumbnails from './Thumbnail';
5 +
6 +const Document = () => {
7 + // 파일이름
8 + // 본문 글 미리보기(짧게 ...으로짤림)
9 + // 문서 내 이미지
10 + return (
11 + <Container
12 + style={{
13 + padding: '2rem 4rem',
14 + margin: '2rem 4rem',
15 + border: '1px solid black',
16 + }}
17 + >
18 + <File filename="Sample Document.docx" />
19 + <Text color="green">경로: /샘플부서/샘플폴더/Sample Document.docx</Text>
20 + <Text>
21 + {`네드 로렘(Ned Rorem 1923- )은 현존하는 미국의 대표적인 현대 작곡가이다.
22 + 무엇 가곡 장르를 섭렵한 첫 번째 미국 작곡가로 많은 사람들에
23 + 의해 미국 가곡 작곡가들의 선두에 있다고 여기질 만큼 뛰어난 가곡을 많이
24 + 작곡한 현대 미...`}
25 + </Text>
26 + <Thumbnails />
27 + </Container>
28 + );
29 +};
30 +export default Document;
1 +import React from 'react';
2 +import { TextInput, Button, Container, CONTAINER_SIZES } from '@mantine/core';
3 +import { useForm } from '@mantine/hooks';
4 +import styled from 'styled-components';
5 +import { Link } from 'react-router-dom';
6 +import palette from '../../lib/styles/palette';
7 +
8 +const LoginFormBlock = styled.div`
9 + display: flex;
10 + height: 100%;
11 + align-items: center;
12 +`;
13 +const ButtonBlock = styled.div`
14 + display: flex;
15 + justify-content: space-between;
16 + margin-top: 2rem;
17 +`;
18 +const FormBlock = styled.div``;
19 +const LoginForm = () => {
20 + const { onSubmit, errors, values, setFieldValue } = useForm({
21 + initialValues: {
22 + email: '',
23 + password: '',
24 + termOfService: false,
25 + },
26 + validationRules: {
27 + email: value => /^[^\s@]+@[^\s@]+$/.test(value),
28 + },
29 + });
30 + return (
31 + <LoginFormBlock>
32 + <Container
33 + size={CONTAINER_SIZES.xs}
34 + padding="xs"
35 + style={{
36 + display: 'block',
37 + width: CONTAINER_SIZES.xs,
38 + padding: '5rem',
39 + border: `1px ${palette.gray3} solid`,
40 + borderRadius: '5px',
41 + }}
42 + >
43 + <h2>Logo</h2>
44 + <FormBlock>
45 + <TextInput
46 + required
47 + label="Email"
48 + placeholder="example@example.com"
49 + error={errors.email && 'Please specify valid email'}
50 + value={values.email}
51 + onChange={event =>
52 + setFieldValue('email', event.currentTarget.value)
53 + }
54 + />
55 + <TextInput
56 + required
57 + label="Password"
58 + placeholder="Your password"
59 + value={values.password}
60 + type="password"
61 + style={{ marginTop: '2rem' }}
62 + onChange={event =>
63 + setFieldValue('password', event.currentTarget.value)
64 + }
65 + />
66 + <ButtonBlock>
67 + <Link to="/">
68 + <Button variant="outline">홈으로</Button>
69 + </Link>
70 + <Button type="button" onClick={onSubmit(v => console.log(v))}>
71 + 로그인
72 + </Button>
73 + </ButtonBlock>
74 + </FormBlock>
75 + </Container>
76 + </LoginFormBlock>
77 + );
78 +};
79 +export default LoginForm;
...@@ -38,12 +38,12 @@ export const buttonColorMap = { ...@@ -38,12 +38,12 @@ export const buttonColorMap = {
38 blue: { 38 blue: {
39 background: palette.blue6, 39 background: palette.blue6,
40 color: 'white', 40 color: 'white',
41 - hoverBackground: palette.blue5, 41 + hoverBackground: palette.blue7,
42 }, 42 },
43 gray: { 43 gray: {
44 - background: palette.gray2, 44 + background: palette.gray7,
45 color: 'black', 45 color: 'black',
46 - hoverBackground: palette.gray5, 46 + hoverBackground: palette.gray8,
47 }, 47 },
48 white: { 48 white: {
49 background: 'white', 49 background: 'white',
......
...@@ -7,45 +7,69 @@ import Input from '../components/common/Input'; ...@@ -7,45 +7,69 @@ import Input from '../components/common/Input';
7 7
8 const Main = styled.div` 8 const Main = styled.div`
9 display: flex; 9 display: flex;
10 - height: 100vh;
11 align-items: center; 10 align-items: center;
12 justify-content: center; 11 justify-content: center;
12 + padding-left: 7%;
13 `; 13 `;
14 14
15 -const SearchBlock = styled.div` 15 +const Container = styled.div`
16 + justify-content: center;
17 + align-items: center;
18 + flex-direction: column;
19 +`;
20 +
21 +const LogoWrap = styled.div`
16 display: flex; 22 display: flex;
23 + margin-top: 11%;
24 + height: 30vh;
25 + align-items: center;
26 + justify-content: center;
17 `; 27 `;
18 28
29 +const SearchBlock = styled.div`
30 + display: inline-block;
31 + width: 100%;
32 + margin-left: 23%;
33 +`;
19 const LoginButtonBlock = styled.div` 34 const LoginButtonBlock = styled.div`
20 position: fixed; 35 position: fixed;
21 top: 20px; 36 top: 20px;
22 right: 20px; 37 right: 20px;
23 `; 38 `;
24 39
40 +const SLink = styled(Link)`
41 + text-decoration: none !important;
42 +`;
43 +
25 const HomePage = () => { 44 const HomePage = () => {
26 return ( 45 return (
27 - <Main> 46 + <Container>
28 - <div>logo</div> 47 + <LogoWrap>
29 - <SearchBlock> 48 + <img src="eDrive_logo.png" alt="" />
30 - <DropDownButton 49 + </LogoWrap>
31 - fontsize="20px" 50 + <Main>
32 - height="50px" 51 + <SearchBlock>
33 - options={[ 52 + <DropDownButton
34 - { id: 1, name: '전체' }, 53 + fontsize="20px"
35 - { id: 2, name: '개인' }, 54 + height="50px"
36 - { id: 3, name: '부서' }, 55 + options={[
37 - ]} 56 + { id: 1, name: '전체' },
38 - /> 57 + { id: 2, name: '개인' },
39 - <Input color="blue" size="14px" width="400px" display /> 58 + { id: 3, name: '부서' },
40 - </SearchBlock> 59 + ]}
41 - 60 + float="left"
42 - {/* Todo : 로그인 했을 경우 로그인 버튼 숨기기 */} 61 + />
43 - <LoginButtonBlock> 62 + <Input color="blue" paddingsize="10px" width="700px" display />
44 - <Link to="/login"> 63 + </SearchBlock>
45 - <Button>로그인</Button> 64 +
46 - </Link> 65 + {/* Todo : 로그인 했을 경우 로그인 버튼 숨기기 */}
47 - </LoginButtonBlock> 66 + <LoginButtonBlock>
48 - </Main> 67 + <SLink to="/login">
68 + <Button>로그인</Button>
69 + </SLink>
70 + </LoginButtonBlock>
71 + </Main>
72 + </Container>
49 ); 73 );
50 }; 74 };
51 75
......
1 import React from 'react'; 1 import React from 'react';
2 -import Login from '../components/Login'; 2 +import Login from '../components/login/LoginForm';
3 3
4 const LoginPage = () => { 4 const LoginPage = () => {
5 return ( 5 return (
......
1 import React from 'react'; 1 import React from 'react';
2 import Header from '../components/Header'; 2 import Header from '../components/Header';
3 +import Main from '../components/document/index';
3 4
4 -const LoginPage = () => { 5 +const SearchPage = () => {
5 return ( 6 return (
6 <> 7 <>
7 <Header /> 8 <Header />
9 + <Main />
8 </> 10 </>
9 ); 11 );
10 }; 12 };
11 13
12 -export default LoginPage; 14 +export default SearchPage;
......