forked from adrianhajdin/chat_application
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
26 lines (20 loc) · 746 Bytes
/
App.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import { ChatEngine } from 'react-chat-engine';
import ChatFeed from './components/ChatFeed';
import LoginForm from './components/LoginForm';
import './App.css';
const projectID = '1b7801d6-8a66-4be4-a442-89219d833dfc';
const App = () => {
if (!localStorage.getItem('username')) return <LoginForm />;
return (
<ChatEngine
height="100vh"
projectID={projectID}
userName={localStorage.getItem('username')}
userSecret={localStorage.getItem('password')}
renderChatFeed={(chatAppProps) => <ChatFeed {...chatAppProps} />}
onNewMessage={() => new Audio('https://chat-engine-assets.s3.amazonaws.com/click.mp3').play()}
/>
);
};
// infinite scroll, logout, more customizations...
export default App;