Skip to content

Commit

Permalink
asdfsadf
Browse files Browse the repository at this point in the history
  • Loading branch information
ThatXliner committed Feb 26, 2024
1 parent 9ff3a11 commit 2d96514
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 7 deletions.
31 changes: 28 additions & 3 deletions apps/WarriorHappy/src/app/match/[matchId].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,16 @@ export default function Match() {
});
}}
/>
<Dangerous />
<Dangerous
ultimateHistory={godlyHistory.auto}
setUltimateHistory={(stuff) => {
console.log("stuff", stuff);
rawUpdate.mutate({
...key,
event_log: { ...godlyHistory, auto: stuff },
});
}}
/>
</Tabs.Content>

<Tabs.Content value="tab2" height={"100%"} paddingBottom="15%">
Expand All @@ -129,7 +138,15 @@ export default function Match() {
});
}}
/>
<Dangerous />
<Dangerous
ultimateHistory={godlyHistory.teleop}
setUltimateHistory={(stuff) => {
rawUpdate.mutate({
...key,
event_log: { ...godlyHistory, teleop: stuff },
});
}}
/>
</Tabs.Content>
<Tabs.Content value="tab3" height={"100%"} paddingBottom="15%">
<Endgame
Expand All @@ -141,7 +158,15 @@ export default function Match() {
});
}}
/>
<Dangerous />
<Dangerous
ultimateHistory={godlyHistory.endgame}
setUltimateHistory={(stuff) => {
rawUpdate.mutate({
...key,
event_log: { ...godlyHistory, endgame: stuff },
});
}}
/>
</Tabs.Content>
</Tabs>
)}
Expand Down
23 changes: 20 additions & 3 deletions apps/WarriorHappy/src/app/match/components/Dangerous.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
import { View } from "react-native";

import { UltimateHistory } from "../types";
import ActionButton from "./ActionButton";

export default function Dangerous() {
export default function Dangerous({
setUltimateHistory,
ultimateHistory,
}: {
setUltimateHistory: (history: UltimateHistory) => void;
ultimateHistory: UltimateHistory;
}) {
return (
<View
style={{
Expand All @@ -16,12 +23,22 @@ export default function Dangerous() {
className="space-x-2"
>
<ActionButton
action={() => console.log("DC")}
action={() => {
setUltimateHistory({
...ultimateHistory,
log: [...ultimateHistory.log, "DISCONNECTED"],
} as UltimateHistory);
}}
label="Disconnected"
theme={"red"}
/>
<ActionButton
action={() => console.log("Tippy lol")}
action={() => {
setUltimateHistory({
...ultimateHistory,
log: [...ultimateHistory.log, "TIPP"],
} as UltimateHistory);
}}
label="Tipped Over"
theme={"red"}
/>
Expand Down
3 changes: 2 additions & 1 deletion packages/api/src/router/scouting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ export const scoutingRouter = createTRPCRouter({
// biome-ignore lint/style/noNonNullAssertion: The match should be guaranteed to map to a singular event
eventKey: x.matches!.event,
// biome-ignore lint/style/noNonNullAssertion: see above
eventName: x.matches!.events[0].name,

eventName: x.matches!.events?.name, // @ts-ignore
// biome-ignore lint/style/noNonNullAssertion: see above
team: parseInt(x.team.match(/\d+/)![0]),
red: redTeams,
Expand Down

0 comments on commit 2d96514

Please sign in to comment.