This file contains hidden or 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
// ./src/Chat.js | |
import React, { Component } from 'react' | |
import { ChatManager, TokenProvider } from '@pusher/chatkit' | |
+import MessageList from './MessageList' | |
class Chat extends React.Component { | |
state = { | |
- currentUser: null | |
+ currentUser: null, |
This file contains hidden or 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
// ./src/MessageList.js | |
import React, { Component } from 'react' | |
import { | |
ListView, | |
ListViewSection, | |
ListViewSectionHeader, | |
ListViewRow, | |
Text | |
} from 'react-desktop/macOs' |
This file contains hidden or 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
/* ./src/index.css */ | |
body { | |
font-family: BlinkMacSystemFont, sans-serif; | |
margin: 0; | |
padding: 0; | |
} | |
.username-form { | |
padding: 10px; |
This file contains hidden or 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
// ./src/Chat.js | |
import React, { Component } from 'react' | |
import { ChatManager, TokenProvider } from '@pusher/chatkit' | |
class Chat extends Component { | |
state = { | |
currentUser: null | |
} |
This file contains hidden or 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
// ./src/App.js | |
import React, { Component } from 'react' | |
import UsernameForm from './UsernameForm' | |
+import Chat from './Chat' | |
class App extends Component { | |
state = { | |
currentUsername: null, | |
- currentId: null |
This file contains hidden or 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
// ./src/Chat.js | |
import React, { Component } from 'react' | |
class Chat extends Component { | |
render() { | |
return ( | |
<div> | |
<h1>Chat</h1> | |
</div> |
This file contains hidden or 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
// ./src/App.js | |
import React, { Component } from 'react' | |
import UsernameForm from './UsernameForm' | |
class App extends Component { | |
state = { | |
currentUsername: null, | |
currentId: null | |
} |
This file contains hidden or 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
// ./src/UsernameForm.js | |
import React, { Component } from 'react' | |
import { TextInput } from 'react-desktop/macOs' | |
import { Button } from 'react-desktop/macOs' | |
class UsernameForm extends Component { | |
constructor() { | |
super() | |
this.state = { |
This file contains hidden or 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
// ./server.js | |
const express = require('express') | |
const bodyParser = require('body-parser') | |
const cors = require('cors') | |
const Chatkit = require('pusher-chatkit-server') | |
const chatkit = new Chatkit.default({ | |
instanceLocator: 'YOUR INSTANCE LOCATOR UNDER THE "CREDENTIALS" HEADER', | |
key: |
This file contains hidden or 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
<!-- Global site tag (gtag.js) - Google AdWords: 955504922 --> | |
<script async src="https://www.googletagmanager.com/gtag/js?id=AW-955504922"></script> | |
<script> | |
window.dataLayer = window.dataLayer || []; | |
function gtag(){dataLayer.push(arguments);} | |
gtag('js', new Date()); | |
gtag('config', 'AW-955504922'); | |
</script> |