diff --git a/frontend/src/components/SeasonSwitch/SeasonSwitch.tsx b/frontend/src/components/SeasonSwitch/SeasonSwitch.tsx index 50bce95..35d43b2 100644 --- a/frontend/src/components/SeasonSwitch/SeasonSwitch.tsx +++ b/frontend/src/components/SeasonSwitch/SeasonSwitch.tsx @@ -1,35 +1,33 @@ import React from 'react'; -import { Link } from 'react-router-dom'; -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; +import {Link} from 'react-router-dom'; +import {FontAwesomeIcon} from '@fortawesome/react-fontawesome'; import './SeasonSwitch.scss'; import SeasonDetail from '../SeasonDetail/SeasonDetail'; import {IUserListProperties} from "../UserList/UserList"; -class SeasonSwitch extends React.Component { +const SeasonSwitch: React.FC = (props: IUserListProperties) => { + const seasonId = Number(props.userStats.seasonId) + const maxSeasonId = Number(props.userStats.maxSeasonId) - render() { - let seasonId = Number(this.props.userStats.seasonId) - let maxSeasonId = Number(this.props.userStats.maxSeasonId) - return( + return (
{ seasonId > 1 - && this.props.onSeasonIdChange('' + (seasonId - 1))}> - - + && props.onSeasonIdChange('' + (seasonId - 1))}> + + } - + { seasonId !== maxSeasonId - && this.props.onSeasonIdChange('' + (seasonId + 1))}> - - + && props.onSeasonIdChange('' + (seasonId + 1))}> + + }
) - } } export default SeasonSwitch;