diff --git a/dashboard/src/app/(nav)/help/page.tsx b/dashboard/src/app/(nav)/help/page.tsx index 268208fa..646afb9a 100644 --- a/dashboard/src/app/(nav)/help/page.tsx +++ b/dashboard/src/app/(nav)/help/page.tsx @@ -1,4 +1,5 @@ import Image from "next/image"; +import Link from "next/link"; import Note from "@/components/Note"; import DriverDRS from "@/components/driver/DriverDRS"; @@ -151,6 +152,14 @@ export default function HelpPage() { In this example, the driver has a soft tire which is 12 laps old and he pitted one time.

+ + For a complete history of all tire stints and outings during the session, you can visit the dedicated{" "} + + Tires + {" "} + page in the dashboard. + +
+
+

Tire Outings

+

Real-time history of tire compounds and outing progression.

+
+ +
+ +
+
+ ); +} diff --git a/dashboard/src/components/Sidebar.tsx b/dashboard/src/components/Sidebar.tsx index c1dba34b..1f352528 100644 --- a/dashboard/src/components/Sidebar.tsx +++ b/dashboard/src/components/Sidebar.tsx @@ -23,6 +23,10 @@ const liveTimingItems = [ href: "/dashboard/track-map", name: "Track Map", }, + { + href: "/dashboard/tires", + name: "Tires", + }, { href: "/dashboard/standings", name: "Standings", diff --git a/dashboard/src/components/dashboard/OutingTable.tsx b/dashboard/src/components/dashboard/OutingTable.tsx new file mode 100644 index 00000000..7d7ae387 --- /dev/null +++ b/dashboard/src/components/dashboard/OutingTable.tsx @@ -0,0 +1,90 @@ +"use client"; + +import { AnimatePresence, LayoutGroup, motion } from "motion/react"; +import clsx from "clsx"; + +import { useDataStore } from "@/stores/useDataStore"; +import { useSettingsStore } from "@/stores/useSettingsStore"; +import { sortPos } from "@/lib/sorting"; + +import DriverTag from "@/components/driver/DriverTag"; +import DriverHistoryTires from "@/components/driver/DriverHistoryTires"; + +export default function OutingTable() { + const drivers = useDataStore(({ state }) => state?.DriverList); + const driversTiming = useDataStore(({ state }) => state?.TimingData); + const appDriversTiming = useDataStore(({ state }) => state?.TimingAppData); + + const oledMode = useSettingsStore((state) => state.oledMode); + + return ( +
+
+

Driver

+

Tire History / Outings

+
+ + {(!drivers || !driversTiming) && + new Array(20).fill("").map((_, index) => )} + + +
+ {drivers && driversTiming && ( + + {Object.values(driversTiming.Lines) + .sort(sortPos) + .map((timingDriver, index) => { + const driver = drivers[timingDriver.RacingNumber]; + const appTiming = appDriversTiming?.Lines[timingDriver.RacingNumber]; + + return ( + + +
+ +
+
+ ); + })} +
+ )} +
+
+
+ ); +} + +function SkeletonRow() { + return ( +
+
+
+ {[1, 2, 3].map((i) => ( +
+
+
+
+ ))} +
+
+ ); +} diff --git a/dashboard/src/components/driver/DriverHistoryTires.tsx b/dashboard/src/components/driver/DriverHistoryTires.tsx index 8f4ab3ba..ee52e95d 100644 --- a/dashboard/src/components/driver/DriverHistoryTires.tsx +++ b/dashboard/src/components/driver/DriverHistoryTires.tsx @@ -14,7 +14,7 @@ export default function DriverHistoryTires({ stints }: Props) {
{stints && stints.map((stint, i) => ( -
+
{unknownCompound(stint) && unknown} {!unknownCompound(stint) && stint.Compound && ( )} -

{stint.TotalLaps}L

+

+ {stint.TotalLaps}L{stint.New !== "TRUE" ? "*" : ""} +

))} diff --git a/dashboard/src/components/driver/DriverTire.tsx b/dashboard/src/components/driver/DriverTire.tsx index 90b5e754..836ba121 100644 --- a/dashboard/src/components/driver/DriverTire.tsx +++ b/dashboard/src/components/driver/DriverTire.tsx @@ -35,7 +35,7 @@ export default function DriverTire({ stints }: Props) {

L {currentStint?.TotalLaps ?? 0} - {currentStint?.New ? "" : "*"} + {currentStint?.New === "TRUE" ? "" : "*"}

PIT {stops}

diff --git a/dashboard/src/types/state.type.ts b/dashboard/src/types/state.type.ts index 568e19fd..6e2104d7 100644 --- a/dashboard/src/types/state.type.ts +++ b/dashboard/src/types/state.type.ts @@ -57,7 +57,7 @@ export type TimingAppDataDriver = { export type Stint = { TotalLaps?: number; Compound?: "SOFT" | "MEDIUM" | "HARD" | "INTERMEDIATE" | "WET"; - New?: string; // TRUE | FALSE + New?: "TRUE" | "FALSE"; }; export type WeatherData = { diff --git a/dashboard/tsconfig.json b/dashboard/tsconfig.json index 354b9b90..4224aa4d 100644 --- a/dashboard/tsconfig.json +++ b/dashboard/tsconfig.json @@ -13,7 +13,7 @@ "noEmit": true, "esModuleInterop": true, "module": "esnext", - "moduleResolution": "node", + "moduleResolution": "bundler", "resolveJsonModule": true, "isolatedModules": true, "verbatimModuleSyntax": true,