-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fabeaa7
commit 882e664
Showing
10 changed files
with
682 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
const getButtonBackground = () => { | ||
if (props.type === "primary") { | ||
if (props.disabled) { | ||
return "#e5e5e5"; | ||
} | ||
return "#dd3345"; | ||
} else if (props.type === "secondary") { | ||
// TODO: handle disabled | ||
return "#FCE9D5"; | ||
} | ||
}; | ||
|
||
const getButtonColor = () => { | ||
if (props.type === "primary") { | ||
if (props.disabled) { | ||
return "darkgrey"; | ||
} | ||
return "white"; | ||
} | ||
return "#2E2E2E"; | ||
}; | ||
|
||
const Button = styled.button` | ||
// width: 100%; | ||
height: 100%; | ||
flex-direction: row; | ||
justify-content: center; | ||
align-items: center; | ||
padding: 8px 24px 12px 24px; | ||
background: ${getButtonBackground()}; | ||
overflow: hidden; | ||
box-shadow: 0px -2.700000047683716px 0px #4a4a4a inset; | ||
border-radius: 6px; | ||
border: 1px solid #4a4a4a; | ||
gap: 8px; | ||
display: inline-flex; | ||
text-align: center; | ||
color: ${getButtonColor()}; | ||
font-size: 14px; | ||
font-weight: 600; | ||
&:hover { | ||
text-decoration: none; | ||
cursor: ${props.disabled ? "not-allowed" : "pointer"}; | ||
} | ||
`; | ||
|
||
console.log("rendering action button"); | ||
|
||
return ( | ||
<Button | ||
onClick={(e) => { | ||
e.preventDefault(); | ||
props.onClick(e); | ||
}} | ||
disabled={props.disabled} | ||
> | ||
{props.text} | ||
</Button> | ||
); |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.