Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
liangfung committed Jan 20, 2025
1 parent f8cf19c commit 0623242
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions ee/tabby-ui/app/(dashboard)/profile/components/change-name.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import React from 'react'
import { zodResolver } from '@hookform/resolvers/zod'
import { TooltipTrigger } from '@radix-ui/react-tooltip'
import { useForm } from 'react-hook-form'
import { toast } from 'sonner'
import * as z from 'zod'
Expand All @@ -13,7 +14,6 @@ import { Button } from '@/components/ui/button'
import {
Form,
FormControl,
FormDescription,
FormField,
FormItem,
FormLabel,
Expand All @@ -22,6 +22,7 @@ import {
import { IconSpinner } from '@/components/ui/icons'
import { Input } from '@/components/ui/input'
import { Separator } from '@/components/ui/separator'
import { Tooltip, TooltipContent } from '@/components/ui/tooltip'
import { ListSkeleton } from '@/components/skeleton'

const updateNameMutation = graphql(/* GraphQL */ `
Expand Down Expand Up @@ -81,17 +82,19 @@ const ChangeNameForm: React.FC<ChangeNameFormProps> = ({
render={({ field }) => (
<FormItem>
<FormLabel>Name</FormLabel>
{isSsoUser ? (
<FormDescription>
Name cannot be changed for SSO users
</FormDescription>
) : null}
<FormControl>
<Input
className="w-full md:w-[350px]"
{...field}
disabled={fetching || isSsoUser}
/>
<Tooltip>
<TooltipTrigger asChild>
<Input
className="w-full md:w-[350px]"
{...field}
disabled={fetching || isSsoUser}
/>
</TooltipTrigger>
<TooltipContent hidden={!isSsoUser} align="end" side="top">
Name cannot be changed for SSO users
</TooltipContent>
</Tooltip>
</FormControl>
<FormMessage />
</FormItem>
Expand Down

0 comments on commit 0623242

Please sign in to comment.