diff --git a/frontend/src/MainApp/index.js b/frontend/src/MainApp/index.js index 3f0f983..13c17f5 100644 --- a/frontend/src/MainApp/index.js +++ b/frontend/src/MainApp/index.js @@ -1,6 +1,7 @@ import React, { Component } from 'react'; import Login from '../components/Login/index' import NotFound from '../components/NotFound/index' +import AdminView from '../components/AdminView/index' import { Switch, Route, Redirect } from 'react-router-dom' class MainApp extends Component { constructor(props){ @@ -15,12 +16,12 @@ class MainApp extends Component { submittedData:data }) } - render() { return (
}/> + diff --git a/frontend/src/common/SelectBox2/index.js b/frontend/src/common/SelectBox2/index.js index 12c8549..3ff2bcc 100644 --- a/frontend/src/common/SelectBox2/index.js +++ b/frontend/src/common/SelectBox2/index.js @@ -6,11 +6,11 @@ class SelectBox2 extends React.Component { } render() { - const { options } = this.props + const { options, value } = this.props return ( - {options.map((option, index) => { - return + return })} ) diff --git a/frontend/src/common/SelectBoxWithLabel/index.js b/frontend/src/common/SelectBoxWithLabel/index.js index 59f289a..6662f19 100644 --- a/frontend/src/common/SelectBoxWithLabel/index.js +++ b/frontend/src/common/SelectBoxWithLabel/index.js @@ -5,13 +5,13 @@ import './index.css' class SelectBoxWithLabel extends React.Component { render() { - const { category } = this.props + const { category, value } = this.props return (
{category}
- +
) } diff --git a/frontend/src/components/AdminView/index.js b/frontend/src/components/AdminView/index.js new file mode 100644 index 0000000..2df1dd9 --- /dev/null +++ b/frontend/src/components/AdminView/index.js @@ -0,0 +1,11 @@ +import React, {Component} from 'react'; +class AdminView extends Component { + constructor(props){ + super(props) + } + render(){ + return (

Successfully submit

) + } +} + +export default AdminView; \ No newline at end of file diff --git a/frontend/src/components/OnemdaForm/index.js b/frontend/src/components/OnemdaForm/index.js index a3e081e..f68fb45 100644 --- a/frontend/src/components/OnemdaForm/index.js +++ b/frontend/src/components/OnemdaForm/index.js @@ -6,7 +6,7 @@ import SelectBoxWithLabel from '../../common/SelectBoxWithLabel/index' import Date from '../../common/Date/index' import TextBox from '../../common/TextBox/index' import TextWithCaption from '../../common/TextWithCaption/index' -import Emoji from '../../common/Emoji/index' +import { withRouter } from 'react-router-dom'; class OnemdaForm extends React.Component { constructor(props) { @@ -161,7 +161,12 @@ class OnemdaForm extends React.Component { 'Content-Type': 'application/json', }, body: JSON.stringify(data) - }) + }).then((response)=>{ + this.props.history.push('/AdminView') + } + ).catch(function(err) { + console.log('Fetch Error :-S', err); + }); console.log('submitting for realz') } @@ -181,7 +186,7 @@ class OnemdaForm extends React.Component { - + {}} options={options1}> @@ -199,4 +204,4 @@ class OnemdaForm extends React.Component { } } -export default OnemdaForm \ No newline at end of file +export default withRouter(OnemdaForm) \ No newline at end of file