made the bins page use url context, added bins link to team page

This commit is contained in:
Carter 2025-07-22 15:55:16 -06:00
parent 84ed63a765
commit 6996ab0e77
2 changed files with 30 additions and 3 deletions

View file

@ -12,10 +12,10 @@ import { appendToUrl } from "navigation/Router";
import PageContainer from "pages/PageContainer";
import { getContextKeys, getContextTypes } from "pbHelpers/Context";
import { pond } from "protobuf-ts/pond";
import { useSnackbar, useTeamAPI, useUserAPI } from "providers";
import { useGlobalState, useSnackbar, useTeamAPI, useUserAPI } from "providers";
import { useEffect, useState } from "react";
import { useLocation, useNavigate, useParams } from 'react-router-dom';
import { getSignatureAccentColour } from "services/whiteLabel";
import { getSignatureAccentColour, IsAdaptiveAgriculture, IsStreamline } from "services/whiteLabel";
import TeamActions from "teams/TeamActions";
import TeamKeyManager from "teams/TeamKeyManager";
import ObjectUsers from "user/ObjectUsers";
@ -88,6 +88,7 @@ export default function TeamPage() {
const [loadingUsers, setLoadingUsers] = useState(false)
const [userDialog, setUserDialog] = useState(false)
const teamKey = teamID ? teamID : "";
const [{ user }] = useGlobalState()
const getTeam = () => {
@ -212,6 +213,13 @@ export default function TeamPage() {
const toGroups = () => {
navigate(appendToUrl("groups"))
}
const toBins = () => {
navigate(appendToUrl("bins"))
}
const isAg = IsAdaptiveAgriculture()
const isStreamline = IsStreamline()
return (
<PageContainer spacing={isMobile ? 0 : 2}>
@ -255,6 +263,14 @@ export default function TeamPage() {
<ListItemButton onClick={toGroups}>
Groups
</ListItemButton>
{((isAg || isStreamline) || user.hasFeature("admin")) &&
<>
<Divider />
<ListItemButton onClick={toBins}>
Bins
</ListItemButton>
</>
}
<Divider />
</List>
</Card>