This repository has been archived by the owner on Jun 4, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
366 additions
and
349 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 |
---|---|---|
@@ -1,27 +1,27 @@ | ||
import 'jquery' | ||
import 'semantic-ui-css/semantic.css' | ||
import './index.scss' | ||
import 'jquery'; | ||
import 'semantic-ui-css/semantic.css'; | ||
|
||
import { ApolloClient } from 'apollo-client'; | ||
import { ApolloProvider } from 'react-apollo'; | ||
import App from './src/App'; | ||
import { HttpLink } from 'apollo-link-http'; | ||
import { InMemoryCache } from 'apollo-cache-inmemory'; | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import gql from 'graphql-tag' | ||
import App from './src/App'; | ||
|
||
import './index.scss'; | ||
|
||
const API_SERVER_URL = process.env.API_SERVER_URL || 'http://127.0.0.1:5000/'; | ||
|
||
const client = new ApolloClient({ | ||
link: new HttpLink({ uri: API_SERVER_URL + 'graphql' }), | ||
cache: new InMemoryCache() | ||
link: new HttpLink({ uri: `${API_SERVER_URL}graphql` }), | ||
cache: new InMemoryCache(), | ||
}); | ||
|
||
|
||
ReactDOM.render( | ||
<ApolloProvider client={client}> | ||
<App /> | ||
</ApolloProvider>, | ||
document.getElementById('app') | ||
<ApolloProvider client={client}> | ||
<App /> | ||
</ApolloProvider>, | ||
document.getElementById('app'), | ||
); |
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 |
---|---|---|
@@ -1,14 +1,14 @@ | ||
const webpack = require('webpack') | ||
const webpack = require('webpack'); | ||
|
||
module.exports = { | ||
env: { | ||
API_SERVER_URL: 'http://127.0.0.1:5000/' | ||
}, | ||
webpack(config) { | ||
config.plugins.push(new webpack.ProvidePlugin({ | ||
$: "jquery", | ||
jQuery: "jquery" | ||
})); | ||
return config; | ||
} | ||
env: { | ||
API_SERVER_URL: 'http://127.0.0.1:5000/', | ||
}, | ||
webpack(config) { | ||
config.plugins.push(new webpack.ProvidePlugin({ | ||
$: 'jquery', | ||
jQuery: 'jquery', | ||
})); | ||
return config; | ||
}, | ||
}; |
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 |
---|---|---|
@@ -1,77 +1,82 @@ | ||
import { EditRating, Rating } from './Rating.js' | ||
import React, { Component } from 'react'; | ||
import { graphql, withApollo } from 'react-apollo'; | ||
|
||
import { EditPersonContainer } from './EditPerson.js' | ||
import { PersonSkillsTableContainer } from './PersonSkillsTable.js' | ||
import gql from 'graphql-tag' | ||
import { Rating } from './Rating'; | ||
import { EditPersonContainer } from './EditPerson'; | ||
import { PersonSkillsTableContainer } from './PersonSkillsTable'; | ||
|
||
class App extends Component { | ||
constructor(props) { | ||
super(props); | ||
this.state = { person: null }; | ||
} | ||
selectPerson(person) { | ||
this.setState({ person: person === this.state.person ? null : person }); | ||
} | ||
render() { | ||
const { person } = this.state; | ||
return ( | ||
<div> | ||
<a id="github-icon" href="https://github.com/olin-build/skillz/" | ||
target="_blank"> | ||
<i className="huge github icon" /> | ||
</a> | ||
<div className="ui container"> | ||
<h1 className="ui dividing header">People Skillz Finder</h1> | ||
<div className="ui message"> | ||
<Instructions /> | ||
<Legend /> | ||
</div> | ||
<PersonSkillsTableContainer className="column" | ||
editablePerson={person} | ||
onRowClick={person => this.selectPerson(person)} | ||
/> | ||
{person && <EditPersonContainer person={person} />} | ||
</div> | ||
</div> | ||
); | ||
} | ||
constructor(props) { | ||
super(props); | ||
this.state = { person: null }; | ||
} | ||
selectPerson(person) { | ||
this.setState({ person: person === this.state.person ? null : person }); | ||
} | ||
render() { | ||
const { person } = this.state; | ||
return ( | ||
<div> | ||
<a | ||
id="github-icon" | ||
href="https://github.com/olin-build/skillz/" | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
<i className="huge github icon" /> | ||
</a> | ||
<div className="ui container"> | ||
<h1 className="ui dividing header">People Skillz Finder</h1> | ||
<div className="ui message"> | ||
<Instructions /> | ||
<Legend /> | ||
</div> | ||
<PersonSkillsTableContainer | ||
className="column" | ||
editablePerson={person} | ||
onRowClick={p => this.selectPerson(p)} | ||
/> | ||
{person && <EditPersonContainer person={person} />} | ||
</div> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
const Instructions = () => | ||
<div> | ||
<p> | ||
Use this tool to find people who know or want to learn X. </p> | ||
<p> | ||
Click on your row to edit your skills and interests. (Please only edit yourself or with permission!) | ||
</p> | ||
</div> | ||
const Instructions = () => ( | ||
<div> | ||
<p> | ||
Use this tool to find people who know or want to learn X. | ||
</p> | ||
<p> | ||
Click on your row to edit your skills and interests. | ||
(Please only edit yourself or with permission!) | ||
</p> | ||
</div>); | ||
|
||
|
||
const Legend = () => | ||
<table> | ||
<tbody> | ||
<tr> | ||
<td><Rating rating={1} className="inline" /></td> | ||
<td>minimal experience</td> | ||
<td><Rating rating={1} className="inline" icon="student" /></td> | ||
<td>minimal interest</td> | ||
</tr> | ||
<tr> | ||
<td><Rating rating={5} className="inline" /></td> | ||
<td>very experienced</td> | ||
<td><Rating rating={5} className="inline" icon="student" /></td> | ||
<td>really wants to learn</td> | ||
</tr> | ||
<tr> | ||
<td><Rating rating={0} className="inline" /></td> | ||
<td>doesn't know</td> | ||
<td><Rating rating={0} className="inline" /></td> | ||
<td>not interested</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
const Legend = () => ( | ||
<table> | ||
<tbody> | ||
<tr> | ||
<td><Rating rating={1} className="inline" /></td> | ||
<td>minimal experience</td> | ||
<td><Rating rating={1} className="inline" icon="student" /></td> | ||
<td>minimal interest</td> | ||
</tr> | ||
<tr> | ||
<td><Rating rating={5} className="inline" /></td> | ||
<td>very experienced</td> | ||
<td><Rating rating={5} className="inline" icon="student" /></td> | ||
<td>really wants to learn</td> | ||
</tr> | ||
<tr> | ||
<td><Rating rating={0} className="inline" /></td> | ||
<td>doesn’t know</td> | ||
<td><Rating rating={0} className="inline" /></td> | ||
<td>not interested</td> | ||
</tr> | ||
</tbody> | ||
</table>); | ||
|
||
|
||
export default App; |
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.