summaryrefslogtreecommitdiffstats
path: root/front/odiparpack/app/containers/Tables/BasicTable.js
blob: a6f81e1d622a75aed3e1e7e2a13f69a6b2560c67 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
import React, { Component } from 'react';
import { Helmet } from 'react-helmet';
import brand from 'ba-api/brand';
import PropTypes from 'prop-types';
import { withStyles } from '@material-ui/core/styles';
import Markdown from 'react-markdown';
import codeStyle from 'ba-styles/Code.scss';
import { SourceReader, PapperBlock } from 'ba-components';
import { Grid } from '@material-ui/core';
import {
  StrippedTable,
  HoverTable,
  BorderedTable,
  TrackingTable,
  StatusLabel,
  StatusColorRow,
  EmptyTable
} from './demos';

const styles = ({
  root: {
    flexGrow: 1,
  }
});

class BasicTable extends Component {
  render() {
    const { classes } = this.props;
    const title = brand.name + ' - Table';
    const description = brand.desc;
    const docSrc = 'containers/Tables/demos/';
    return (
      <div>
        <Helmet>
          <title>{title}</title>
          <meta name="description" content={description} />
          <meta property="og:title" content={title} />
          <meta property="og:description" content={description} />
          <meta property="twitter:title" content={title} />
          <meta property="twitter:description" content={description} />
        </Helmet>
        <PapperBlock title="Stripped Table" desc="They (allegedly) aid usability in reading tabular data by offering the user a coloured means of separating and differentiating rows from one another">
          <div>
            <Markdown className={codeStyle.codePre} source="Simply by ``` import tableStyles from 'ba-components/Table.scss'; ``` then add the classNames ``` tableStyles.stripped ```" />
            <StrippedTable />
            <SourceReader componentName={docSrc + 'StrippedTable.js'} />
          </div>
        </PapperBlock>
        <div className={classes.root}>
          <Grid container spacing={3}>
            <Grid item md={6} xs={12}>
              <PapperBlock title="Hover Table" desc="Hover tables is addition option that allows you to see what row you selected">
                <div>
                  <Markdown className={codeStyle.codePre} source="Simply by ``` import tableStyles from 'ba-components/Table.scss'; ``` then add the classNames ``` tableStyles.hover ```" />
                  <HoverTable />
                  <SourceReader componentName={docSrc + 'HoverTable.js'} />
                </div>
              </PapperBlock>
            </Grid>
            <Grid item md={6} xs={12}>
              <PapperBlock title="Bordered Table" desc="Old is gold, here is old fashion bordered table, we tweaked it a bit so that the headings looks more prominent.">
                <div>
                  <Markdown className={codeStyle.codePre} source="Simply by ``` import tableStyles from 'ba-components/Table.scss'; ``` then add the classNames ``` tableStyles.bordered ```" />
                  <BorderedTable />
                  <SourceReader componentName={docSrc + 'BorderedTable.js'} />
                </div>
              </PapperBlock>
            </Grid>
          </Grid>
        </div>
        <div className={classes.root}>
          <Grid container spacing={3}>
            <Grid item md={6} xs={12}>
              <PapperBlock title="Status Table with Label" desc="">
                <div>
                  <StatusLabel />
                  <SourceReader componentName={docSrc + 'StatusLabel.js'} />
                </div>
              </PapperBlock>
            </Grid>
            <Grid item md={6} xs={12}>
              <PapperBlock title="Coloured Row" desc="">
                <div>
                  <StatusColorRow />
                  <SourceReader componentName={docSrc + 'StatusColorRow.js'} />
                </div>
              </PapperBlock>
            </Grid>
          </Grid>
        </div>
        <div className={classes.root}>
          <TrackingTable />
          <SourceReader componentName={docSrc + 'TrackingTable.js'} />
        </div>
        <PapperBlock title="Empty Table" desc="">
          <div>
            <EmptyTable />
            <SourceReader componentName={docSrc + 'EmptyTable.js'} />
          </div>
        </PapperBlock>
      </div>
    );
  }
}

BasicTable.propTypes = {
  classes: PropTypes.object.isRequired,
};

export default withStyles(styles)(BasicTable);