Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions apps/scouting/frontend/src/scouter/pages/ScoutMatch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ export const ScoutMatch: FC = () => {
createNewScoutingForm(),
);
const [activeTabIndex, setActiveTab] = useState(STARTING_TAB_INDEX);
const [alliance, _setAlliance] = useState<Alliance>("blue");
const originTime = useMemo(() => Date.now(), []);
const CurrentTab = useMemo(
() => TABS[activeTabIndex].Component,
Expand All @@ -193,7 +194,12 @@ export const ScoutMatch: FC = () => {
from-black via-gray-900 to-black border-2 border-green-500
rounded-2xl shadow-[0_0_30px_rgba(34,197,94,0.3)] overflow-hidden h-[90vh] relative"
>
<SideBar setActiveTab={setActiveTab} activeTabIndex={activeTabIndex} />
{alliance === "blue" && (
<SideBar
setActiveTab={setActiveTab}
activeTabIndex={activeTabIndex}
/>
)}
<div className="flex-1 flex flex-col overflow-hidden p-2 relative z-10">
<div
className="flex-1 min-h-0 text-green-100 overflow-hidden pr-2
Expand All @@ -203,11 +209,17 @@ export const ScoutMatch: FC = () => {
<CurrentTab
setForm={setScoutingForm}
currentForm={scoutingForm}
alliance="red"
alliance={alliance}
originTime={originTime}
/>
</div>
</div>
{alliance === "red" && (
<SideBar
setActiveTab={setActiveTab}
activeTabIndex={activeTabIndex}
/>
)}
</div>
</div>
);
Expand Down
21 changes: 13 additions & 8 deletions apps/scouting/frontend/src/scouter/pages/tabs/AutoTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,20 @@ export const AutoTab: FC<TabProps> = ({
const [mapPosition, setMapPosition] = useState<Point>();
const [mapZone, setMapZone] = useState<Alliance>(alliance);

const scoreMap = (
<div className="flex-1 min-w-0 h-full">
<ScoreMap
setPosition={setMapPosition}
currentPoint={mapPosition}
alliance={alliance}
mapZone={mapZone}
/>
</div>
);

return (
<div className="flex flex-row h-full w-full gap-3">
<div className="flex-1 min-w-0 h-full">
<ScoreMap
setPosition={setMapPosition}
currentPoint={mapPosition}
alliance={alliance}
mapZone={mapZone}
/>
</div>
{alliance === "red" && scoreMap}
<div className="flex flex-col items-center gap-0.5 sm:gap-1 shrink-0 w-32 sm:w-36 min-h-0 py-0.5 sm:py-1">
<Stopwatch
addCycleTimeSeconds={(cycle) => {
Expand Down Expand Up @@ -63,6 +67,7 @@ export const AutoTab: FC<TabProps> = ({
Field Side
</button>
</div>
{alliance === "blue" && scoreMap}
</div>
);
};
21 changes: 13 additions & 8 deletions apps/scouting/frontend/src/scouter/pages/tabs/ShiftTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,20 @@ export const ShiftTab: FC<ShiftTabProps> = ({
});
};

const scoreMap = (
<div className="flex-1 min-w-0 h-full">
<ScoreMap
setPosition={setMapPosition}
currentPoint={mapPosition}
alliance={alliance}
mapZone={mapZone}
/>
</div>
);

return (
<div className="flex flex-row h-full w-full gap-3">
<div className="flex-1 min-w-0 h-full">
<ScoreMap
setPosition={setMapPosition}
currentPoint={mapPosition}
alliance={alliance}
mapZone={mapZone}
/>
</div>
{alliance === "red" && scoreMap}
<div className="flex flex-col items-center gap-0.5 sm:gap-1 shrink-0 w-32 sm:w-36 min-h-0 py-0.5 sm:py-1">
<Stopwatch
addCycleTimeSeconds={(cycle) => {
Expand Down Expand Up @@ -77,6 +81,7 @@ export const ShiftTab: FC<ShiftTabProps> = ({
Field Side
</button>
</div>
{alliance === "blue" && scoreMap}
</div>
);
};
Loading