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"
|
||||
>
|
||||
<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">
|
||||
<label
|
||||
htmlFor="title"
|
||||
|
|
@ -194,14 +204,11 @@ export default function VideoMoreMenu({ video }: Props) {
|
|||
|
||||
<button
|
||||
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"
|
||||
>
|
||||
Save
|
||||
</button>
|
||||
</form>
|
||||
</Dialog.Panel>
|
||||
</Transition.Child>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in a new issue