-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from marcoaraujojunior/master
Add tests
- Loading branch information
Showing
29 changed files
with
1,318 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,5 @@ | |
node_modules/** | ||
public/dist/** | ||
public/css/** | ||
jest/** | ||
coverage/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
language: node_js | ||
node_js: | ||
- "6.7" | ||
|
||
before_script: | ||
- npm install | ||
|
||
script: | ||
- npm run coverage | ||
- codecov | ||
|
||
after_success: | ||
- bash <(curl -s https://codecov.io/bash) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# IClient - React | ||
|
||
[![Build Status](https://travis-ci.org/marcoaraujojunior/iClient-react.svg?branch=master)](https://travis-ci.org/marcoaraujojunior/iClient-react) [![codecov](https://codecov.io/gh/marcoaraujojunior/iClient-react/branch/master/graph/badge.svg)](https://codecov.io/gh/marcoaraujojunior/iClient-react) | ||
|
||
Simple client to IClient Server made in React JS | ||
|
||
|
||
# To Try | ||
|
||
docker-compose up -d | ||
|
||
docker-compose exec iClientReact bash | ||
|
||
cd client/ | ||
|
||
npm run dev | ||
|
||
License | ||
---- | ||
|
||
MIT | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,6 @@ const Error = ({error}) => ( | |
{error} | ||
</div> : null | ||
); | ||
|
||
export default Error; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import React from 'react'; | ||
import { Link } from 'react-router' | ||
|
||
class LinksApp extends React.Component | ||
{ | ||
constructor(props, context) { | ||
super(props, context); | ||
this.generate = this.generate.bind(this); | ||
this.handleClick = this.handleClick.bind(this); | ||
this.state = { | ||
links: this.props.links | ||
}; | ||
} | ||
|
||
handleClick(e) { | ||
if (this.context.onClick) { | ||
this.context.onClick(); | ||
} | ||
} | ||
|
||
generate() { | ||
return this.state.links.map((link, index) => { | ||
return ( | ||
<Link to={link[0]} | ||
key={index} | ||
className="nav-item is-tab" | ||
onlyActiveOnIndex={true} | ||
activeClassName="is-active" | ||
onClick={this.handleClick} | ||
> | ||
{link[1]} | ||
</Link> | ||
); | ||
}); | ||
} | ||
|
||
render() { | ||
return ( | ||
<span className="nav-right nav-menu is-active"> | ||
{this.generate()} | ||
</span> | ||
); | ||
} | ||
} | ||
|
||
LinksApp.propTypes = { | ||
links: React.PropTypes.array.isRequired | ||
}; | ||
|
||
LinksApp.contextTypes = { | ||
onClick: React.PropTypes.func | ||
}; | ||
|
||
export default LinksApp; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.