This repository has been archived by the owner on Nov 16, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1913 from bandprotocol/1620-implement-uptime-new-…
…design2 Scan: implement uptime bar on validator home page
- Loading branch information
Showing
4 changed files
with
90 additions
and
35 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,31 @@ | ||
module Styles = { | ||
open Css; | ||
|
||
let bar = | ||
style([ | ||
display(`flex), | ||
width(`percent(100.)), | ||
height(`px(12)), | ||
border(`px(1), `solid, Colors.blueGray4), | ||
borderRadius(`px(6)), | ||
padding(`px(1)), | ||
justifyContent(`flexStart), | ||
]); | ||
|
||
let innerBar = (percent, color) => | ||
style([backgroundColor(color), width(`percent(percent)), borderRadius(`px(6))]); | ||
}; | ||
|
||
[@react.component] | ||
let make = (~percent) => { | ||
let color = | ||
if (percent == 100.) { | ||
Colors.purple8; | ||
} else if (percent < 100. && percent >= 79.) { | ||
Colors.purple4; | ||
} else { | ||
Colors.purple2; | ||
}; | ||
|
||
<div className=Styles.bar> <div className={Styles.innerBar(percent, color)} /> </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
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