Skip to content

Commit

Permalink
Refactor : dropdown header css ์ˆ˜์ • (#115)
Browse files Browse the repository at this point in the history
* Feat: ํ†ฑ๋‹ˆ๋ฐ”ํ€ด ์•„์ด์ฝ˜ ์ถ”๊ฐ€

์‚ฌ์šฉํ•  ํ†ฑ๋‹ˆ๋ฐ”ํ€ด์•„์ด์ฝ˜์ปดํฌ๋„ŒํŠธ ์ถ”๊ฐ€.

* Refactor: Dropdown header ์ˆ˜์ •

className ๋น„๋งค์นญ ๋ฌธ์ œ ํ•ด๊ฒฐ
close button css ์กฐ์ •.
dropdown body์™€ padding ๊ฐ™๊ฒŒ ๋งž์ถฐ์คŒ.

* Refactor: x ๋ฒ„ํŠผ ์ˆ˜์ •

ํ•ด์ƒ๋„ ๋ฌธ์ œ๋กœ png ํŒŒ์ผ์—์„œ svg๋กœ ๋ณ€๊ฒฝ.

* Refact: ๋“œ๋กญ๋‹ค์šด ํ…Œ๋‘๋ฆฌ ์ƒ‰ ์ˆ˜์ •

body์— ์žˆ๋Š” ์„ ๊ณผ ์ƒ‰์ด ๊ฐ™๋„๋ก ๋“œ๋กญ๋‹ค์šด ์ƒ‰์„ ๋ณ€๊ฒฝ.
  • Loading branch information
LeeSuKyeong authored Nov 9, 2020
1 parent 4d083ce commit 0af308a
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 9 deletions.
22 changes: 22 additions & 0 deletions front/src/components/Icon/CloseButtonIconComponent.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import React from 'react';

const CloseButtonIconComponent = () => {
return (
<svg
aria-label="Close menu"
className="octicon octicon-x"
viewBox="0 0 16 16"
version="1.1"
width="16"
height="16"
role="img"
>
<path
fillRule="evenodd"
d="M3.72 3.72a.75.75 0 011.06 0L8 6.94l3.22-3.22a.75.75 0 111.06 1.06L9.06 8l3.22 3.22a.75.75 0 11-1.06 1.06L8 9.06l-3.22 3.22a.75.75 0 01-1.06-1.06L6.94 8 3.72 4.78a.75.75 0 010-1.06z"
/>
</svg>
);
};

export default CloseButtonIconComponent;
21 changes: 21 additions & 0 deletions front/src/components/Icon/GearIconComponent.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions front/src/components/Icon/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
export { default as OpenIconComponent } from './OpenIconComponent';
export { default as CheckIconComponent } from './CheckIconComponent';
export { default as ClosedIconComponent } from './ClosedIconComponent';
export { default as GearIconComponent } from './GearIconComponent';
export { default as CloseButtonIconComponent } from './CloseButtonIconComponent';
15 changes: 6 additions & 9 deletions front/src/components/dropdown/Dropdown.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { useState } from 'react';
import styled from 'styled-components';
import color from '../../libs/color';
import { CloseButtonIconComponent } from '../Icon';

const DropdownContainer = styled.div`
display: inline-flex;
Expand All @@ -17,7 +18,7 @@ const DropdownMenu = styled.div`
flex-direction: column;
margin-top: 1.8rem;
position: absolute;
border: 1px solid ${color.boldBlue};
border: 1px solid ${color.lightGray};
border-radius: 0.2rem;
background-color: white;
z-index: 11;
Expand All @@ -30,7 +31,7 @@ const DropdownBody = styled.div`
const Header = styled.div`
display: flex;
flex-direction: row;
padding: 0.3rem;
padding: 0.2rem 1rem;
font-weight: bolder;
.header-title {
min-width: max-content;
Expand All @@ -48,7 +49,7 @@ const DropdownOverlay = styled.div`

const CloseButton = styled.div`
width: fit-content;
margin-left: 4rem;
margin-left: auto;
&:hover {
cursor: pointer;
}
Expand Down Expand Up @@ -83,13 +84,9 @@ const Dropdown = ({ headerText, button, children }) => {
const DropdownHeader = ({ headerText, toggleHandler }) => {
return (
<Header>
<div className="dropdown-header">{headerText}</div>
<div className="header-title">{headerText}</div>
<CloseButton className="dropdown-button-close" onClick={toggleHandler}>
<img
className="button-image"
src="https://img.icons8.com/material-rounded/24/000000/delete-sign.png"
alt="close"
/>
<CloseButtonIconComponent />
</CloseButton>
</Header>
);
Expand Down

0 comments on commit 0af308a

Please sign in to comment.