Skip to content

Commit

Permalink
[WIP] Fix frontend routing and UI discrepancies (#29)
Browse files Browse the repository at this point in the history
* frontend routing fix#1

Signed-off-by: aditya109 <[email protected]>

* frontend done upto /takeinput/init

Signed-off-by: aditya109 <[email protected]>
  • Loading branch information
aditya109 authored Mar 26, 2020
1 parent 01d4a05 commit 29de489
Show file tree
Hide file tree
Showing 16 changed files with 275 additions and 181 deletions.
Binary file added Project Expo Proceeding paper format (1).docx
Binary file not shown.
Binary file removed assignment-2.pdf
Binary file not shown.
File renamed without changes
2 changes: 2 additions & 0 deletions bot-ui/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@
<link rel="stylesheet" href="node_modules/mdbootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="node_modules/mdbootstrap/css/mdb.min.css">
<link rel="stylesheet" href="node_modules/mdbootstrap/css/style.css">
<link href="https://fonts.googleapis.com/css?family=Titillium+Web&display=swap" rel="stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta name="description" content="Summarization and Classification of Textual Data"/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<link href="https://fonts.googleapis.com/css?family=Great+Vibes|Pangolin&display=swap" rel="stylesheet">
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
Expand Down
25 changes: 25 additions & 0 deletions bot-ui/src/components/EndPage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import React, { Component } from 'react'

class EndPage extends React.Component {
constructor(props) {
super(props)
this.state = {

}
}
render() {
return (
<div>
<div className= "title-text"><h1>We had fun guys, Did you ??</h1> </div>
<div class="subtitile-text">

<h6>If you did not, please write your suggestions on [email protected] and [email protected]</h6>
<a href="[email protected]"><h6></h6></a>

</div>
</div>
)
}
}

export default EndPage;
44 changes: 16 additions & 28 deletions bot-ui/src/components/InputPortal.js
Original file line number Diff line number Diff line change
@@ -1,41 +1,25 @@
import React, {useState, useEffect} from 'react';
import axios from 'axios';
import {fun} from './Helper';
import{ Redirect } from 'react-router-dom';
import history from './history';


// http://localhost:3000/takeinput/portal
const BASE_URL ="http://localhost:5010/"
class InputPortal extends React.Component {
constructor(props) {
super();
this.state = {
payloadBox : '',
redirect : null,
redirect : false,

};
this.handleChange = this.handleChange.bind(this)
}

setRedirect = () => {
this.setState({
redirect: true
})
}
renderRedirect = () => {
this.setRedirect()
if (this.state.redirect) {
return <Redirect push to="/takeinput/re" />
}
handleSubmit = (user) => {
saveUser(user).then(()=> this.setState(()=> ({
redirect:true
})))
}


handleChange(event) {
this.setState({
[event.target.name]:event.target.value
});
}

sendRequest(payload) {
console.log("Request length " + payload.length)
var res = fetch('http://localhost:5010/summarize', {
Expand All @@ -51,7 +35,9 @@ class InputPortal extends React.Component {
}

fun(data) {
console.log(data)
// console.log(dat


}

onSubmit = (event) => {
Expand All @@ -69,15 +55,17 @@ class InputPortal extends React.Component {
}

render() {

if(this.state.redirect === true) {
return <Redirect to='/endpage'/>
}

return (
<div class="text-area">
<label>
<div className="textarea-label">Enter your Text here &#11167;</div>
</label>

<div className = "textarea-item">
{/* <div className = "textarea-item">
<textarea
className="textarea-cl"
rows="16"
Expand All @@ -87,14 +75,14 @@ class InputPortal extends React.Component {
onChange={event => this.handleChange(event)}
cols="100">
</textarea>
</div>
</div> */}
<div>
<button className = "button" onClick={() => history.push('/takeinput/init')}>
<button className = "button" onClick={this.handleSubmit}>
{/* <span className="button-text" onClick={(e) => this.onSubmit(e)}>Summarize 'n' Classify&#10148;</span> */}
<span className="button-text" >Summarize 'n' Classify&#10148;</span>
</button>
</div>

{this.renderRedirect}
</div>

);
Expand Down
2 changes: 1 addition & 1 deletion bot-ui/src/components/bots/ControlCoral.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ class ControlCoral extends React.Component {
customDelay = '1600'
enableSmoothScroll = 'true'
headerTitle="Server - Coral"
speechSynthesis = {{ enable: true, lang: 'en' }}
speechSynthesis = {{ enable: false, lang: 'en' }}
steps = {steps}
/>
</ThemeProvider>
Expand Down
Loading

0 comments on commit 29de489

Please sign in to comment.