Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
liangfung committed Feb 26, 2025
1 parent d453315 commit ab2214b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
12 changes: 8 additions & 4 deletions ee/tabby-ui/app/pages/components/new-page-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ export function NewPageForm({
const form = useForm<z.infer<typeof formSchema>>({
resolver: zodResolver(formSchema)
})
const { isSubmitting } = form.formState
const title = form.watch('title')

const handleSubmit = async (values: z.infer<typeof formSchema>) => {
const error = await onSubmit(values.title)
const error = await onSubmit(values.title.trim())

if (error) {
makeFormErrorHandler(form)(error)
Expand All @@ -48,7 +48,7 @@ export function NewPageForm({
<FormControl>
<Input
autoFocus
className="h-auto w-full border-none text-3xl font-bold shadow-none outline-none focus-visible:ring-0"
className="h-auto w-full border-none text-3xl font-semibold shadow-none outline-none focus-visible:ring-0"
placeholder="What is your page about?"
{...field}
/>
Expand All @@ -57,7 +57,11 @@ export function NewPageForm({
</FormItem>
)}
/>
<Button className="h-auto w-auto">
<Button
className="h-auto w-auto px-2"
type="submit"
disabled={!title}
>
<IconArrowRight />
</Button>
</div>
Expand Down
2 changes: 1 addition & 1 deletion ee/tabby-ui/app/pages/components/page-main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ export function Page() {
<ScrollArea className="h-full w-full" ref={contentContainerRef}>
<div className="mx-auto grid grid-cols-4 gap-2 px-4 pb-32 lg:max-w-5xl lg:px-0">
{isNew && !page ? (
<div className="col-span-4 mt-8 rounded-lg border py-2 pl-1 pr-3">
<div className="col-span-4 mt-8 rounded-lg border py-2 pl-1 pr-3 ring-2 ring-transparent focus-within:ring-ring focus-visible:ring-ring">
<NewPageForm
onSubmit={async title => {
const now = new Date().toISOString()
Expand Down

0 comments on commit ab2214b

Please sign in to comment.