mirror of
https://github.com/bendtherules/is-nifty-open.git
synced 2026-08-18 13:52:20 +00:00
Colorize next open closing text
This commit is contained in:
@@ -4,7 +4,6 @@
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
font-size: 1em;
|
font-size: 1em;
|
||||||
background-color: rgba(0, 0, 0, 0.75);
|
background-color: rgba(0, 0, 0, 0.75);
|
||||||
|
|
||||||
color: rgba(255, 255, 255, 0.60);
|
color: rgba(255, 255, 255, 0.60);
|
||||||
font-size: 2em;
|
font-size: 2em;
|
||||||
position: relative;
|
position: relative;
|
||||||
@@ -24,3 +23,11 @@
|
|||||||
width: 80%;
|
width: 80%;
|
||||||
transform: translate(-50%, -50%);
|
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";
|
return this.openOrClose === OpenOrClose.Open ? "opening" : "closing";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getOpeningClosingClassName() {
|
||||||
|
return this.openOrClose === OpenOrClose.Open ? "green-text" : "red-text";
|
||||||
|
}
|
||||||
|
|
||||||
renderDate(): JSX.Element[] {
|
renderDate(): JSX.Element[] {
|
||||||
const tmpNextDate = this.nextOpenOrCloseDate as moment.Moment;
|
const tmpNextDate = this.nextOpenOrCloseDate as moment.Moment;
|
||||||
var nextDateString = tmpNextDate.from(this.xDay);
|
var nextDateString = tmpNextDate.from(this.xDay);
|
||||||
return [
|
return [
|
||||||
(
|
(
|
||||||
<div className="openCloseDecription" key="title">
|
<div className="openCloseDecription" key="title">
|
||||||
Next {this.getOpeningClosingString()}
|
Next <span className={this.getOpeningClosingClassName()}>{this.getOpeningClosingString()}</span>
|
||||||
</div>
|
</div>
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
|
|||||||
Reference in New Issue
Block a user