@@ -11,7 +11,6 @@ import {
1111 Text ,
1212 VStack ,
1313 Progress ,
14- Link ,
1514 type StackProps ,
1615} from "@chakra-ui/react" ;
1716import { type Organization , type Project , type Team } from "@prisma/client" ;
@@ -46,6 +45,7 @@ import { ProjectTechStackIcon } from "./TechStack";
4645import { ChecklistIcon } from "./icons/Checklist" ;
4746import { useColorRawValue } from "./ui/color-mode" ;
4847import { InputGroup } from "./ui/input-group" ;
48+ import { Link } from "./ui/link" ;
4949import { Menu } from "./ui/menu" ;
5050import { Popover } from "./ui/popover" ;
5151import { Tooltip } from "./ui/tooltip" ;
@@ -320,6 +320,8 @@ export const DashboardLayout = ({
320320
321321 const user = session ?. user ;
322322 const currentRoute = findCurrentRoute ( router . pathname ) ;
323+ const userIsPartOfTeam =
324+ publicPage || team ?. members . some ( ( member ) => member . userId === user ?. id ) ;
323325
324326 return (
325327 < HStack
@@ -651,7 +653,24 @@ export const DashboardLayout = ({
651653 </ HStack >
652654 ) }
653655 < CurrentDrawer />
654- { children }
656+ { userIsPartOfTeam ? (
657+ children
658+ ) : (
659+ < Alert . Root
660+ status = "warning"
661+ width = "full"
662+ borderBottom = "1px solid"
663+ borderBottomColor = "yellow.300"
664+ >
665+ < Alert . Indicator />
666+ < Alert . Content >
667+ < Text >
668+ You are not part of any team in this organization, please ask
669+ your administrator to add you to a team.
670+ </ Text >
671+ </ Alert . Content >
672+ </ Alert . Root >
673+ ) }
655674 </ VStack >
656675 </ HStack >
657676 ) ;
0 commit comments