Merge branch 'main' into static
This commit is contained in:
commit
abd3d9051e
14
package.json
14
package.json
@ -9,16 +9,16 @@
|
||||
"analyze": "ANALYZE=true next build"
|
||||
},
|
||||
"dependencies": {
|
||||
"@aws-sdk/client-s3": "3.515.0",
|
||||
"@aws-sdk/s3-request-presigner": "3.515.0",
|
||||
"@aws-sdk/client-s3": "3.521.0",
|
||||
"@aws-sdk/s3-request-presigner": "3.521.0",
|
||||
"@next/bundle-analyzer": "14.1.0",
|
||||
"@radix-ui/react-dropdown-menu": "^2.0.6",
|
||||
"@tailwindcss/forms": "^0.5.7",
|
||||
"@testing-library/jest-dom": "^6.4.2",
|
||||
"@testing-library/react": "^14.2.1",
|
||||
"@types/jest": "^29.5.12",
|
||||
"@types/node": "^20.11.19",
|
||||
"@types/react": "18.2.57",
|
||||
"@types/node": "^20.11.20",
|
||||
"@types/react": "18.2.58",
|
||||
"@types/react-dom": "18.2.19",
|
||||
"@typescript-eslint/eslint-plugin": "^7.0.2",
|
||||
"@typescript-eslint/parser": "^7.0.2",
|
||||
@ -31,10 +31,10 @@
|
||||
"clsx": "^2.1.0",
|
||||
"cmdk": "^0.2.1",
|
||||
"date-fns": "^3.3.1",
|
||||
"eslint": "8.56.0",
|
||||
"eslint": "8.57.0",
|
||||
"eslint-config-next": "14.1.0",
|
||||
"exifr": "^7.1.3",
|
||||
"framer-motion": "^11.0.5",
|
||||
"framer-motion": "^11.0.6",
|
||||
"jest": "^29.7.0",
|
||||
"jest-environment-jsdom": "^29.7.0",
|
||||
"nanoid": "^5.0.6",
|
||||
@ -45,7 +45,7 @@
|
||||
"react": "18.2.0",
|
||||
"react-dom": "18.2.0",
|
||||
"react-icons": "^5.0.1",
|
||||
"sonner": "^1.4.0",
|
||||
"sonner": "^1.4.1",
|
||||
"tailwindcss": "3.4.1",
|
||||
"ts-exif-parser": "^0.2.2",
|
||||
"typescript": "5.3.3",
|
||||
|
||||
1488
pnpm-lock.yaml
generated
1488
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@ -56,7 +56,7 @@ export default function AdminNavClient({
|
||||
<BiCog
|
||||
size={18}
|
||||
className="inline-block"
|
||||
aria-label="Blog Configuration"
|
||||
aria-label="App Configuration"
|
||||
/>
|
||||
</Link>
|
||||
</div>
|
||||
|
||||
@ -12,7 +12,7 @@ export default async function AdminConfigurationPage() {
|
||||
<div className="space-y-6">
|
||||
<div className="flex items-center">
|
||||
<div className="flex-grow">
|
||||
Blog Configuration
|
||||
App Configuration
|
||||
</div>
|
||||
<form action={syncCacheAction}>
|
||||
<SubmitButtonWithStatus
|
||||
|
||||
@ -1,7 +1,14 @@
|
||||
'use client';
|
||||
|
||||
import { Command } from 'cmdk';
|
||||
import { ReactNode, useEffect, useMemo, useRef, useState } from 'react';
|
||||
import {
|
||||
ReactNode,
|
||||
useEffect,
|
||||
useMemo,
|
||||
useRef,
|
||||
useState,
|
||||
useTransition,
|
||||
} from 'react';
|
||||
import Modal from './Modal';
|
||||
import { clsx } from 'clsx/lite';
|
||||
import { useDebounce } from 'use-debounce';
|
||||
@ -44,6 +51,16 @@ export default function CommandKClient({
|
||||
} = useAppState();
|
||||
|
||||
const isOpenRef = useRef(isOpen);
|
||||
|
||||
const [isPending, startTransition] = useTransition();
|
||||
const shouldCloseAfterPending = useRef(false);
|
||||
|
||||
useEffect(() => {
|
||||
if (!isPending && shouldCloseAfterPending.current) {
|
||||
setIsOpen?.(false);
|
||||
shouldCloseAfterPending.current = false;
|
||||
}
|
||||
}, [isPending, setIsOpen]);
|
||||
|
||||
// Raw query values
|
||||
const [queryLiveRaw, setQueryLive] = useState('');
|
||||
@ -149,7 +166,7 @@ export default function CommandKClient({
|
||||
onClose={() => setIsOpen?.(false)}
|
||||
fast
|
||||
>
|
||||
<div className="space-y-1.5">
|
||||
<div className={clsx('space-y-1.5', isPending && 'opacity-30')}>
|
||||
<div className="relative">
|
||||
<Command.Input
|
||||
onChangeCapture={(e) => setQueryLive(e.currentTarget.value)}
|
||||
@ -163,6 +180,7 @@ export default function CommandKClient({
|
||||
'placeholder:dark:text-gray-700',
|
||||
)}
|
||||
placeholder="Search photos, views, settings ..."
|
||||
disabled={isPending}
|
||||
/>
|
||||
{isLoading &&
|
||||
<span className={clsx(
|
||||
@ -223,10 +241,14 @@ export default function CommandKClient({
|
||||
'data-[selected=true]:dark:bg-gray-900/75',
|
||||
)}
|
||||
onSelect={() => {
|
||||
setIsOpen?.(false);
|
||||
action?.();
|
||||
if (path) {
|
||||
router.push(path);
|
||||
startTransition(() => {
|
||||
shouldCloseAfterPending.current = true;
|
||||
router.push(path, { scroll: true });
|
||||
});
|
||||
} else {
|
||||
setIsOpen?.(false);
|
||||
action?.();
|
||||
}
|
||||
}}
|
||||
>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user