-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
created input, message-display, mssage and closeIcon components
- Loading branch information
Showing
16 changed files
with
174 additions
and
10 deletions.
There are no files selected for viewing
This file contains 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
.chatinnerContainer { | ||
background: #fff; | ||
padding: 1rem; | ||
position: absolute; | ||
border-radius: 1.2rem; | ||
top: 50%; | ||
left: 50%; | ||
transform: translate(-50%, -50%); | ||
text-align: center; | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import React from "react"; | ||
import CloseIcon from "../closeIcon/CloseIcon"; | ||
|
||
import "./charBar.css"; | ||
|
||
const ChatBar = ({ room }) => ( | ||
<div className="appBarContainer"> | ||
<div className="leftContainer"> | ||
<h2 className="roomHeader">{room}</h2> | ||
</div> | ||
<div className="rightContainer"> | ||
<CloseIcon /> | ||
</div> | ||
</div> | ||
); | ||
|
||
export default ChatBar; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
.appBarContainer { | ||
display: flex; | ||
} | ||
|
||
.leftContainer { | ||
margin-right: auto; | ||
padding: 2rem; | ||
} | ||
.rightContainer { | ||
padding: 2rem; | ||
} | ||
|
||
.roomHeader { | ||
text-transform: uppercase; | ||
color: #f0f; | ||
font-weight: 700; | ||
font-size: 2.3rem; | ||
} |
Empty file.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import React from "react"; | ||
|
||
const ChatInput = ({ message, setMessage, sendMessage }) => ( | ||
<> | ||
<input | ||
value={message} | ||
onChange={e => { | ||
setMessage(e.target.value); | ||
}} | ||
onKeyPress={e => (e.key === "Enter" ? sendMessage(e) : null)} | ||
type="text" | ||
/> | ||
</> | ||
); | ||
|
||
export default ChatInput; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import React from "react"; | ||
import { Link } from "react-router-dom"; | ||
import { ReactComponent as CrossSvg } from "../../assets/cross.svg"; | ||
|
||
const CloseIcon = () => { | ||
return ( | ||
<Link to="/"> | ||
<CrossSvg /> | ||
</Link> | ||
); | ||
}; | ||
|
||
export default CloseIcon; |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import React from "react"; | ||
import "./message.css"; | ||
|
||
const Message = ({ message }) => ( | ||
<div className="msgRight"> | ||
<div className="msgcontainer"> | ||
<div className="messageAuthor"> | ||
{message.user},{new Date(Date.now()).toLocaleString("en-us")} | ||
</div> | ||
<div className="content">{message.message}</div> | ||
</div> | ||
</div> | ||
); | ||
|
||
export default Message; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
.msgcontainer { | ||
box-shadow: 0 0 0.3rem 0.3rem #00000024; | ||
border-radius: 0.3rem; | ||
display: grid; | ||
flex-direction: column; | ||
margin-bottom: 2rem; | ||
width: 70%; | ||
} | ||
.msgRight { | ||
display: flex; | ||
} | ||
.messageAuthor { | ||
background: #00000024; | ||
color: #f0f; | ||
text-transform: capitalize; | ||
font-size: 1.2rem; | ||
} | ||
.content { | ||
font-size: 1rem; | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import React from "react"; | ||
import Message from "../message/Message"; | ||
import "./messageDisplay.css"; | ||
|
||
const MessageDisplay = ({ messages }) => ( | ||
<div className="MessageDisplayStyles"> | ||
{messages.map((message, key) => ( | ||
<Message key={key} message={message} /> | ||
))} | ||
</div> | ||
); | ||
|
||
export default MessageDisplay; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.MessageDisplayStyles { | ||
padding: 1rem; | ||
background: #fff; | ||
} |
This file contains 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
This file contains 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