From 2c91d4e68da7ad3492e858069b7bfc4df4d9d1d4 Mon Sep 17 00:00:00 2001 From: crbon Date: Wed, 21 Jan 2026 17:25:29 +1000 Subject: [PATCH] feat(link): enhance LinkEditForm with advanced Open Graph fields toggle - Added a toggle for advanced settings in the LinkEditForm to show/hide Open Graph fields (ogTitle, ogDescription, ogImageUrl). - Updated the form to initialize these fields with default values if available. - Introduced a new label for the advanced section in the messages file. This enhancement improves user experience by allowing users to manage Open Graph metadata more efficiently. --- src/app/(main)/links/LinkEditForm.tsx | 79 ++++++++++++++++++++------- src/components/messages.ts | 1 + 2 files changed, 59 insertions(+), 21 deletions(-) diff --git a/src/app/(main)/links/LinkEditForm.tsx b/src/app/(main)/links/LinkEditForm.tsx index b9c16996..2bbf78e2 100644 --- a/src/app/(main)/links/LinkEditForm.tsx +++ b/src/app/(main)/links/LinkEditForm.tsx @@ -13,7 +13,7 @@ import { import { useEffect, useState } from 'react'; import { useConfig, useLinkQuery, useMessages } from '@/components/hooks'; import { useUpdateQuery } from '@/components/hooks/queries/useUpdateQuery'; -import { RefreshCw } from '@/components/icons'; +import { ChevronDown, ChevronRight, RefreshCw } from '@/components/icons'; import { LINKS_URL } from '@/lib/constants'; import { getRandomChars } from '@/lib/generate'; import { isValidUrl } from '@/lib/url'; @@ -43,6 +43,7 @@ export function LinkEditForm({ const hostUrl = linksUrl || LINKS_URL; const { data, isLoading } = useLinkQuery(linkId); const [slug, setSlug] = useState(generateId()); + const [showAdvanced, setShowAdvanced] = useState(false); const handleSubmit = async (data: any) => { await mutateAsync(data, { @@ -81,7 +82,17 @@ export function LinkEditForm({ } return ( -
+ {({ setValue }) => { return ( <> @@ -101,28 +112,16 @@ export function LinkEditForm({ - - - - - - - - - - - - - - - +