bug: in the error state bar panel is added

This commit is contained in:
Palash gupta 2022-02-10 22:20:31 +05:30
parent 9bf37b391e
commit dc737f385a
No known key found for this signature in database
GPG Key ID: 8FD05AE6F9150AD6
2 changed files with 18 additions and 2 deletions

View File

@ -23,7 +23,7 @@ import { Widgets } from 'types/api/dashboard/getAll';
import Bar from './Bar';
import FullView from './FullView';
import { Modal, FullViewContainer } from './styles';
import { Modal, FullViewContainer, ErrorContainer } from './styles';
const GridCardGraph = ({
widget,
@ -131,7 +131,17 @@ const GridCardGraph = ({
}, [deleteWidget, widget, onToggleModal, isDeleted]);
if (state.error) {
return <div>{state.errorMessage}</div>;
return (
<>
<Bar
onViewFullScreenHandler={(): void => onToggleModal(setModal)}
widget={widget}
onDeleteHandler={(): void => onToggleModal(setDeletModal)}
/>
<ErrorContainer>{state.errorMessage}</ErrorContainer>
</>
);
}
if (state.loading === true || state.payload === undefined) {

View File

@ -15,3 +15,9 @@ export const Modal = styled(ModalComponent)<Props>`
export const FullViewContainer = styled.div`
height: 70vh;
`;
export const ErrorContainer = styled.div`
margin-top: 2rem;
padding-left: 2rem;
padding-right: 2rem;
`;