mirror of
https://github.com/Unleash/unleash.git
synced 2025-02-04 00:18:01 +01:00
fix: loading is causing a glitch that changes the size of the dialog for a split second (#7062)
The loading state of the FormTemplate is causing the form glitch. This fixes it by removing the loading Closes # [1-2362](https://linear.app/unleash/issue/1-2362/fix-visual-glitch-when-you-submit-the-form) https://github.com/Unleash/unleash/assets/104830839/1782ca09-a8b4-4fd1-92c1-111843869b25 Signed-off-by: andreas-unleash <andreas@getunleash.ai>
This commit is contained in:
parent
793cd76e93
commit
28ca626bac
@ -1,4 +1,3 @@
|
|||||||
import type React from 'react';
|
|
||||||
import { formatUnknownError } from 'utils/formatUnknownError';
|
import { formatUnknownError } from 'utils/formatUnknownError';
|
||||||
import useProjectApi from 'hooks/api/actions/useProjectApi/useProjectApi';
|
import useProjectApi from 'hooks/api/actions/useProjectApi/useProjectApi';
|
||||||
import useToast from 'hooks/useToast';
|
import useToast from 'hooks/useToast';
|
||||||
@ -18,7 +17,7 @@ import { Button, Dialog, styled } from '@mui/material';
|
|||||||
|
|
||||||
interface ICreateProjectDialogueProps {
|
interface ICreateProjectDialogueProps {
|
||||||
open: boolean;
|
open: boolean;
|
||||||
onClose: (e: React.SyntheticEvent) => void;
|
onClose: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
const StyledDialog = styled(Dialog)(({ theme, maxWidth }) => ({
|
const StyledDialog = styled(Dialog)(({ theme, maxWidth }) => ({
|
||||||
@ -40,7 +39,7 @@ export const CreateProjectDialogue = ({
|
|||||||
open,
|
open,
|
||||||
onClose,
|
onClose,
|
||||||
}: ICreateProjectDialogueProps) => {
|
}: ICreateProjectDialogueProps) => {
|
||||||
const { createProject, loading } = useProjectApi();
|
const { createProject } = useProjectApi();
|
||||||
const { refetchUser } = useAuthUser();
|
const { refetchUser } = useAuthUser();
|
||||||
const { uiConfig } = useUiConfig();
|
const { uiConfig } = useUiConfig();
|
||||||
const { setToastData, setToastApiError } = useToast();
|
const { setToastData, setToastApiError } = useToast();
|
||||||
@ -118,7 +117,6 @@ export const CreateProjectDialogue = ({
|
|||||||
<StyledDialog open={open} onClose={onClose}>
|
<StyledDialog open={open} onClose={onClose}>
|
||||||
<FormTemplate
|
<FormTemplate
|
||||||
disablePadding
|
disablePadding
|
||||||
loading={loading}
|
|
||||||
description={documentation}
|
description={documentation}
|
||||||
documentationLink='https://docs.getunleash.io/reference/projects'
|
documentationLink='https://docs.getunleash.io/reference/projects'
|
||||||
documentationLinkLabel='Projects documentation'
|
documentationLinkLabel='Projects documentation'
|
||||||
|
Loading…
Reference in New Issue
Block a user