Commit 8fd1d8a0 by Torkel Ödegaard

changed from RFC to PureComponent

parent 7ae4076d
import React, { SFC } from 'react'; import React, { PureComponent } from 'react';
import classNames from 'classnames/bind'; import classNames from 'classnames/bind';
import DataSourcesListItem from './DataSourcesListItem'; import DataSourcesListItem from './DataSourcesListItem';
import { DataSource } from 'app/types'; import { DataSource } from 'app/types';
...@@ -9,8 +9,9 @@ export interface Props { ...@@ -9,8 +9,9 @@ export interface Props {
layoutMode: LayoutMode; layoutMode: LayoutMode;
} }
const DataSourcesList: SFC<Props> = props => { export class DataSourcesList extends PureComponent<Props> {
const { dataSources, layoutMode } = props; render() {
const { dataSources, layoutMode } = this.props;
const listStyle = classNames({ const listStyle = classNames({
'card-section': true, 'card-section': true,
...@@ -27,6 +28,7 @@ const DataSourcesList: SFC<Props> = props => { ...@@ -27,6 +28,7 @@ const DataSourcesList: SFC<Props> = props => {
</ol> </ol>
</section> </section>
); );
}; }
}
export default DataSourcesList; export default DataSourcesList;
import React, { SFC } from 'react'; import React, { PureComponent } from 'react';
import { DataSource } from 'app/types'; import { DataSource } from 'app/types';
export interface Props { export interface Props {
dataSource: DataSource; dataSource: DataSource;
} }
const DataSourcesListItem: SFC<Props> = props => { export class DataSourcesListItem extends PureComponent<Props> {
const { dataSource } = props; render() {
const { dataSource } = this.props;
return ( return (
<li className="card-item-wrapper"> <li className="card-item-wrapper">
<a className="card-item" href={`datasources/edit/${dataSource.id}`}> <a className="card-item" href={`datasources/edit/${dataSource.id}`}>
...@@ -29,6 +29,7 @@ const DataSourcesListItem: SFC<Props> = props => { ...@@ -29,6 +29,7 @@ const DataSourcesListItem: SFC<Props> = props => {
</a> </a>
</li> </li>
); );
}; }
}
export default DataSourcesListItem; export default DataSourcesListItem;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment