1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-25 00:07:47 +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:
andreas-unleash 2024-05-16 09:59:56 +03:00 committed by GitHub
parent 793cd76e93
commit 28ca626bac
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,4 +1,3 @@
import type React from 'react';
import { formatUnknownError } from 'utils/formatUnknownError';
import useProjectApi from 'hooks/api/actions/useProjectApi/useProjectApi';
import useToast from 'hooks/useToast';
@ -18,7 +17,7 @@ import { Button, Dialog, styled } from '@mui/material';
interface ICreateProjectDialogueProps {
open: boolean;
onClose: (e: React.SyntheticEvent) => void;
onClose: () => void;
}
const StyledDialog = styled(Dialog)(({ theme, maxWidth }) => ({
@ -40,7 +39,7 @@ export const CreateProjectDialogue = ({
open,
onClose,
}: ICreateProjectDialogueProps) => {
const { createProject, loading } = useProjectApi();
const { createProject } = useProjectApi();
const { refetchUser } = useAuthUser();
const { uiConfig } = useUiConfig();
const { setToastData, setToastApiError } = useToast();
@ -118,7 +117,6 @@ export const CreateProjectDialogue = ({
<StyledDialog open={open} onClose={onClose}>
<FormTemplate
disablePadding
loading={loading}
description={documentation}
documentationLink='https://docs.getunleash.io/reference/projects'
documentationLinkLabel='Projects documentation'