Skip to content

Commit

Permalink
feat: Message when no staged or pending present
Browse files Browse the repository at this point in the history
  • Loading branch information
SPageot committed Dec 30, 2021
1 parent 622c446 commit 0bac62b
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/components/blocks/StagingDataTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useSelector } from 'react-redux';
import styled, { withTheme } from 'styled-components';
import { TableCellHeaderText, TableCellText } from '../typography';
import { convertPascalCaseToSentenceCase } from '../../utils/stringUtils';
import { MinusIcon } from '..';
import { MinusIcon, H3 } from '..';
import { TableDrawer } from './';
import { useWindowSize } from '../hooks/useWindowSize';

Expand Down Expand Up @@ -76,6 +76,13 @@ const StagingDataTableContainer = styled('div')`
height: 100%;
`;

const NoDataMessageContainer = styled('div')`
display: flex;
height: 100%;
justify-content: center;
align-items: center;
`;

const ChangeGroupHeader = ({ headings, appStore }) => {
return (
<THead selectedTheme={appStore.theme}>
Expand Down Expand Up @@ -195,6 +202,11 @@ const StagingDataTable = withTheme(({ headings, data, deleteStagingData }) => {
return (
<StagingDataTableContainer ref={ref}>
<div style={{ height: `${height}px`, overflow: 'auto' }}>
{data.length === 0 && (
<NoDataMessageContainer>
<H3>No staged data at this time</H3>
</NoDataMessageContainer>
)}
{data &&
headings &&
data.map((changeGroup, index) => (
Expand Down

0 comments on commit 0bac62b

Please sign in to comment.