From 28a2697d58245f64f1481e68fdd41d42b7745af5 Mon Sep 17 00:00:00 2001 From: ConorMaley Date: Thu, 17 Aug 2023 20:33:45 -0400 Subject: [PATCH 1/5] add team name modal --- app/components/App.tsx | 3 ++ app/components/Settings.tsx | 20 ++++++++--- app/components/TeamNameModal.tsx | 56 ++++++++++++++++++++++++++++++ app/components/TeamPicks.tsx | 2 +- app/lib/models/Team.ts | 1 + app/lib/store/actions/index.tsx | 2 ++ app/lib/store/actions/teams.tsx | 18 ++++++++++ app/lib/store/reducers/index.tsx | 8 ++++- app/lib/store/reducers/players.tsx | 2 +- app/lib/store/reducers/teams.tsx | 20 +++++++++-- app/lib/store/store.tsx | 13 +++++-- app/pages/styles.css | 8 ++++- 12 files changed, 139 insertions(+), 14 deletions(-) create mode 100644 app/components/TeamNameModal.tsx diff --git a/app/components/App.tsx b/app/components/App.tsx index f9d047a..3656da9 100644 --- a/app/components/App.tsx +++ b/app/components/App.tsx @@ -8,6 +8,7 @@ import PlayerTableContainer from './PlayerTableContainer'; import RosterModal from './RosterModal'; import ScoringModal from './ScoringModal'; import Settings from './Settings'; +import TeamNameModal from './TeamNameModal'; import TeamPicks from './TeamPicks'; interface IState { @@ -43,6 +44,7 @@ export default class App extends React.Component<{}, IState> { + ); } @@ -60,6 +62,7 @@ export default class App extends React.Component<{}, IState> { + ); } diff --git a/app/components/Settings.tsx b/app/components/Settings.tsx index bb2ca89..80a8c99 100644 --- a/app/components/Settings.tsx +++ b/app/components/Settings.tsx @@ -6,7 +6,7 @@ import { connect } from 'react-redux'; import { IPlayer } from '../lib/models/Player'; import { resetDraft } from '../lib/store/actions/players'; import { setScoreFormat, toggleScoringFormatting } from '../lib/store/actions/scoring'; -import { setNumberOfTeams, setTrackedTeam, toggleRosterFormatting } from '../lib/store/actions/teams'; +import { setNumberOfTeams, setTrackedTeam, toggleRosterFormatting, toggleTeamNameUpdates } from '../lib/store/actions/teams'; import { IStoreState } from '../lib/store/store'; interface IProps { @@ -16,8 +16,10 @@ interface IProps { setNumberOfTeams: (count: number) => void; setScoring: (scoring: IScoring) => void; setTrackedTeam: (team: number) => void; + teamNames: string[]; toggleRosterFormatting: () => void; toggleScoringFormatting: () => void; + toggleTeamNameUpdates: () => void; trackedTeam: number; undraftedPlayers: IPlayer[]; } @@ -40,7 +42,7 @@ class Settings extends React.Component { }; public render() { - const { numberOfTeams } = this.props; + const { numberOfTeams, teamNames } = this.props; const { open } = this.state; // an array with the allowable number of teams: [6, 16] @@ -60,7 +62,7 @@ class Settings extends React.Component { Your team @@ -106,6 +108,14 @@ class Settings extends React.Component { + +