diff --git a/frontend/src/component/common/common.scss b/frontend/src/component/common/common.scss index 276cfc3800..af46ea1e8b 100644 --- a/frontend/src/component/common/common.scss +++ b/frontend/src/component/common/common.scss @@ -8,6 +8,15 @@ width: 100%; } +.horizontalScroll { + overflow-x: scroll; + -webkit-overflow-scrolling: touch; +} + +.horizontalScroll::-webkit-scrollbar { + display: none; +} + .divider { margin: 0; border-color: rgba(0,0,0,.12); @@ -22,3 +31,36 @@ display: none; } } + +.dataTableHeader { + display: flex; + justify-content: space-between; + align-items: center; + height: 64px; + + .title { + padding: 20px 16px 20px 24px; + } + + .titleText { + margin: 0; + font-size: 20px; + line-height: 24px + } + + .actions { + flex-shrink: 0; + padding: 20px 14px 20px 16px; + } +} + +.switchWithLabel { + .label { + padding-right: 16px; + line-height: 24px; + } + .switch { + display: inline-block; + padding-right: 8px; + } +} \ No newline at end of file diff --git a/frontend/src/component/common/index.js b/frontend/src/component/common/index.js index 1b6130fea0..9bf78b5b31 100644 --- a/frontend/src/component/common/index.js +++ b/frontend/src/component/common/index.js @@ -38,6 +38,19 @@ export const HeaderTitle = ({ title, actions, subtitle }) => ( ); +export const DataTableHeader = ({ title, actions }) => ( +
+
+

{title}

+
+ {actions && +
+ {actions} +
+ } +
+); + export const FormButtons = ({ submitText = 'Create', onCancel }) => (
); -export const SwitchWithLabel = ({ onChange, children, checked }) => ( - - - +export const SwitchWithLabel = ({ onChange, checked, children, ...switchProps }) => ( + + {children} + + - {children} ); diff --git a/frontend/src/component/history/history-component.jsx b/frontend/src/component/history/history-component.jsx index a622b11ba3..68ed4a3246 100644 --- a/frontend/src/component/history/history-component.jsx +++ b/frontend/src/component/history/history-component.jsx @@ -1,6 +1,8 @@ import React, { PureComponent } from 'react'; -import { Grid, Cell } from 'react-mdl'; +import { Card } from 'react-mdl'; import HistoryList from './history-list-container'; +import { styles as commonStyles } from '../common'; + class History extends PureComponent { componentDidMount () { @@ -18,11 +20,9 @@ class History extends PureComponent { } return ( - - - - - + + + ); } } diff --git a/frontend/src/component/history/history-list-component.jsx b/frontend/src/component/history/history-list-component.jsx index e259902ef2..39d4d2daef 100644 --- a/frontend/src/component/history/history-list-component.jsx +++ b/frontend/src/component/history/history-list-component.jsx @@ -2,7 +2,7 @@ import React, { Component } from 'react'; import HistoryItemDiff from './history-item-diff'; import HistoryItemJson from './history-item-json'; import { Table, TableHeader } from 'react-mdl'; -import { HeaderTitle, SwitchWithLabel, styles as commonStyles } from '../common'; +import { DataTableHeader, SwitchWithLabel, styles as commonStyles } from '../common'; import { formatFullDateTime } from '../common/util'; import styles from './history.scss'; @@ -44,10 +44,12 @@ class HistoryList extends Component { return (
- Show full events + + Full events + }/> -
+
{entries}
diff --git a/frontend/src/component/history/history-list-toggle-component.jsx b/frontend/src/component/history/history-list-toggle-component.jsx index 46580fd22b..92eb9bc53d 100644 --- a/frontend/src/component/history/history-list-toggle-component.jsx +++ b/frontend/src/component/history/history-list-toggle-component.jsx @@ -1,6 +1,5 @@ import React, { Component, PropTypes } from 'react'; -import ListComponent from './history-list-container'; -import { Link } from 'react-router'; +import HistoryList from './history-list-container'; class HistoryListToggle extends Component { @@ -18,15 +17,11 @@ class HistoryListToggle extends Component { if (!this.props.history || this.props.history.length === 0) { return fetching..; } - const { history, toggleName } = this.props; + const { history } = this.props; return ( - Showing history for toggle: - {toggleName} - - }/> + title="Change log"/> ); } } diff --git a/frontend/src/component/history/history.scss b/frontend/src/component/history/history.scss index 0fb3352f2d..3f2b77c57b 100644 --- a/frontend/src/component/history/history.scss +++ b/frontend/src/component/history/history.scss @@ -1,7 +1,4 @@ -.history { - width:100%; - border-collapse: collapse; - +.history { code { word-wrap: break-word; white-space: pre;