feat(dashboard): Submit forms on Cmd + Enter (#9623)
**What** - Changes all forms to only submit on Cmd/Ctrl + Enter instead of just Enter. - Cleans up the position of submit/cancel buttons in many FocusModals that still had them in the header. - Fixes responsiveness of multiple forms - Removes the SplitView component, and replaces its usages with StackedDrawer/Modal to align the UX across the project. Resolves CC-103, CC-535
This commit is contained in:
+4
-6
@@ -6,10 +6,8 @@ import * as zod from "zod"
|
||||
|
||||
import { UserDTO } from "@medusajs/types"
|
||||
import { Form } from "../../../../../components/common/form"
|
||||
import {
|
||||
RouteDrawer,
|
||||
useRouteModal,
|
||||
} from "../../../../../components/modals"
|
||||
import { RouteDrawer, useRouteModal } from "../../../../../components/modals"
|
||||
import { KeyboundForm } from "../../../../../components/utilities/keybound-form"
|
||||
import { useUpdateUser } from "../../../../../hooks/api/users"
|
||||
|
||||
type EditUserFormProps = {
|
||||
@@ -45,7 +43,7 @@ export const EditUserForm = ({ user }: EditUserFormProps) => {
|
||||
|
||||
return (
|
||||
<RouteDrawer.Form form={form}>
|
||||
<form
|
||||
<KeyboundForm
|
||||
onSubmit={handleSubmit}
|
||||
className="flex flex-1 flex-col overflow-hidden"
|
||||
>
|
||||
@@ -93,7 +91,7 @@ export const EditUserForm = ({ user }: EditUserFormProps) => {
|
||||
</Button>
|
||||
</div>
|
||||
</RouteDrawer.Footer>
|
||||
</form>
|
||||
</KeyboundForm>
|
||||
</RouteDrawer.Form>
|
||||
)
|
||||
}
|
||||
|
||||
+3
-2
@@ -23,6 +23,7 @@ import { ActionMenu } from "../../../../../components/common/action-menu"
|
||||
import { Form } from "../../../../../components/common/form"
|
||||
import { RouteFocusModal } from "../../../../../components/modals/index.ts"
|
||||
import { DataTable } from "../../../../../components/table/data-table"
|
||||
import { KeyboundForm } from "../../../../../components/utilities/keybound-form/keybound-form.tsx"
|
||||
import {
|
||||
useCreateInvite,
|
||||
useDeleteInvite,
|
||||
@@ -101,7 +102,7 @@ export const InviteUserForm = () => {
|
||||
|
||||
return (
|
||||
<RouteFocusModal.Form form={form}>
|
||||
<form
|
||||
<KeyboundForm
|
||||
onSubmit={handleSubmit}
|
||||
className="flex h-full flex-col overflow-hidden"
|
||||
>
|
||||
@@ -174,7 +175,7 @@ export const InviteUserForm = () => {
|
||||
</div>
|
||||
</div>
|
||||
</RouteFocusModal.Body>
|
||||
</form>
|
||||
</KeyboundForm>
|
||||
</RouteFocusModal.Form>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user