Skip to content

Commit

Permalink
suiteName component
Browse files Browse the repository at this point in the history
  • Loading branch information
mantovanig committed Sep 24, 2017
1 parent 6ffa28c commit f609a4b
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 2 deletions.
File renamed without changes.
2 changes: 1 addition & 1 deletion compare/src/components/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default class App extends React.Component {
render () {
return (
<Wrapper>
<Header store={this.props} />
<Header />
</Wrapper>);
}
}
26 changes: 26 additions & 0 deletions compare/src/components/atoms/SuiteName.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import React from 'react';
import { connect } from 'react-redux'
import styled from 'styled-components';


const SuiteNameTitle = styled.h1`
font-size: 30px;
`;

class SuiteName extends React.Component {
render () {
return (
<SuiteNameTitle>{this.props.suiteName} Report</SuiteNameTitle>
);
}
}

const mapStateToProps = state => {
return {
suiteName: state.suiteInfo.testSuiteName
}
};

const SuiteNameContainer = connect(mapStateToProps)(SuiteName);

export default SuiteNameContainer
3 changes: 2 additions & 1 deletion compare/src/components/organisms/Topbar.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react';
import styled from 'styled-components';

import SuiteNameContainer from '../atoms/SuiteName';

const TopbarWrapper = styled.section`
width: 100%;
Expand All @@ -11,7 +12,7 @@ export default class Topbar extends React.Component {
render () {
return (
<TopbarWrapper>
<p>Logo</p>
<SuiteNameContainer />
</TopbarWrapper>
);
}
Expand Down
2 changes: 2 additions & 0 deletions compare/src/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ const store = createStore(
rootReducer,
defaultState,
window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__());

export default store;

0 comments on commit f609a4b

Please sign in to comment.