Skip to content

Commit

Permalink
cleanup loading state issues
Browse files Browse the repository at this point in the history
  • Loading branch information
stephmilovic committed Feb 27, 2020
1 parent 71e13d4 commit cf73141
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export const MarkdownEditor = React.memo<{
),
},
],
[content, placeholder]
[content, isDisabled, placeholder]
);
return (
<Container>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ const MyWrapper = styled(WrapperPage)`
padding-bottom: 0;
`;

const MyEuiFlexGroup = styled(EuiFlexGroup)`
height: 100%;
`;

const BackgroundWrapper = styled.div`
${({ theme }) => css`
background-color: ${theme.eui.euiColorEmptyShade};
Expand Down Expand Up @@ -239,11 +243,11 @@ export const CaseView = React.memo(({ caseId }: Props) => {
}
if (isLoading) {
return (
<EuiFlexGroup justifyContent="center" alignItems="center">
<MyEuiFlexGroup justifyContent="center" alignItems="center">
<EuiFlexItem grow={false}>
<EuiLoadingSpinner size="xl" />
</EuiFlexItem>
</EuiFlexGroup>
</MyEuiFlexGroup>
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ const MySpinner = styled(EuiLoadingSpinner)`
position: absolute;
top: 50%;
left: 50%;
z-index: 99;
`;

export const Create = React.memo(() => {
Expand Down Expand Up @@ -76,8 +77,8 @@ export const Create = React.memo(() => {
'data-test-subj': 'caseTitle',
euiFieldProps: {
fullWidth: false,
disabled: isLoading,
},
isDisabled: isLoading,
}}
/>
<Container>
Expand All @@ -89,8 +90,8 @@ export const Create = React.memo(() => {
euiFieldProps: {
fullWidth: true,
placeholder: '',
isDisabled: isLoading,
},
isDisabled: isLoading,
}}
/>
</Container>
Expand All @@ -100,8 +101,8 @@ export const Create = React.memo(() => {
component={MarkdownEditorForm}
componentProps={{
idAria: 'caseDescription',
isDisabled: isLoading,
dataTestSubj: 'caseDescription',
isDisabled: isLoading,
}}
/>
</ContainerBig>
Expand Down

0 comments on commit cf73141

Please sign in to comment.