diff --git a/src/components/Header.js b/src/components/Header.js index e84ddf4c3401303828a2e11712467f1d0d9a5c0b..df8fd7c563829e0fa8079b56f2f6c337bd86acd8 100644 --- a/src/components/Header.js +++ b/src/components/Header.js @@ -39,6 +39,11 @@ const menuItems = [ to: '/statistics', prefix: '', }, + { + text: 'JelentkezĂŠsek', + to: '/applications', + prefix: '', + }, ] const FixedMenu = ({ user }) => ( diff --git a/src/components/Main.js b/src/components/Main.js index 8f917c698f0801312f9870b569a30b4a5b83a1d1..9529bc6f34250ae3c9376dc5e35042c934423f9e 100644 --- a/src/components/Main.js +++ b/src/components/Main.js @@ -9,6 +9,7 @@ import Profile from './pages/Profile'; import Statistics from './pages/Statistics'; import Groups from './pages/Groups'; import News from './pages/News'; +import Applications from './pages/Applications'; import EventDetail from './pages/EventDetail'; const Main = () => ( @@ -22,6 +23,7 @@ const Main = () => ( <Route path='/statistics' component={Statistics} /> <Route path='/groups' component={Groups} /> <Route path='/events/:id' component={EventDetail} /> + <Route path='/applications' component={Applications} /> <Route component={NotFound} /> </Switch> ); diff --git a/src/components/pages/Applications.js b/src/components/pages/Applications.js new file mode 100644 index 0000000000000000000000000000000000000000..563d3ae2ad9ba9c2cf699b523e7f2e85c4f0c336 --- /dev/null +++ b/src/components/pages/Applications.js @@ -0,0 +1,56 @@ +import React, { Component } from 'react'; +import moment from 'moment'; +import { Link } from 'react-router-dom'; +import { Container, Table, Button } from 'semantic-ui-react'; +import { connect } from 'react-redux'; +import { getTrainees } from '../../actions/statistics'; + +class Applications extends Component { + componentWillMount() { + this.props.getTrainees(); + } + + renderApplicants() { + return this.props.trainees.map((trainee) => + { return ( + <Table.Row> + <Table.Cell> + <Link to={`trainee/${trainee.id}`}> + {trainee.full_name} + </Link> + </Table.Cell> + <Table.Cell> + </Table.Cell> + </Table.Row> + ); + }); + } + + render() { + return ( + <Container + textAlign='center' + style={{ + padding: '80px' + }} + > + <Table color='blue' celled selectable compact> + <Table.Header> + <Table.Row> + <Table.HeaderCell>Jelentkezettek</Table.HeaderCell> + <Table.HeaderCell>JelentkezĂŠs elfogadva:</Table.HeaderCell> + </Table.Row> + </Table.Header> + + <Table.Body> + {this.props.trainees ? this.renderApplicants() : 'Nincs mĂŠg alaklom beĂrva'} + </Table.Body> + </Table> + </Container> + ); + } +} + +const mapStateToProps = ({ trainees: { trainees }, user }) => ({ trainees, user }); + +export default connect(mapStateToProps, { getTrainees })(Applications);