-
-
Save jetaggart/a761302f2a7167c70becefbbc1652ffe to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// frontend/src/App.js:5 | |
function App() { | |
const [username, setUsername] = useState(''); | |
const [leadId, setLeadId] = useState(''); | |
const [channel, setChannel] = useState(null); | |
const [chatClient, setChatClient] = useState(null); | |
const startChat = async () => { | |
// ... | |
} | |
if (channel && chatClient) { | |
return <SalesChat username={username} leadId={leadId} channel={channel} chatClient={chatClient}/>; | |
} else { | |
return <div className="login"> | |
<div className="login-description"> | |
Type in a username and start a chat to simulate a Customer's sales chat experience. Be sure to grab a Lead ID from Zendesk Sell. | |
</div> | |
<label>Customer Username</label> | |
<input | |
type="text" | |
value={username} | |
onChange={(e) => setUsername(e.target.value)} | |
required | |
/> | |
<label>Zendesk Lead ID</label> | |
<input | |
type="text" | |
value={leadId} | |
onChange={(e) => setLeadId(e.target.value)} | |
required | |
/> | |
<button onClick={startChat}>Start Sales Chat</button> | |
</div> | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment