mirror of
https://github.com/bendtherules/is-nifty-open.git
synced 2026-08-18 13:52:20 +00:00
Add link to nextOpenCLose route
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import * as moment from 'moment-timezone';
|
import * as moment from 'moment-timezone';
|
||||||
|
import { Link } from 'react-router-dom';
|
||||||
import "./Component.css";
|
import "./Component.css";
|
||||||
import { HolidayList } from '../../Data';
|
import { HolidayList } from '../../Data';
|
||||||
import { Utils, OpenOrClose } from "../../Utils";
|
import { Utils, OpenOrClose } from "../../Utils";
|
||||||
@@ -43,21 +44,19 @@ export class NextOpenCloseMini extends React.Component<NextOpenCloseMiniProps, {
|
|||||||
return this.openOrClose === OpenOrClose.Open ? "green-text" : "red-text";
|
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 (
|
||||||
(
|
<Link to={`./${tmpNextDate.format("YYYY-MM-DD")}`}>
|
||||||
<div className="openCloseDecription" key="title">
|
<div className="openCloseDecription" key="title">
|
||||||
Next <span className={this.getOpeningClosingClassName()}>{this.getOpeningClosingString()}</span>
|
Next <span className={this.getOpeningClosingClassName()}>{this.getOpeningClosingString()}</span>
|
||||||
</div>
|
</div>
|
||||||
),
|
|
||||||
(
|
|
||||||
<div className="dateDescription" key="subTitle">
|
<div className="dateDescription" key="subTitle">
|
||||||
{nextDateString}
|
{nextDateString}
|
||||||
</div>
|
</div>
|
||||||
)
|
</Link>);
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
renderNotFound(): JSX.Element[] {
|
renderNotFound(): JSX.Element[] {
|
||||||
|
|||||||
Reference in New Issue
Block a user