Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Website/Leaderboard - Implemented radio buttons for filtering (#5046)
* added radio buttons * moved placement of radio buttons * Added docs and fix to filter metrics * minor css fixes * css fixes and renamed filter to toggle to match figma scheme * added key param * added toggle button file * reformat Co-authored-by: Carey Janecka <careyjanecka@gmail.com>
- Loading branch information
1 parent
337b263
commit 19bb378
Showing
3 changed files
with
155 additions
and
0 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
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,53 @@ | ||
module ButtonStyles = { | ||
open Css; | ||
|
||
let textStyles = | ||
merge([Theme.H6.extraSmall, style([textTransform(`uppercase)])]); | ||
|
||
let hover = | ||
hover([ | ||
backgroundColor(Theme.Colors.hyperlinkHover), | ||
color(Theme.Colors.white), | ||
textShadow(~y=`px(1), Theme.Colors.blackAlpha(0.25)), | ||
]); | ||
|
||
let button = | ||
merge([ | ||
textStyles, | ||
style([ | ||
hover, | ||
display(`flex), | ||
justifyContent(`center), | ||
alignItems(`center), | ||
width(`rem(13.5)), | ||
height(`rem(2.5)), | ||
textAlign(`center), | ||
backgroundColor(Theme.Colors.gandalf), | ||
color(Theme.Colors.denimTwo), | ||
cursor(`pointer), | ||
]), | ||
]); | ||
|
||
let selectedButton = | ||
merge([ | ||
button, | ||
style([ | ||
boxShadow(~blur=`px(8), ~inset=true, Theme.Colors.blackAlpha(0.1)), | ||
textShadow(~y=`px(1), Theme.Colors.blackAlpha(0.25)), | ||
backgroundColor(Theme.Colors.hyperlink), | ||
color(Theme.Colors.white), | ||
]), | ||
]); | ||
}; | ||
|
||
[@react.component] | ||
let make = (~currentOption, ~onTogglePress, ~label) => { | ||
<div | ||
className={ | ||
currentOption == label | ||
? ButtonStyles.selectedButton : ButtonStyles.button | ||
} | ||
onClick={_ => onTogglePress(label)}> | ||
{React.string(label)} | ||
</div>; | ||
}; |
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