Add component common/Layout
Change-Id: Ifa35e9556d129db390df04fe935ca5f6cad5438d
This commit is contained in:
parent
f116bfe1f7
commit
b6f6f7fb71
20
src/features/common/Layout.js
Normal file
20
src/features/common/Layout.js
Normal file
@ -0,0 +1,20 @@
|
||||
import React, { Component } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { SidePanel } from './';
|
||||
|
||||
export default class Layout extends Component {
|
||||
static propTypes = {
|
||||
children: PropTypes.node,
|
||||
};
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div className="common-layout">
|
||||
<SidePanel />
|
||||
<div className="common-page-container">
|
||||
{this.props.children}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
5
src/features/common/Layout.scss
Normal file
5
src/features/common/Layout.scss
Normal file
@ -0,0 +1,5 @@
|
||||
@import '../../styles/mixins';
|
||||
|
||||
.common-layout {
|
||||
padding-left: 260px;
|
||||
}
|
@ -1,2 +1,3 @@
|
||||
export { default as PageNotFound } from './PageNotFound';
|
||||
export { default as SidePanel } from './SidePanel';
|
||||
export { default as Layout } from './Layout';
|
||||
|
@ -1,2 +1,3 @@
|
||||
@import '../../styles/mixins';
|
||||
@import './SidePanel';
|
||||
@import './Layout';
|
||||
|
8
tests/features/common/Layout.test.js
Normal file
8
tests/features/common/Layout.test.js
Normal file
@ -0,0 +1,8 @@
|
||||
import React from 'react';
|
||||
import { shallow } from 'enzyme';
|
||||
import { Layout } from '../../../src/features/common';
|
||||
|
||||
it('renders node with correct class name', () => {
|
||||
const renderedComponent = shallow(<Layout />);
|
||||
expect(renderedComponent.find('.common-layout').length).toBe(1);
|
||||
});
|
Loading…
Reference in New Issue
Block a user