new message

This commit is contained in:
Little Dipper 2023-06-10 01:58:10 +02:00
parent 47863325ea
commit 2e8e9e337e
4 changed files with 74 additions and 33 deletions

View File

@ -12,6 +12,7 @@ import Message from "./Message"
import { TbSend } from 'react-icons/tb';
import { ImBlocked } from 'react-icons/im';
import { MdOutlineGroupAdd } from 'react-icons/md';
import { GrAdd } from 'react-icons/gr'
const TouchDiv = styled.div`
@ -228,7 +229,7 @@ function Chats(){
return (
<div className="chat">
<div className='navbar'>
{/* <div className='navbar'>
<img src={DefaultPic} alt="profile" className="pic"/>
<span>
{isLoading ? (
@ -238,7 +239,7 @@ function Chats(){
// <h4>{user.username}</h4>
)}
</span>
</div>
</div> */}
@ -260,25 +261,38 @@ function Chats(){
</TouchDiv>
</div>
</div>
{conversations.map(c=> (
<div onClick={() => setCurrentChat(c)}>
<UserChat>
<img className="pic-user" src={DefaultPic} alt="User" />
<div className="infoSideBar">
<span>{c.name}</span>
<SideP>Desc?</SideP>
<div className="messages_box">
<div className="contact">
<UserChat>
<div className="newMessage">
<GrAdd/>
<span>New Message</span>
</div>
</UserChat>
</UserChat>
{conversations.map(c=> (
<div onClick={() => setCurrentChat(c)}>
<UserChat>
<img className="pic-user" src={DefaultPic} alt="User" />
<div className="infoSideBar">
<span>{c.name}</span>
<SideP>Desc?</SideP>
</div>
</UserChat>
</div>
))}
</div>
))}
{
currentChat ? (
<>
<>
<div className="messages">
{messages.map(m=>(
<Message message = {m} own={m.sender === user.username} user={m}/>
))}
<div className="scroll">
{messages.map(m=>(
<Message message = {m} own={m.sender === user.username} user={m}/>
))}
</div>
{/* <Input/> */}
<div className="input">
<input
@ -287,7 +301,7 @@ function Chats(){
placeholder="What do you want to say"
onChange={(e) => setNewMessage(e.target.value)}
value={newMessages}
/>
/>
<div className="send">
<TbSend onClick={handleSubmit}></TbSend>
</div>
@ -295,19 +309,14 @@ function Chats(){
</div>
</>
) : (
<span className="noConv">Open a conversation</span>)}
<div className="messages">
<span className="noConv">Open a conversation</span>
</div>
)}
</div>
</div>
// </div>
);
);
}
export default Chats

View File

@ -19,10 +19,10 @@ import DefaultPicture from '../../assets/profile.jpg'
import '../../styles/Messages.css'
const MeStyleP = styled.p`
background-color: lightgray;
background-color: #5843e4;
padding 10px 20px;
border-radius 10px 0px 10px 10px;
color: black;
color: white;
margin-right: 20px;
`

View File

@ -1,12 +1,38 @@
.home{
background-color: black;
height: 90vh;
height: 10vh;
display: flex;
align-items: center;
justify-content: center;
}
.scroll{
overflow: scroll;
}
.newMessage{
color: white;
font-size: 18px;
}
.contact{
background-color: rgb(46, 46, 46);
align-items: left;
/* width: 2rem; */
/* height: 4rem; */
}
.messages_box{
background-color: black;
/* height: 90vh; */
display: flex;
align-items: center;
justify-content: center;
/* position:relative; */
}
.container{
border-color: #FFFFFF ;
border-radius: 50%;
@ -65,8 +91,9 @@
}
.messages{
background-color: #349b83;
height: calc(100% - 118px);
background-color: black;
/* height: calc(100% - 118px); */
width: 40rem;
overflow: scroll;
}
@ -115,4 +142,5 @@ input{
display: flex;
flex-direction: row-reverse;
padding: 20px;
color: lightgrey;
}

View File

@ -38,9 +38,13 @@
.chat {
width: 100%;
height: 100vh;
display: flex;
display:inline-block;
align-items: center;
}
.chat_2{
display:flex;
}
.chat__sidebar {
height: 100%;
background-color: #f9f5eb;