chore: cleanup network selector ui
This commit is contained in:
@@ -10,6 +10,7 @@ import { Button } from "@/components/ui/button";
|
|||||||
import {
|
import {
|
||||||
Dialog,
|
Dialog,
|
||||||
DialogContent,
|
DialogContent,
|
||||||
|
DialogDescription,
|
||||||
DialogFooter,
|
DialogFooter,
|
||||||
DialogHeader,
|
DialogHeader,
|
||||||
DialogTitle,
|
DialogTitle,
|
||||||
@@ -153,7 +154,8 @@ function CreateNetworkDialog({
|
|||||||
<Dialog open={open} onOpenChange={onOpenChange}>
|
<Dialog open={open} onOpenChange={onOpenChange}>
|
||||||
<DialogContent>
|
<DialogContent>
|
||||||
<DialogHeader>
|
<DialogHeader>
|
||||||
<DialogTitle>Create Network</DialogTitle>
|
<DialogTitle>Create a Network</DialogTitle>
|
||||||
|
<DialogDescription>Caution: creating a network will create a new billing account. If your team already has a network, ask them for an invite.</DialogDescription>
|
||||||
</DialogHeader>
|
</DialogHeader>
|
||||||
<form onSubmit={handleSubmit}>
|
<form onSubmit={handleSubmit}>
|
||||||
<div className="py-4">
|
<div className="py-4">
|
||||||
@@ -189,7 +191,7 @@ export default function NetworkSelector() {
|
|||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const [createDialogOpen, setCreateDialogOpen] = useState(false);
|
const [createDialogOpen, setCreateDialogOpen] = useState(false);
|
||||||
|
|
||||||
const { data: networks, isPending, error } = useNetworks();
|
const { data: networks, isPending, error, refetch } = useNetworks();
|
||||||
const { data: invitations } = useMyInvitations();
|
const { data: invitations } = useMyInvitations();
|
||||||
|
|
||||||
if (isPending) {
|
if (isPending) {
|
||||||
@@ -214,10 +216,13 @@ export default function NetworkSelector() {
|
|||||||
<p className="text-muted-foreground">
|
<p className="text-muted-foreground">
|
||||||
You don't have access to any networks yet. Create one or ask your admin for an invite.
|
You don't have access to any networks yet. Create one or ask your admin for an invite.
|
||||||
</p>
|
</p>
|
||||||
<Button onClick={() => setCreateDialogOpen(true)}>
|
<div className="flex flex-row gap-1">
|
||||||
<Plus className="mr-1 size-3.5" />
|
<Button variant="outline" onClick={() => refetch()}>Refresh</Button>
|
||||||
Create Network
|
<Button onClick={() => setCreateDialogOpen(true)}>
|
||||||
</Button>
|
<Plus className="mr-1 size-3.5" />
|
||||||
|
Create Network
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
<CreateNetworkDialog
|
<CreateNetworkDialog
|
||||||
open={createDialogOpen}
|
open={createDialogOpen}
|
||||||
onOpenChange={setCreateDialogOpen}
|
onOpenChange={setCreateDialogOpen}
|
||||||
@@ -281,7 +286,6 @@ export default function NetworkSelector() {
|
|||||||
<Button
|
<Button
|
||||||
variant="outline"
|
variant="outline"
|
||||||
size="sm"
|
size="sm"
|
||||||
className="w-full"
|
|
||||||
onClick={() => setCreateDialogOpen(true)}
|
onClick={() => setCreateDialogOpen(true)}
|
||||||
>
|
>
|
||||||
<Plus className="mr-1 size-3.5" />
|
<Plus className="mr-1 size-3.5" />
|
||||||
|
|||||||
Reference in New Issue
Block a user