feature(database-connection): Add routing for dynamic seasons
This commit is contained in:
28
frontend/src/components/SeasonSwitch/SeasonSwitch.tsx
Normal file
28
frontend/src/components/SeasonSwitch/SeasonSwitch.tsx
Normal file
@@ -0,0 +1,28 @@
|
||||
import React from 'react';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||
import './SeasonSwitch.scss';
|
||||
import SeasonDetail, { SeasonDetailProperties } from '../SeasonDetail/SeasonDetail';
|
||||
import {withRouter} from "react-router";
|
||||
|
||||
class SeasonSwitch extends React.Component<SeasonDetailProperties> {
|
||||
|
||||
render() {
|
||||
let seasonId = Number(this.props.seasonId)
|
||||
return(
|
||||
<div className="SeasonSwitch" data-testid="SeasonSwitch">
|
||||
<Link to={"/season/" + (seasonId - 1)}>
|
||||
<FontAwesomeIcon icon="arrow-circle-left" />
|
||||
</Link>
|
||||
|
||||
<SeasonDetail {...this.props} />
|
||||
|
||||
<Link to={"/season/" + (seasonId + 1)}>
|
||||
<FontAwesomeIcon icon="arrow-circle-right" />
|
||||
</Link>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
export default SeasonSwitch;
|
||||
Reference in New Issue
Block a user