Part 4: Adding Chats
Installing the Empirica Chat
meteor npm install --save @empirica/chatAdding a chat to the social stage
import { Chat } from "@empirica/chat"; return (
<div className="social-exposure">
<h3 className="title">Social Information</h3>
<p className="title">
{
otherPlayers.length > 1
? <strong>There are {otherPlayers.length} other players:</strong>
: <strong>There is one other player:</strong>
}
</p>
{otherPlayers.map(p => this.renderSocialInteraction(p))}
<div>
<p className="chat-title"><strong>Chat</strong></p>
<Chat player={player} scope={round} />
</div>
</div>
);Styling the chat
Using factors to create conditions with and without chats:
Last updated
Was this helpful?