mirror of
https://github.com/makeplane/plane
synced 2025-08-07 19:59:33 +00:00
* chore: pwa dropdown input focus improvement * chore: tab indices helper function updated and code refactor * chore: modal tab index refactoring * fix: PWA filters input autofocus * chore: intake tab index updated and code refactor * chore: code refactor
36 lines
1.0 KiB
TypeScript
36 lines
1.0 KiB
TypeScript
import { useFormContext } from "react-hook-form";
|
|
import { IProject } from "@plane/types";
|
|
// ui
|
|
import { Button } from "@plane/ui";
|
|
// constants
|
|
import { ETabIndices } from "@/constants/tab-indices";
|
|
// helpers
|
|
import { getTabIndex } from "@/helpers/tab-indices.helper";
|
|
|
|
type Props = {
|
|
handleClose: () => void;
|
|
isMobile?: boolean;
|
|
};
|
|
|
|
const ProjectCreateButtons: React.FC<Props> = (props) => {
|
|
const { handleClose, isMobile = false } = props;
|
|
const {
|
|
formState: { isSubmitting },
|
|
} = useFormContext<IProject>();
|
|
|
|
const { getIndex } = getTabIndex(ETabIndices.PROJECT_CREATE, isMobile);
|
|
|
|
return (
|
|
<div className="flex justify-end gap-2 py-4 border-t border-custom-border-100">
|
|
<Button variant="neutral-primary" size="sm" onClick={handleClose} tabIndex={getIndex("cancel")}>
|
|
Cancel
|
|
</Button>
|
|
<Button variant="primary" type="submit" size="sm" loading={isSubmitting} tabIndex={getIndex("submit")}>
|
|
{isSubmitting ? "Creating" : "Create project"}
|
|
</Button>
|
|
</div>
|
|
);
|
|
};
|
|
|
|
export default ProjectCreateButtons;
|