이승윤

style: mantine 적용

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,9 +68,10 @@ const Modal = ({ showModal, setShowModal }) => { ...@@ -79,9 +68,10 @@ const Modal = ({ showModal, setShowModal }) => {
79 <> 68 <>
80 {showModal ? ( 69 {showModal ? (
81 <Background onClick={closeModal}> 70 <Background onClick={closeModal}>
71 + <Card shadow="lg">
82 <ModalWrapper> 72 <ModalWrapper>
83 <ModalContent> 73 <ModalContent>
84 - <TextWrap top="15px" right="20px" bottom="19px" height="40px"> 74 + <TextWrap top="6%" right="10%" bottom="4%" height="40px">
85 기본검색 75 기본검색
86 </TextWrap> 76 </TextWrap>
87 <StandardWrap> 77 <StandardWrap>
...@@ -94,7 +84,7 @@ const Modal = ({ showModal, setShowModal }) => { ...@@ -94,7 +84,7 @@ const Modal = ({ showModal, setShowModal }) => {
94 fontsize="15px" 84 fontsize="15px"
95 /> 85 />
96 </StandardWrap> 86 </StandardWrap>
97 - <TextWrap top="75px" right="20px" bottom="137px"> 87 + <TextWrap top="24%" right="10%" bottom="31%">
98 고급검색 88 고급검색
99 </TextWrap> 89 </TextWrap>
100 <AdvancedWrap> 90 <AdvancedWrap>
...@@ -140,6 +130,7 @@ const Modal = ({ showModal, setShowModal }) => { ...@@ -140,6 +130,7 @@ const Modal = ({ showModal, setShowModal }) => {
140 </Button> 130 </Button>
141 </SearchWrap> 131 </SearchWrap>
142 </ModalWrapper> 132 </ModalWrapper>
133 + </Card>
143 </Background> 134 </Background>
144 ) : null} 135 ) : null}
145 </> 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}
25 - width={width}
26 - height={height}
27 - fontsize={fontsize}
28 - >
29 {children} 17 {children}
18 + </Button>
30 </ButtonBlock> 19 </ButtonBlock>
31 ); 20 );
32 }; 21 };
33 22
34 -export default Button; 23 +export default Buttons;
......
...@@ -21,7 +21,7 @@ const DropDownWrap = styled.button` ...@@ -21,7 +21,7 @@ const DropDownWrap = styled.button`
21 padding: 0.4em; 21 padding: 0.4em;
22 width: ${props => props.width || '100px'}; 22 width: ${props => props.width || '100px'};
23 height: ${props => props.height || '30px'}; 23 height: ${props => props.height || '30px'};
24 - padding-right: 30px; 24 + padding-right: 7%;
25 font-size: ${props => props.fontsize || '20px'}; 25 font-size: ${props => props.fontsize || '20px'};
26 border: 1px ${props => dropdownHeaderColorMap[props.color].background}; 26 border: 1px ${props => dropdownHeaderColorMap[props.color].background};
27 `; 27 `;
......