Skip to content
This repository has been archived by the owner on Feb 7, 2020. It is now read-only.

Emoji Picker feature #55

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
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
Prev Previous commit
made more updates to code formatting so it matches the origin. I also…
… changed the anchor tag to a button because I forgot to change it back when I was debugging.
DevFlex committed Apr 21, 2018
commit 1664fe5c12b28f4a55ef8a15da36c64b30151624
6 changes: 3 additions & 3 deletions src/components/EmojiPicker/index.js
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ let jsemoji = new JSEMOJI()

const Picker = ({
state: { isPickerShowing },
actions: { toggleEmojiPicker, handleEmojiSelection }
actions: { toggleEmojiPicker, handleEmojiSelection },
}) => (
<div
onClick={e => {
@@ -28,8 +28,8 @@ const Picker = ({
}}
/>
</div>
<a
href="#"
<input
type={'button'}
className={style.button}
onClick={e => {
e.preventDefault()
2 changes: 2 additions & 0 deletions src/components/EmojiPicker/index.module.css
Original file line number Diff line number Diff line change
@@ -24,6 +24,8 @@
background-position: center center;
background-repeat: no-repeat;
background-size: contain;
border: none;
cursor: pointer;
}

.show {
16 changes: 8 additions & 8 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -29,7 +29,7 @@ class View extends React.Component {
typing: {},
sidebarOpen: false,
isPickerShowing: false,
userListOpen: window.innerWidth > 1000
userListOpen: window.innerWidth > 1000,
}

actions = {
@@ -72,7 +72,7 @@ class View extends React.Component {
!this.state.user.roomSubscriptions[room.id] &&
this.state.user.subscribeToRoom({
roomId: room.id,
hooks: { onNewMessage: this.actions.addMessage }
hooks: { onNewMessage: this.actions.addMessage },
})
},

@@ -91,7 +91,7 @@ class View extends React.Component {
: this.actions.createRoom({
name: this.state.user.id + options.user.id,
addUserIds: [options.user.id],
private: true
private: true,
})
}
},
@@ -142,7 +142,7 @@ class View extends React.Component {
invite: ([userId]) => this.actions.addUserToRoom({ userId }),
remove: ([userId]) => this.actions.removeUserFromRoom({ userId }),
leave: ([userId]) =>
this.actions.removeUserFromRoom({ userId: this.state.user.id })
this.actions.removeUserFromRoom({ userId: this.state.user.id }),
}
const name = command.split(' ')[0]
const args = command.split(' ').slice(1)
@@ -186,15 +186,15 @@ class View extends React.Component {
`New Message from ${message.sender.id}`,
{
body: message.text,
icon: message.sender.avatarURL
icon: message.sender.avatarURL,
}
)
notification.addEventListener('click', e => {
this.actions.joinRoom(message.room)
window.focus()
})
}
}
},
}

componentDidMount() {
@@ -203,7 +203,7 @@ class View extends React.Component {
? ChatManager(this, JSON.parse(existingUser))
: fetch('https://chatkit-demo-server.herokuapp.com/auth', {
method: 'POST',
body: JSON.stringify({ code: authCode })
body: JSON.stringify({ code: authCode }),
})
.then(res => res.json())
.then(user => {
@@ -229,7 +229,7 @@ class View extends React.Component {
messages,
typing,
sidebarOpen,
userListOpen
userListOpen,
} = this.state
const { createRoom, createConvo, removeUserFromRoom } = this.actions