improve renaming user experience
This commit is contained in:
parent
bf202b958c
commit
e819ce242e
1 changed files with 34 additions and 27 deletions
|
|
@ -172,6 +172,16 @@ export default function VideoMoreMenu({ video }: Props) {
|
||||||
leaveTo="opacity-0 scale-95"
|
leaveTo="opacity-0 scale-95"
|
||||||
>
|
>
|
||||||
<Dialog.Panel className="w-full max-w-md transform overflow-hidden rounded-2xl bg-white p-6 text-left align-middle shadow-xl transition-all">
|
<Dialog.Panel className="w-full max-w-md transform overflow-hidden rounded-2xl bg-white p-6 text-left align-middle shadow-xl transition-all">
|
||||||
|
<form
|
||||||
|
onSubmit={(e) => {
|
||||||
|
e.preventDefault();
|
||||||
|
renameVideoMutation.mutate({
|
||||||
|
videoId: video.id,
|
||||||
|
title,
|
||||||
|
});
|
||||||
|
setRenameMenuOpen(false);
|
||||||
|
}}
|
||||||
|
>
|
||||||
<div className="sm:col-span-4">
|
<div className="sm:col-span-4">
|
||||||
<label
|
<label
|
||||||
htmlFor="title"
|
htmlFor="title"
|
||||||
|
|
@ -194,14 +204,11 @@ export default function VideoMoreMenu({ video }: Props) {
|
||||||
|
|
||||||
<button
|
<button
|
||||||
type="submit"
|
type="submit"
|
||||||
onClick={() => {
|
|
||||||
renameVideoMutation.mutate({ videoId: video.id, title });
|
|
||||||
setRenameMenuOpen(false);
|
|
||||||
}}
|
|
||||||
className="mt-2 rounded-md bg-indigo-600 px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-indigo-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600"
|
className="mt-2 rounded-md bg-indigo-600 px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-indigo-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600"
|
||||||
>
|
>
|
||||||
Save
|
Save
|
||||||
</button>
|
</button>
|
||||||
|
</form>
|
||||||
</Dialog.Panel>
|
</Dialog.Panel>
|
||||||
</Transition.Child>
|
</Transition.Child>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue