From 6f1eb8ab8ee0642c46de40684cb77ba1206f2b69 Mon Sep 17 00:00:00 2001 From: Anto Subash Date: Thu, 31 Oct 2024 22:20:29 +0100 Subject: [PATCH] feat: openid client v6 with more other improvements --- src/src/components/settings/Features.tsx | 10 +-- src/src/components/settings/TestEmail.tsx | 21 +++--- src/src/components/ui/toggle-group.tsx | 80 +++++++++++------------ 3 files changed, 50 insertions(+), 61 deletions(-) diff --git a/src/src/components/settings/Features.tsx b/src/src/components/settings/Features.tsx index ed1bd045..cc1c680f 100644 --- a/src/src/components/settings/Features.tsx +++ b/src/src/components/settings/Features.tsx @@ -1,10 +1,6 @@ -import { useFeatures } from '@/lib/hooks/useFeatures' -import { PermissionProvider } from '@/lib/utils' -import { useEffect, useState } from 'react' -import { useForm } from 'react-hook-form' -import { Button } from '../ui/button' -import { Dialog, DialogContent, DialogFooter, DialogTitle } from '../ui/dialog' -import { useToast } from '../ui/use-toast' +import {useEffect, useState} from 'react' +import {Button} from '../ui/button' +import {Dialog, DialogContent, DialogFooter, DialogTitle} from '../ui/dialog' type FeaturesProps = { onDismiss: () => void diff --git a/src/src/components/settings/TestEmail.tsx b/src/src/components/settings/TestEmail.tsx index fde7ff3c..0e9df68d 100644 --- a/src/src/components/settings/TestEmail.tsx +++ b/src/src/components/settings/TestEmail.tsx @@ -1,14 +1,13 @@ -import { SendTestEmailInput, emailSettingsSendTestEmail } from '@/client' -import { QueryNames } from '@/lib/hooks/QueryConstants' -import { useGrantedPolicies } from '@/lib/hooks/useGrantedPolicies' -import { useQueryClient } from '@tanstack/react-query' -import { useEffect, useState } from 'react' -import { useForm } from 'react-hook-form' -import { Button } from '../ui/button' -import { Dialog, DialogContent, DialogFooter, DialogHeader, DialogTitle } from '../ui/dialog' -import { Input } from '../ui/input' -import { Textarea } from '../ui/textarea' -import { useToast } from '../ui/use-toast' +import {emailSettingsSendTestEmail, SendTestEmailInput} from '@/client' +import {QueryNames} from '@/lib/hooks/QueryConstants' +import {useQueryClient} from '@tanstack/react-query' +import {useEffect, useState} from 'react' +import {useForm} from 'react-hook-form' +import {Button} from '../ui/button' +import {Dialog, DialogContent, DialogFooter, DialogHeader, DialogTitle} from '../ui/dialog' +import {Input} from '../ui/input' +import {Textarea} from '../ui/textarea' +import {useToast} from '../ui/use-toast' export type TestEmailProps = { onDismiss: () => void diff --git a/src/src/components/ui/toggle-group.tsx b/src/src/components/ui/toggle-group.tsx index bf01da30..a714aa37 100644 --- a/src/src/components/ui/toggle-group.tsx +++ b/src/src/components/ui/toggle-group.tsx @@ -1,61 +1,55 @@ -"use client" +'use client' -import * as React from "react" -import * as ToggleGroupPrimitive from "@radix-ui/react-toggle-group" -import {type VariantProps} from "class-variance-authority" +import * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group' +import { VariantProps } from 'class-variance-authority' +import * as React from 'react' -import {cn} from "@/lib/utils" -import {toggleVariants} from "@/components/ui/toggle" +import { toggleVariants } from '@/components/ui/toggle' +import { cn } from '@/lib/utils' -const ToggleGroupContext = React.createContext< - VariantProps ->({ - size: "default", - variant: "default", +const ToggleGroupContext = React.createContext>({ + size: 'default', + variant: 'default', }) const ToggleGroup = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef & + React.ElementRef, + React.ComponentPropsWithoutRef & VariantProps >(({ className, variant, size, children, ...props }, ref) => ( - - - {children} - - + + {children} + )) ToggleGroup.displayName = ToggleGroupPrimitive.Root.displayName const ToggleGroupItem = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef & + React.ElementRef, + React.ComponentPropsWithoutRef & VariantProps >(({ className, children, variant, size, ...props }, ref) => { - const context = React.useContext(ToggleGroupContext) - - return ( - - {children} - - ) + const context = React.useContext(ToggleGroupContext) + + return ( + + {children} + + ) }) ToggleGroupItem.displayName = ToggleGroupPrimitive.Item.displayName