Skip to content

Commit

Permalink
fix(types): improve types in table
Browse files Browse the repository at this point in the history
improve table loading examples
  • Loading branch information
pochretien committed Jan 28, 2020
1 parent 329782e commit e26778b
Showing 1 changed file with 28 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,44 +26,36 @@ const fiveDataRows = generateDataWithFacker(10);

// start-print

const TableLoadingExamplesWithDataNull: React.FunctionComponent = () => {
const tableId = 'TableLoadingExamples';
return (
<Section>
<TableLoadingComposed id={tableId} className="table" data={null} renderBody={generateTableRow} isLoading />
</Section>
);
};
const tableId = 'TableLoadingExamples';
const TableLoadingExamplesWithDataNull: React.FunctionComponent = () => (
<Section>
<TableLoadingComposed id={tableId} className="table" data={null} renderBody={generateTableRow} isLoading />
</Section>
);

const TableLoadingExamplesWithData: React.FunctionComponent = () => {
const tableId = 'TableLoadingExamples';
return (
<Section>
<TableLoadingComposed
id={tableId}
className="table"
data={fiveDataRows}
renderBody={generateTableRow}
isLoading
/>
</Section>
);
};
const TableLoadingExamplesWithData: React.FunctionComponent = () => (
<Section>
<TableLoadingComposed
id={tableId}
className="table"
data={fiveDataRows}
renderBody={generateTableRow}
isLoading
/>
</Section>
);

const BigTableLoadingExample: React.FunctionComponent = () => {
const tableId = 'TableLoadingExamples';
return (
<Section>
<TableLoadingComposed
id={tableId}
className="table big-table"
data={fiveDataRows}
renderBody={generateTableRow}
isLoading
/>
</Section>
);
};
const BigTableLoadingExample: React.FunctionComponent = () => (
<Section>
<TableLoadingComposed
id={tableId}
className="table big-table"
data={fiveDataRows}
renderBody={generateTableRow}
isLoading
/>
</Section>
);

const TableLoadingComposed = _.compose(
tableWithBlankSlate({title: 'No data caused the table to be empty'}),
Expand Down

0 comments on commit e26778b

Please sign in to comment.