Skip to content
This repository has been archived by the owner on Oct 17, 2020. It is now read-only.

Commit

Permalink
Add knobs for headers and number of rows
Browse files Browse the repository at this point in the history
  • Loading branch information
Coteh committed Aug 22, 2020
1 parent f63432f commit dced409
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
1 change: 0 additions & 1 deletion frontend/src/component/ui/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import React, { Component, ReactChild } from 'react';

import styles from './Table.module.scss';
import { TextAlignProperty } from 'csstype';
import { Styling, withCSSModule } from './styling';

interface IProps {
headers?: ReactChild[];
Expand Down
13 changes: 6 additions & 7 deletions story/src/2-Table.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
import React from 'react';
import { Table } from '../../frontend/src/component/ui/Table';
import { action } from '@storybook/addon-actions';
import { text } from '@storybook/addon-knobs';
import { array, number } from '@storybook/addon-knobs';

export default {
title: 'UI/Table',
component: Table
};

export const table = () => {
const headers = array('Header Columns', ['Long Link', 'Alias']);
return (
<Table
headers={['Long Link', 'Alias']}
rows={[
['http://www.google.com', 'google'],
['http://www.facebook.com', 'facebook']
]}
headers={headers}
rows={new Array(number('Number of rows', 2))
.fill(0)
.map((_, i) => headers.map((_, j) => `data ${i}-${j}`))}
/>
);
};

0 comments on commit dced409

Please sign in to comment.