-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
/
Copy pathTextContainer.js
48 lines (44 loc) · 1010 Bytes
/
TextContainer.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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import React from "react";
import onlineIcon from "../../icons/onlineIcon.png";
import "./TextContainer.css";
const TextContainer = ({ users }) => (
<div className="textContainer">
<div>
<h1>
Realtime Chat Application{" "}
<span role="img" aria-label="emoji">
💬
</span>
</h1>
<h2>
Created with React, Express, Node and Socket.IO{" "}
<span role="img" aria-label="emoji">
❤️
</span>
</h2>
<h2>
Try it out right now!{" "}
<span role="img" aria-label="emoji">
⬅️
</span>
</h2>
</div>
{users.length !== 0 && (
<div>
<h1>People currently chatting:</h1>
<div className="activeContainer">
<h2>
{users.map(({ name }) => (
<div key={name} className="activeItem">
{name}
<img alt="Online Icon" src={onlineIcon} />
</div>
))}
</h2>
</div>
</div>
)}
{users.length === 0 && <span>Nobody is chatting right now</span>}
</div>
);
export default TextContainer;