Colorize next open closing text

This commit is contained in:
2018-03-21 01:02:56 +05:30
parent 532e296b4d
commit 8a9d6b6db3
2 changed files with 13 additions and 2 deletions
@@ -4,7 +4,6 @@
height: 100%;
font-size: 1em;
background-color: rgba(0, 0, 0, 0.75);
color: rgba(255, 255, 255, 0.60);
font-size: 2em;
position: relative;
@@ -24,3 +23,11 @@
width: 80%;
transform: translate(-50%, -50%);
}
.NextOpenCloseMini .green-text {
color: rgba(46, 204, 64, 0.75);
}
.NextOpenCloseMini .red-text {
color: rgba(255, 64, 54, 0.75);
}
@@ -31,13 +31,17 @@ export class NextOpenCloseMini extends React.Component<NextOpenCloseMiniProps, {
return this.openOrClose === OpenOrClose.Open ? "opening" : "closing";
}
getOpeningClosingClassName() {
return this.openOrClose === OpenOrClose.Open ? "green-text" : "red-text";
}
renderDate(): JSX.Element[] {
const tmpNextDate = this.nextOpenOrCloseDate as moment.Moment;
var nextDateString = tmpNextDate.from(this.xDay);
return [
(
<div className="openCloseDecription" key="title">
Next {this.getOpeningClosingString()}
Next <span className={this.getOpeningClosingClassName()}>{this.getOpeningClosingString()}</span>
</div>
),
(