Skip to content

Commit

Permalink
fixed build errors
Browse files Browse the repository at this point in the history
  • Loading branch information
kyle-flynn committed Apr 17, 2024
1 parent 6ba262c commit 74f89a6
Show file tree
Hide file tree
Showing 23 changed files with 39 additions and 48 deletions.
2 changes: 1 addition & 1 deletion front-end/src/apps/Settings/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { useRecoilState, useRecoilValue } from 'recoil';
import {
currentEventKeyAtom,
currentTournamentKeyAtom
} from 'src/stores/NewRecoil';
} from 'src/stores/recoil';
import { Tournament } from '@toa-lib/models';
import FrcFmsSettingsTab from './tabs/frc-fms';
// import FrcFmsSettingsTab from './tabs/frc-fms';
Expand Down
2 changes: 1 addition & 1 deletion front-end/src/apps/Settings/tabs/audience.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { FC } from 'react';
import Box from '@mui/material/Box';
import { useRecoilState } from 'recoil';
import { displayChromaKeyAtom } from 'src/stores/NewRecoil';
import { displayChromaKeyAtom } from 'src/stores/recoil';
import { TextSetting } from '../components/text-setting';
import { updateSocketClient } from 'src/api/use-socket-data';

Expand Down
2 changes: 1 addition & 1 deletion front-end/src/apps/reports/reports-app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { TournamentReports } from './tournament-reports';
import {
currentEventKeyAtom,
currentTournamentKeyAtom
} from 'src/stores/NewRecoil';
} from 'src/stores/recoil';
import { useTournamentsForEvent } from 'src/api/use-tournament-data';
import TournamentDropdown from 'src/components/dropdowns/tournament-dropdown';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { useSetRecoilState } from 'recoil';
import { login } from 'src/api/use-login-data';
import { useSocket } from 'src/api/use-socket';
import useLocalStorage from 'src/stores/LocalStorage';
import { userAtom } from 'src/stores/NewRecoil';
import { userAtom } from 'src/stores/recoil';

interface Props {
open: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { FC } from 'react';
import { useSetRecoilState } from 'recoil';
import { logout } from 'src/api/use-login-data';
import useLocalStorage from 'src/stores/LocalStorage';
import { userAtom } from 'src/stores/NewRecoil';
import { userAtom } from 'src/stores/recoil';

const LogoutButton: FC = () => {
const setUser = useSetRecoilState(userAtom);
Expand Down
2 changes: 1 addition & 1 deletion front-end/src/hooks/use-season-components.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { getSeasonKeyFromEventKey } from '@toa-lib/models';
import { useRecoilValue } from 'recoil';
import { useComponents } from 'src/seasons';
import { currentEventKeyAtom } from 'src/stores/NewRecoil';
import { currentEventKeyAtom } from 'src/stores/recoil';

export const useSeasonComponents = () => {
const seasonKey = getSeasonKeyFromEventKey(
Expand Down
2 changes: 1 addition & 1 deletion front-end/src/layouts/DefaultLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import IconButton from '@mui/material/IconButton';
import Toolbar from '@mui/material/Toolbar';
import Typography from '@mui/material/Typography';
import LoginButton from 'src/components/buttons/LoginButton/LoginButton';
import { userAtom } from '@stores/NewRecoil';
import { userAtom } from '@stores/recoil';
import emsAvatar from '@assets/favicon.ico';
import LogoutButton from 'src/components/buttons/LogoutButton/LogoutButton';
import NotificationsIcon from '@mui/icons-material/Notifications';
Expand Down
2 changes: 1 addition & 1 deletion front-end/src/layouts/PaperLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import Paper from '@mui/material/Paper';
import Toolbar from '@mui/material/Toolbar';
import Typography from '@mui/material/Typography';
import LoginButton from 'src/components/buttons/LoginButton/LoginButton';
import { userAtom } from '@stores/NewRecoil';
import { userAtom } from '@stores/recoil';
import emsAvatar from '@assets/favicon.ico';
import LogoutButton from 'src/components/buttons/LogoutButton/LogoutButton';

Expand Down
2 changes: 1 addition & 1 deletion front-end/src/layouts/RefereeLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import IconButton from '@mui/material/IconButton';
import Toolbar from '@mui/material/Toolbar';
import Typography from '@mui/material/Typography';
import LoginButton from 'src/components/buttons/LoginButton/LoginButton';
import { userAtom } from '@stores/NewRecoil';
import { userAtom } from '@stores/recoil';
import emsAvatar from '@assets/favicon.ico';
import LogoutButton from 'src/components/buttons/LogoutButton/LogoutButton';

Expand Down
4 changes: 2 additions & 2 deletions front-end/src/seasons/ChargedUp/referee/AutoScoreSheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
} from '@toa-lib/models';
import StateToggle from 'src/components/inputs/StateToggle';
import { SetterOrUpdater, useRecoilState } from 'recoil';
import { matchInProgressAtom } from '@stores/NewRecoil';
import { matchOccurringAtom } from '@stores/recoil';
import NumberInput from 'src/components/inputs/NumberInput';

interface Props {
Expand All @@ -22,7 +22,7 @@ const AutoScoreSheet: FC<Props> = ({ alliance, participants, onUpdate }) => {
const [match, setMatch]: [
Match<ChargedUpDetails> | null,
SetterOrUpdater<Match<ChargedUpDetails> | null>
] = useRecoilState(matchInProgressAtom);
] = useRecoilState(matchOccurringAtom);

if (!match || !match.details) return null;

Expand Down
4 changes: 2 additions & 2 deletions front-end/src/seasons/ChargedUp/referee/PenaltySheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ import Typography from '@mui/material/Typography';
import NumberInput from 'src/components/inputs/NumberInput';
import { Alliance, ChargedUpDetails, Match } from '@toa-lib/models';
import { useRecoilState } from 'recoil';
import { matchInProgressAtom } from '@stores/NewRecoil';
import { matchOccurringAtom } from '@stores/recoil';

interface Props {
alliance: Alliance;
onUpdate?: (match: Match<ChargedUpDetails>) => void;
}

const PenaltySheet: FC<Props> = ({ alliance, onUpdate }) => {
const [match, setMatch] = useRecoilState(matchInProgressAtom);
const [match, setMatch] = useRecoilState(matchOccurringAtom);

const handleFoulChange = (minPen: number) => {
if (match) {
Expand Down
4 changes: 2 additions & 2 deletions front-end/src/seasons/ChargedUp/referee/ScoreSheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
import ConnectionChip from 'src/components/util/ConnectionChip/ConnectionChip';
import MatchChip from 'src/components/util/MatchChip/MatchChip';
import { useRecoilValue } from 'recoil';
import { matchInProgressAtom } from '@stores/NewRecoil';
import { matchOccurringAtom } from '@stores/recoil';
import TeamSheet from './TeamSheet';
import PenaltySheet from './PenaltySheet';
import TabPanel from 'src/components/util/TabPanel/TabPanel';
Expand All @@ -27,7 +27,7 @@ interface Props {

const ScoreSheet: FC<Props> = ({ alliance }) => {
const [socket] = useSocket();
const match = useRecoilValue(matchInProgressAtom);
const match = useRecoilValue(matchOccurringAtom);

const [tabIndex, setTabIndex] = useState(0);

Expand Down
7 changes: 2 additions & 5 deletions front-end/src/seasons/ChargedUp/referee/TeamSheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@ import { useRecoilState, useRecoilValue } from 'recoil';
import Box from '@mui/material/Box';
import ToggleButton from '@mui/material/ToggleButton';
import Typography from '@mui/material/Typography';
import {
matchInProgressAtom,
matchInProgressParticipantsByStationSelectorFam
} from '@stores/NewRecoil';
import { matchOccurringAtom } from '@stores/recoil';
import { useSocket } from 'src/api/use-socket';
import { MatchSocketEvent } from '@toa-lib/models';

Expand All @@ -16,7 +13,7 @@ interface Props {

const TeamSheet: FC<Props> = ({ station }) => {
const [socket] = useSocket();
const match = useRecoilValue(matchInProgressAtom);
const match = useRecoilValue(matchOccurringAtom);
const [participant, setParticipant] = useRecoilState(
matchInProgressParticipantsByStationSelectorFam(station)
);
Expand Down
4 changes: 2 additions & 2 deletions front-end/src/seasons/ChargedUp/referee/TeleOpScoreSheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
} from '@toa-lib/models';
import StateToggle from 'src/components/inputs/StateToggle';
import { SetterOrUpdater, useRecoilState } from 'recoil';
import { matchInProgressAtom } from '@stores/NewRecoil';
import { matchOccurringAtom } from '@stores/recoil';
import NumberInput from 'src/components/inputs/NumberInput';

interface Props {
Expand All @@ -22,7 +22,7 @@ const TeleScoreSheet: FC<Props> = ({ alliance, participants, onUpdate }) => {
const [match, setMatch]: [
Match<ChargedUpDetails> | null,
SetterOrUpdater<Match<ChargedUpDetails> | null>
] = useRecoilState(matchInProgressAtom);
] = useRecoilState(matchOccurringAtom);

if (!match || !match.details) return null;

Expand Down
4 changes: 2 additions & 2 deletions front-end/src/seasons/Crescendo/referee/AutoScoreSheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Typography from '@mui/material/Typography';
import { Alliance, Crescendo, Match, MatchParticipant } from '@toa-lib/models';
import StateToggle from 'src/components/inputs/StateToggle';
import { SetterOrUpdater, useRecoilState } from 'recoil';
import { matchInProgressAtom } from '@stores/NewRecoil';
import { matchOccurringAtom } from '@stores/recoil';
import NumberInput from 'src/components/inputs/NumberInput';

interface Props {
Expand All @@ -17,7 +17,7 @@ const AutoScoreSheet: FC<Props> = ({ alliance, participants, onUpdate }) => {
const [match, setMatch]: [
Match<Crescendo.MatchDetails> | null,
SetterOrUpdater<Match<Crescendo.MatchDetails> | null>
] = useRecoilState(matchInProgressAtom);
] = useRecoilState(matchOccurringAtom);

if (!match || !match.details) return null;

Expand Down
4 changes: 2 additions & 2 deletions front-end/src/seasons/Crescendo/referee/PenaltySheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ import Typography from '@mui/material/Typography';
import NumberInput from 'src/components/inputs/NumberInput';
import { Alliance, Crescendo, Match } from '@toa-lib/models';
import { useRecoilState } from 'recoil';
import { matchInProgressAtom } from '@stores/NewRecoil';
import { matchOccurringAtom } from '@stores/recoil';

interface Props {
alliance: Alliance;
onUpdate?: (match: Match<Crescendo.MatchDetails>) => void;
}

const PenaltySheet: FC<Props> = ({ alliance, onUpdate }) => {
const [match, setMatch] = useRecoilState(matchInProgressAtom);
const [match, setMatch] = useRecoilState(matchOccurringAtom);

const handleFoulChange = (minPen: number) => {
if (minPen < 0) minPen = 0;
Expand Down
4 changes: 2 additions & 2 deletions front-end/src/seasons/Crescendo/referee/ScoreSheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { Alliance, Crescendo, Match, MatchSocketEvent } from '@toa-lib/models';
import ConnectionChip from 'src/components/util/ConnectionChip/ConnectionChip';
import MatchChip from 'src/components/util/MatchChip/MatchChip';
import { useRecoilValue } from 'recoil';
import { matchInProgressAtom } from '@stores/NewRecoil';
import { matchOccurringAtom } from '@stores/recoil';
import TeamSheet from './TeamSheet';
import PenaltySheet from './PenaltySheet';
import TabPanel from 'src/components/util/TabPanel/TabPanel';
Expand All @@ -22,7 +22,7 @@ interface Props {

const ScoreSheet: FC<Props> = ({ alliance }) => {
const [socket] = useSocket();
const match = useRecoilValue(matchInProgressAtom);
const match = useRecoilValue(matchOccurringAtom);

const [tabIndex, setTabIndex] = useState(0);

Expand Down
7 changes: 2 additions & 5 deletions front-end/src/seasons/Crescendo/referee/TeamSheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@ import { useRecoilState, useRecoilValue } from 'recoil';
import Box from '@mui/material/Box';
import ToggleButton from '@mui/material/ToggleButton';
import Typography from '@mui/material/Typography';
import {
matchInProgressAtom,
matchInProgressParticipantsByStationSelectorFam
} from '@stores/NewRecoil';
import { matchOccurringAtom } from '@stores/recoil';
import { useSocket } from 'src/api/use-socket';
import { MatchSocketEvent } from '@toa-lib/models';

Expand All @@ -16,7 +13,7 @@ interface Props {

const TeamSheet: FC<Props> = ({ station }) => {
const [socket] = useSocket();
const match = useRecoilValue(matchInProgressAtom);
const match = useRecoilValue(matchOccurringAtom);
const [participant, setParticipant] = useRecoilState(
matchInProgressParticipantsByStationSelectorFam(station)
);
Expand Down
6 changes: 3 additions & 3 deletions front-end/src/seasons/Crescendo/referee/TeleOpScoreSheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ import {
} from 'recoil';
import {
blueBonusActiveAtom,
matchInProgressAtom,
matchOccurringAtom,
matchStateAtom,
redBonusActiveAtom
} from '@stores/NewRecoil';
} from '@stores/recoil';
import NumberInput from 'src/components/inputs/NumberInput';
import { useSocket } from 'src/api/use-socket';

Expand All @@ -36,7 +36,7 @@ const TeleScoreSheet: FC<Props> = ({ alliance, participants, onUpdate }) => {
const [match, setMatch]: [
Match<Crescendo.MatchDetails> | null,
SetterOrUpdater<Match<Crescendo.MatchDetails> | null>
] = useRecoilState(matchInProgressAtom);
] = useRecoilState(matchOccurringAtom);
const matchState = useRecoilValue(matchStateAtom);

const [socket, connected] = useSocket();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Typography from '@mui/material/Typography';
import NumberInput from 'src/components/inputs/NumberInput';
import { Alliance, HydrogenHorizons, Match } from '@toa-lib/models';
import { useRecoilValue } from 'recoil';
import { matchInProgressAtom } from '@stores/NewRecoil';
import { matchOccurringAtom } from '@stores/recoil';

interface Props {
alliance: Alliance;
Expand All @@ -15,7 +15,7 @@ interface Props {
}

const PenaltySheet: FC<Props> = ({ alliance, onMatchItemUpdate }) => {
const match = useRecoilValue(matchInProgressAtom);
const match = useRecoilValue(matchOccurringAtom);

const handleFoulChange = (minPen: number) => {
onMatchItemUpdate(alliance === 'red' ? 'redMinPen' : 'blueMinPen', minPen);
Expand Down
4 changes: 2 additions & 2 deletions front-end/src/seasons/HydrogenHorizons/referee/ScoreSheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { FC, SyntheticEvent, useState } from 'react';
import { RefereeScoreSheetProps } from '@seasons/index';
import { useSocket } from 'src/api/use-socket';
import { SetterOrUpdater, useRecoilState } from 'recoil';
import { matchInProgressAtom } from '@stores/NewRecoil';
import { matchOccurringAtom } from '@stores/recoil';
import {
HydrogenHorizons,
Match,
Expand All @@ -27,7 +27,7 @@ const ScoreSheet: FC<RefereeScoreSheetProps> = ({ alliance }) => {
const [match, setMatch]: [
Match<HydrogenHorizons.MatchDetails> | null,
SetterOrUpdater<Match<HydrogenHorizons.MatchDetails> | null>
] = useRecoilState(matchInProgressAtom);
] = useRecoilState(matchOccurringAtom);

const [tabIndex, setTabIndex] = useState(0);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { useRecoilState } from 'recoil';
import Box from '@mui/material/Box';
import ToggleButton from '@mui/material/ToggleButton';
import Typography from '@mui/material/Typography';
import { matchInProgressParticipantsByStationSelectorFam } from '@stores/NewRecoil';
import { CardStatusUpdate, MatchSocketEvent } from '@toa-lib/models';
import { useSocket } from 'src/api/use-socket';
import { useTeamIdentifiers } from 'src/hooks/use-team-identifier';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,14 @@ import {
} from '@toa-lib/models';
import StateToggle from 'src/components/inputs/StateToggle';
import { useRecoilValue } from 'recoil';
import {
currentTeamsByEventSelector,
matchInProgressAtom
} from '@stores/NewRecoil';
import NumberInput from 'src/components/inputs/NumberInput';
import {
AlignmentStatus,
Proficiency
} from '@toa-lib/models/build/seasons/HydrogenHorizons';
import { useTeamIdentifiers } from 'src/hooks/use-team-identifier';
import { matchOccurringAtom } from 'src/stores/recoil';
import { useTeamsForEvent } from 'src/api/use-team-data';

interface Props {
alliance: Alliance;
Expand All @@ -40,8 +38,8 @@ const TeleScoreSheet: FC<Props> = ({
onMatchDetailsUpdate
}) => {
const match: Match<HydrogenHorizons.MatchDetails> | null =
useRecoilValue(matchInProgressAtom);
const teams = useRecoilValue(currentTeamsByEventSelector);
useRecoilValue(matchOccurringAtom);
const { data: teams } = useTeamsForEvent(match?.eventKey ?? '');
const identifiers = useTeamIdentifiers();

if (!match || !match.details) return null;
Expand Down Expand Up @@ -193,7 +191,7 @@ const TeleScoreSheet: FC<Props> = ({
/>
</Grid>
{participants?.map((p) => {
const team = teams.find((t) => t.teamKey === p.teamKey);
const team = teams?.find((t) => t.teamKey === p.teamKey);
const update = (value: Proficiency) => {
updateProficiency(p.station, value);
};
Expand Down

0 comments on commit 74f89a6

Please sign in to comment.