Add Twilio client wrapper and types

Add voice state manager
This commit is contained in:
2020-02-06 00:11:48 -05:00
parent adf9e17884
commit 827978d18d
7 changed files with 229 additions and 19 deletions

View File

@@ -1,26 +1,24 @@
import React from 'react';
import logo from './logo.svg';
import './App.css';
import useVoice from './Wrappers/voice';
import { voiceToken } from './Wrappers/default-config';
const App = () => {
return (
<div className="App">
<header className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<p>
Edit <code>src/App.tsx</code> and save to reload.
</p>
<a
className="App-link"
href="https://reactjs.org"
target="_blank"
rel="noopener noreferrer"
>
Learn React
</a>
</header>
</div>
);
const { startDevice, answer, hangup, voiceState } = useVoice();
window.setTimeout(() => startDevice(voiceToken), 5000);
return (
<div className="App">
<header className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<p>
Device is currently {voiceState.deviceState}.
</p>
</header>
</div>
);
}
export default App;