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-04-18 18:30:16 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
66900dbfbb4639305f8d24e5fdd0541e9ea874a4
66900dbf
1 parent
3399dbd6
feat: Common component 추가- Button
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
2 deletions
frontend/src/components/common/Button.js
frontend/src/components/common/Button.js
View file @
66900db
import
React
from
'react'
;
import
styled
from
'styled-components'
;
import
{
buttonColorMap
}
from
'../../lib/styles/palette'
;
const
Button
=
()
=>
{
return
<
div
>
Button
<
/div>;
const
ButtonBlock
=
styled
.
button
`
width: 20%;
background-color:
${
props
=>
buttonColorMap
[
props
.
color
].
background
}
;
&:hover {
background-color:
${
props
=>
buttonColorMap
[
props
.
color
].
hoverBackground
}
;
}
color:
${
props
=>
buttonColorMap
[
props
.
color
].
color
}
;
float:
${
props
=>
props
.
float
||
''
}
;
`
;
const
Button
=
({
children
,
color
,
float
})
=>
{
return
(
<
ButtonBlock
color
=
{
color
}
float
=
{
float
}
>
{
children
}
<
/ButtonBlock>
);
};
export
default
Button
;
...
...
Please
register
or
login
to post a comment