diff --git a/src/webapp/app/(authenticated)/cards/add/page.tsx b/src/webapp/app/(authenticated)/cards/add/page.tsx index 9fc22193..fb77ef41 100644 --- a/src/webapp/app/(authenticated)/cards/add/page.tsx +++ b/src/webapp/app/(authenticated)/cards/add/page.tsx @@ -4,13 +4,7 @@ import { useMemo } from 'react'; import { useRouter, useSearchParams } from 'next/navigation'; import { getAccessToken } from '@/services/auth'; import { ApiClient } from '@/api-client/ApiClient'; -import { - Box, - Stack, - Text, - Title, - Card, -} from '@mantine/core'; +import { Box, Stack, Text, Title, Card } from '@mantine/core'; import { UrlCardForm } from '@/components/UrlCardForm'; import { useAuth } from '@/hooks/useAuth'; @@ -18,16 +12,17 @@ export default function AddCardPage() { const router = useRouter(); const searchParams = useSearchParams(); const { user } = useAuth(); - + const preSelectedCollectionId = searchParams.get('collectionId'); // Create API client instance - memoized to avoid recreating on every render const apiClient = useMemo( - () => new ApiClient( - process.env.NEXT_PUBLIC_API_BASE_URL || 'http://localhost:3000', - () => getAccessToken(), - ), - [] + () => + new ApiClient( + process.env.NEXT_PUBLIC_API_BASE_URL || 'http://localhost:3000', + () => getAccessToken(), + ), + [], ); const handleSuccess = () => { @@ -43,9 +38,7 @@ export default function AddCardPage() { Add Card - - Add a URL to your library with an optional note. - + Add a URL to your library with an optional note. diff --git a/src/webapp/app/(authenticated)/collections/[collectionId]/edit/page.tsx b/src/webapp/app/(authenticated)/collections/[collectionId]/edit/page.tsx index 41f4890d..d395a0fe 100644 --- a/src/webapp/app/(authenticated)/collections/[collectionId]/edit/page.tsx +++ b/src/webapp/app/(authenticated)/collections/[collectionId]/edit/page.tsx @@ -126,7 +126,10 @@ export default function EditCollectionPage() { {error && } {success && ( - + )} Edit Collection - + @@ -146,7 +152,11 @@ export default function CollectionPage() { ) : ( No cards in this collection yet - diff --git a/src/webapp/app/(authenticated)/layout.tsx b/src/webapp/app/(authenticated)/layout.tsx index 8a843651..e46c35f0 100644 --- a/src/webapp/app/(authenticated)/layout.tsx +++ b/src/webapp/app/(authenticated)/layout.tsx @@ -4,7 +4,14 @@ import { useEffect } from 'react'; import { usePathname, useRouter } from 'next/navigation'; import { useAuth } from '@/hooks/useAuth'; import { useDisclosure, useMediaQuery } from '@mantine/hooks'; -import { ActionIcon, AppShell, Group, NavLink, Text, Affix } from '@mantine/core'; +import { + ActionIcon, + AppShell, + Group, + NavLink, + Text, + Affix, +} from '@mantine/core'; import { FiSidebar } from 'react-icons/fi'; import { IoDocumentTextOutline } from 'react-icons/io5'; import { BsFolder2 } from 'react-icons/bs'; diff --git a/src/webapp/components/AddToCollectionModal.tsx b/src/webapp/components/AddToCollectionModal.tsx index 410b16a2..9f1a1a4c 100644 --- a/src/webapp/components/AddToCollectionModal.tsx +++ b/src/webapp/components/AddToCollectionModal.tsx @@ -3,13 +3,7 @@ import { useState, useEffect, useMemo } from 'react'; import { getAccessToken } from '@/services/auth'; import { ApiClient } from '@/api-client/ApiClient'; -import { - Button, - Group, - Modal, - Stack, - Text, -} from '@mantine/core'; +import { Button, Group, Modal, Stack, Text } from '@mantine/core'; import { CollectionSelector } from './CollectionSelector'; interface Collection { @@ -33,7 +27,9 @@ export function AddToCollectionModal({ onClose, onSuccess, }: AddToCollectionModalProps) { - const [selectedCollectionIds, setSelectedCollectionIds] = useState([]); + const [selectedCollectionIds, setSelectedCollectionIds] = useState( + [], + ); const [submitting, setSubmitting] = useState(false); const [error, setError] = useState(''); const [card, setCard] = useState(null); @@ -141,7 +137,11 @@ export function AddToCollectionModal({ placeholder="Search collections to add..." /> - {error && {error}} + {error && ( + + {error} + + )}