Toggle navigation
Toggle navigation
This project
Loading...
Sign in
2021-1-capstone-design1
/
GCL_Project1
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
이승윤
2021-05-08 13:56:36 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
6ccb8c3f3b08efbf1ff32a8eb578047a88937b82
6ccb8c3f
1 parent
70eb72c2
style: Dropdown 폼 변경(ul-li -> select)
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
46 deletions
frontend/src/components/common/DropDownList.js
frontend/src/components/common/DropdownButton.js
frontend/src/components/common/DropDownList.js
deleted
100644 → 0
View file @
70eb72c
import
React
from
'react'
;
import
styled
from
'styled-components'
;
import
{
dropdownListColorMap
}
from
'../../lib/styles/palette'
;
const
DropDownListBlock
=
styled
.
div
`
float:
${
props
=>
props
.
float
||
''
}
;
width:
${
props
=>
props
.
size
||
'40%'
}
;
`
;
const
DropDownList
=
styled
.
ul
`
padding: 0;
margin: 0;
background-color:
${
props
=>
dropdownListColorMap
[
props
.
color
].
background
}
;
border: 2px solid
${
props
=>
dropdownListColorMap
[
props
.
color
].
borderColor
}
;
box-sizing: border-box;
color:
${
props
=>
dropdownListColorMap
[
props
.
color
].
color
}
;
font-size: 1.3rem;
font-weight: 500;
&:first-child {
padding-top: 0.5em;
}
`
;
const
ListItem
=
styled
.
li
`
list-style: none;
padding-left: 1em;
padding-bottom: 0.3em;
border-bottom: 2px solid #e5e5e5;
`
;
const
DropDown
=
({
children
,
color
,
float
,
size
})
=>
{
return
(
<
DropDownListBlock
color
=
{
color
}
float
=
{
float
}
size
=
{
size
}
>
<
DropDownList
color
=
{
color
}
>
<
ListItem
>
{
children
}
<
/ListItem
>
<
/DropDownList
>
<
/DropDownListBlock
>
);
};
export
default
DropDown
;
frontend/src/components/common/DropdownButton.js
View file @
6ccb8c3
...
...
@@ -6,14 +6,14 @@ const DropDownBlock = styled.div`
margin: 0 auto;
float:
${
props
=>
props
.
float
||
''
}
;
`
;
const
DropDownHeader
=
styled
.
button
`
const
DropDownHeader
=
styled
.
select
`
margin-bottom: 0.8em;
padding: 0.4em;
width:
${
props
=>
props
.
width
||
'100px'
}
;
line-
height:
${
props
=>
props
.
height
||
'30px'
}
;
height:
${
props
=>
props
.
height
||
'30px'
}
;
padding-right: 30px;
font-size:
${
props
=>
props
.
fontsize
||
'20px'
}
;
cursor: pointer;
color:
${
props
=>
dropdownHeaderColorMap
[
props
.
color
].
color
}
;
background-color:
${
props
=>
dropdownHeaderColorMap
[
props
.
color
].
background
}
;
&:hover {
...
...
@@ -21,18 +21,37 @@ const DropDownHeader = styled.button`
dropdownHeaderColorMap
[
props
.
color
].
hoverBackground
}
;
}
border: 1px
${
props
=>
dropdownHeaderColorMap
[
props
.
color
].
background
}
;
option {
color: blue;
background-color: blue;
display: flex;
white-space: pre;
min-height: 20px;
padding: 0px 2px 1px;
}
`
;
const
DropDown
=
({
children
,
float
,
color
,
fontsize
,
width
,
height
})
=>
{
const
DropDown
=
({
options
,
float
,
color
=
'blue'
,
fontsize
,
width
,
height
,
})
=>
{
return
(
<
DropDownBlock
float
=
{
float
}
color
=
{
color
}
>
<
DropDownHeader
options
=
{
options
}
color
=
{
color
}
fontsize
=
{
fontsize
}
width
=
{
width
}
height
=
{
height
}
>
{
children
}
{
options
.
map
(
friend
=>
(
<
option
value
=
{
friend
.
id
}
>
{
friend
.
name
}
<
/option
>
))}
<
/DropDownHeader
>
<
/DropDownBlock
>
);
...
...
Please
register
or
login
to post a comment