Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
7b6c086
Implement websocket connection
dmrib Apr 7, 2020
bf48563
Define connection status style
dmrib Apr 7, 2020
c5fe5da
Create connection status indicator
dmrib Apr 7, 2020
a68303b
Componentize header identity section
dmrib Apr 7, 2020
85ef629
Componentize settings menu
dmrib Apr 7, 2020
87c25eb
Add @ant-design/icons as a dependency
dmrib Apr 8, 2020
520cdf7
Override antd styling for slider component
dmrib Apr 8, 2020
88e72b1
Add prediction size selection to settings
dmrib Apr 8, 2020
c7c4cb9
Add Salami icon
dmrib Apr 8, 2020
99e11b0
Implement prediction hints component
dmrib Apr 8, 2020
723d830
Expose prediction hints component
dmrib Apr 8, 2020
4a127d0
Add redux as a dependency
dmrib Apr 8, 2020
be5ad8e
Add react-redux as a dependency
dmrib Apr 8, 2020
45f6dfd
Add redux-devtools-extension as a development dependency
dmrib Apr 8, 2020
929a9cd
Implement set maximum prediction size action
dmrib Apr 8, 2020
0197218
Create Predictions aggregate reducer
dmrib Apr 8, 2020
098114f
Create Redux store reducer
dmrib Apr 8, 2020
7ffe068
Create application Redux store
dmrib Apr 8, 2020
c35d6b9
Expose Redux store to components
dmrib Apr 8, 2020
a68cf84
Expose set maximum prediction size action
dmrib Apr 8, 2020
7d623d9
Implement set idle time until prediction action
dmrib Apr 9, 2020
9fb44ec
Implement set idle time until prediction reducer
dmrib Apr 9, 2020
4612d5b
Style line separators on settings
dmrib Apr 9, 2020
c02cd1f
Make idle time until prediction adjustable
dmrib Apr 9, 2020
74a9ba2
Implement reset prediction action
dmrib Apr 9, 2020
7e77dd2
Implement reset prediction reducer
dmrib Apr 9, 2020
2154d5e
Implement wait prediction action
dmrib Apr 9, 2020
ea319d7
Implement wait prediction reducer
dmrib Apr 9, 2020
1808c1e
Add uuid as a dependency
dmrib Apr 9, 2020
5cf43b1
Make predictions request on user idle
dmrib Apr 9, 2020
3a0bdd3
Animate Salami while waiting for predictions
dmrib Apr 9, 2020
89f3f2f
Implement show hint action
dmrib Apr 11, 2020
db08e66
Implement show hint reducer
dmrib Apr 11, 2020
9ecb969
Handle incoming predictions on socket connection
dmrib Apr 11, 2020
e3af40c
Parse text before sending for backstage predictions
dmrib Apr 11, 2020
07717a9
Make Salami reactive to incoming predictions
dmrib Apr 11, 2020
c896871
Override antd styling for popvers
dmrib Apr 11, 2020
d033f15
Implement predictions appending to text body
dmrib Apr 11, 2020
037e839
Update project documentation
dmrib Apr 11, 2020
ff410e2
Update version to 0.2.0
dmrib Apr 11, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/App.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ <h1 class="navbar-item">linguiçator-editor</h1>
<div class="column is-3" id="sidebarNav">
<div class="sidebar">
<nav>
<h2><a href="index.html">Home</a></h2><div class="category"><h3>Components</h3><ul><li><a href="App.html">App</a></li><li><a href="Content.html">Content</a></li><li><a href="Footer.html">Footer</a></li><li><a href="Header.html">Header</a></li></ul></div>
<h2><a href="index.html">Home</a></h2><div class="category"><h3>Components</h3><ul><li><a href="App.html">App</a></li><li><a href="Content.html">Content</a></li><li><a href="Footer.html">Footer</a></li><li><a href="Header.html">Header</a></li><li><a href="Identity.html">Identity</a></li><li><a href="Predictor.html">Predictor</a></li><li><a href="Settings.html">Settings</a></li><li><a href="StatusIndicator.html">StatusIndicator</a></li></ul><h3>Global</h3><ul><li><a href="global.html#INITIAL_STATE">INITIAL_STATE</a></li><li><a href="global.html#predictions">predictions</a></li><li><a href="global.html#resetPrediction">resetPrediction</a></li><li><a href="global.html#setIdleTime">setIdleTime</a></li><li><a href="global.html#setMaxSize">setMaxSize</a></li><li><a href="global.html#showHint">showHint</a></li><li><a href="global.html#store">store</a></li><li><a href="global.html#waitPrediction">waitPrediction</a></li></ul></div>
</nav>
</div>
</div>
Expand Down Expand Up @@ -149,7 +149,7 @@ <h4 class="name" id="App">
<p class="tag-source">
<a href="App.js.html" class="button">View Source</a>
<span>
<a href="App.js.html">App.js</a>, <a href="App.js.html#line14">line 14</a>
<a href="App.js.html">App.js</a>, <a href="App.js.html#line21">line 21</a>
</span>
</p>

Expand Down Expand Up @@ -218,7 +218,7 @@ <h4 class="name" id="App">

<footer class="footer">
<div class="content has-text-centered">
<p>Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Mon Mar 16 2020 20:30:10 GMT-0300 (Brasilia Standard Time)</p>
<p>Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.4</a> on Sat Apr 11 2020 19:08:34 GMT-0300 (Brasilia Standard Time)</p>
<p class="sidebar-created-by">
<a href="https://github.com/SoftwareBrothers/better-docs" target="_blank">BetterDocs theme</a> provided with <i class="fas fa-heart"></i> by
<a href="http://softwarebrothers.co" target="_blank">SoftwareBrothers - JavaScript Development Agency</a>
Expand Down
63 changes: 56 additions & 7 deletions docs/App.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ <h1 class="navbar-item">linguiçator-editor</h1>
<div class="column is-3" id="sidebarNav">
<div class="sidebar">
<nav>
<h2><a href="index.html">Home</a></h2><div class="category"><h3>Components</h3><ul><li><a href="App.html">App</a></li><li><a href="Content.html">Content</a></li><li><a href="Footer.html">Footer</a></li><li><a href="Header.html">Header</a></li></ul></div>
<h2><a href="index.html">Home</a></h2><div class="category"><h3>Components</h3><ul><li><a href="App.html">App</a></li><li><a href="Content.html">Content</a></li><li><a href="Footer.html">Footer</a></li><li><a href="Header.html">Header</a></li><li><a href="Identity.html">Identity</a></li><li><a href="Predictor.html">Predictor</a></li><li><a href="Settings.html">Settings</a></li><li><a href="StatusIndicator.html">StatusIndicator</a></li></ul><h3>Global</h3><ul><li><a href="global.html#INITIAL_STATE">INITIAL_STATE</a></li><li><a href="global.html#predictions">predictions</a></li><li><a href="global.html#resetPrediction">resetPrediction</a></li><li><a href="global.html#setIdleTime">setIdleTime</a></li><li><a href="global.html#setMaxSize">setMaxSize</a></li><li><a href="global.html#showHint">showHint</a></li><li><a href="global.html#store">store</a></li><li><a href="global.html#waitPrediction">waitPrediction</a></li></ul></div>
</nav>
</div>
</div>
Expand All @@ -65,26 +65,75 @@ <h1>App.js</h1>
<section>
<article>
<pre class="prettyprint source linenums"><code>import React from 'react';
import { useState, useRef, useEffect } from 'react';
import { Provider } from 'react-redux';
import store from './store';
import Content from './components/Content';
import Header from './components/Header';
import Footer from './components/Footer';
import config from './config/config.json';
import './App.css';
import 'antd/dist/antd.css';


const CONNECTION_ADDRESS = `ws://${config['HOST']}:${config['PORT']}`


/**
* App components aggregator.
*
* @component
*/
function App()
{
// component state hooks
const socket = useRef(null);
const [socketState, setSocketState] = useState(0);


/**
* I am called when this component is mounted.
*/
useEffect(() =>
{
// create websocket connection
socket.current = new WebSocket(CONNECTION_ADDRESS);

// on connection opened event callback
socket.current.onopen = (event) =>
{
console.log('Websocket connection established.')
setSocketState(socket.current.readyState);
}

// on connection closed event callback
socket.current.onclose = (event) =>
{
console.log("Websocket connection closed.");
setSocketState(socket.current.readyState);
}

// on websocket error event callback
socket.current.onerror = (event) =>
{
console.log('Websocket error: ', {event});
setSocketState(socket.current.readyState);
}

// cleanup on lifecycle end
return () => socket.current.close();

}, []);


return (
&lt;div className='app-container'>
&lt;Header />
&lt;Content />
&lt;Footer />
&lt;/div>
&lt;Provider store = {store}>
&lt;div className='app-container'>
&lt;Header socketState = {socketState}/>
&lt;Content socket = {socket.current}/>
&lt;Footer />
&lt;/div>
&lt;/Provider>
);
}

Expand All @@ -105,7 +154,7 @@ <h1>App.js</h1>

<footer class="footer">
<div class="content has-text-centered">
<p>Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Mon Mar 16 2020 20:30:10 GMT-0300 (Brasilia Standard Time)</p>
<p>Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.4</a> on Sat Apr 11 2020 19:08:34 GMT-0300 (Brasilia Standard Time)</p>
<p class="sidebar-created-by">
<a href="https://github.com/SoftwareBrothers/better-docs" target="_blank">BetterDocs theme</a> provided with <i class="fas fa-heart"></i> by
<a href="http://softwarebrothers.co" target="_blank">SoftwareBrothers - JavaScript Development Agency</a>
Expand Down
Loading