From f69e995204c16e22df7d62cf9d14cfb8cb3f9aa4 Mon Sep 17 00:00:00 2001 From: nael Date: Thu, 30 Nov 2023 17:29:54 +0100 Subject: [PATCH] :adhesive_bandage: Simple fix fixed team switch --- .../api-keys/components/choose-project.tsx | 188 ------------------ .../webapp/src/components/api-keys/index.tsx | 2 - .../src/components/shared/team-switcher.tsx | 113 ++++++----- 3 files changed, 61 insertions(+), 242 deletions(-) delete mode 100644 packages/webapp/src/components/api-keys/components/choose-project.tsx diff --git a/packages/webapp/src/components/api-keys/components/choose-project.tsx b/packages/webapp/src/components/api-keys/components/choose-project.tsx deleted file mode 100644 index b396b7f12..000000000 --- a/packages/webapp/src/components/api-keys/components/choose-project.tsx +++ /dev/null @@ -1,188 +0,0 @@ -"use client" - -import * as React from "react" -import { - CaretSortIcon, - CheckIcon, -} from "@radix-ui/react-icons" - -import { cn } from "@/lib/utils" -import { - Avatar, - AvatarFallback, - AvatarImage, -} from "@/components/ui/avatar" -import { Button } from "@/components/ui/button" -import { - Command, - CommandEmpty, - CommandGroup, - CommandInput, - CommandItem, - CommandList, - CommandSeparator, -} from "@/components/ui/command" -import { - Dialog, - DialogContent, - DialogDescription, - DialogFooter, - DialogHeader, - DialogTitle, -} from "@/components/ui/dialog" -import { Input } from "@/components/ui/input" -import { Label } from "@/components/ui/label" -import { - Popover, - PopoverContent, - PopoverTrigger, -} from "@/components/ui/popover" -import { - Select, - SelectContent, - SelectItem, - SelectTrigger, - SelectValue, -} from "@/components/ui/select" - -const groups = [ - { - label: "Projects", - teams: [ - { - label: "Project 1", - value: "project1", - }, - { - label: "Project 2", - value: "project2", - }, - ], - }, -] - -type Team = (typeof groups)[number]["teams"][number] - -type PopoverTriggerProps = React.ComponentPropsWithoutRef - -interface TeamSwitcherProps extends PopoverTriggerProps {} - -export default function ChooseProjectSwitcher({ className }: TeamSwitcherProps) { - const [open, setOpen] = React.useState(false) - const [showNewTeamDialog, setShowNewTeamDialog] = React.useState(false) - const [selectedTeam, setSelectedTeam] = React.useState( - groups[0].teams[0] - ) - - return ( - - - - - - - - - - No project found. - {groups.map((group) => ( - - {group.teams.map((team) => ( - { - setSelectedTeam(team) - setOpen(false) - }} - className="text-sm" - > - - - SC - - {team.label} - - - ))} - - ))} - - - - - - - - - Create team - - Add a new team to manage products and customers. - - -
-
-
- - -
-
- - -
-
-
- - - - -
-
- ) -} \ No newline at end of file diff --git a/packages/webapp/src/components/api-keys/index.tsx b/packages/webapp/src/components/api-keys/index.tsx index 5297416b6..4f49f929f 100644 --- a/packages/webapp/src/components/api-keys/index.tsx +++ b/packages/webapp/src/components/api-keys/index.tsx @@ -1,6 +1,5 @@ import { PlusCircledIcon } from "@radix-ui/react-icons"; import { Button } from "../ui/button"; -import ChooseProjectSwitcher from "./components/choose-project"; import { useEffect, useState } from "react"; import { API_KEYS } from "./data/api-keys"; import { columns } from "./data/columns"; @@ -41,7 +40,6 @@ export default function ApiKeysPage() {
- + + + : + <> + + Create project + + Add a new project to manage your integrations. + + +
+
+
+ + +
+
-
- - - - - + + + + + + } )