Skip to content

Commit

Permalink
Fix Chat CSS
Browse files Browse the repository at this point in the history
  • Loading branch information
feliciahmq committed Jun 30, 2024
1 parent f3da96f commit 6f08ec1
Show file tree
Hide file tree
Showing 8 changed files with 337 additions and 559 deletions.
857 changes: 307 additions & 550 deletions package-lock.json

Large diffs are not rendered by default.

Binary file added public/chat-icons/cross.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/components/chatComp/chatApp_chat/Chat.css
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@

input {
flex: 1;
background-color: #aeadad74;
background-color: #B09C9C;
border: none;
outline: none;
color: white;
Expand Down
15 changes: 15 additions & 0 deletions src/components/chatComp/chatApp_list/addUser/addUser.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,21 @@
right: 0;
margin: auto;

.closeButton {
display: flex;
justify-content: flex-end;
padding-bottom: 30px;

img {
width: 20px;
height: 20px;
border-radius: 50%;
object-fit: cover;
cursor: pointer;

}
}

form {
display: flex;
gap: 20px;
Expand Down
8 changes: 6 additions & 2 deletions src/components/chatComp/chatApp_list/addUser/addUser.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { db } from "../../../../lib/firebaseConfig";
import { useState } from "react";
import { useUserStore } from "../../../../lib/userStore";

const addUser = () => {
const addUser = ({ closePopup }) => {
const [user, setUser] = useState(null);
const [error, setError] = useState("");
const { currentUser } = useUserStore();
Expand Down Expand Up @@ -64,16 +64,20 @@ const addUser = () => {
}),
});

closePopup();
} catch (err) {
console.log(err);
}
}

return (
<div className="addUser">
<div className="closeButton" onClick={closePopup}>
<img src="/chat-icons/cross.png" alt="" />
</div>
<form onSubmit={handleSearch}>
<input type="text" placeholder="Username" name="username" />
<button>Search</button>
<button type="submit">Search</button>
</form>
{user ? (
<div className="user">
Expand Down
4 changes: 2 additions & 2 deletions src/components/chatComp/chatApp_list/chatList/ChatList.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

.searchBar {
flex: 1;
background-color: #aeadad74;
background-color: #B09C9C;
display: flex;
align-items: center;
gap: 20px;
Expand All @@ -34,7 +34,7 @@
.add {
width: 36px;
height: 36px;
background-color: #aeadad74;
background-color: #B09C9C;
padding: 10px;
border-radius: 10px;
cursor: pointer;
Expand Down
8 changes: 5 additions & 3 deletions src/components/chatComp/chatApp_list/chatList/ChatList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,10 @@ const ChatList = () => {
placeholder="Search"
onChange={(e) => setInput(e.target.value)}/>
</div>
<img src={addMode ? "/chat-icons/minus.png" : "/chat-icons/plus.png"} alt="" className="add"
onClick={() => setAddMode((prev) => !prev)} />
{!addMode && (
<img src="/chat-icons/plus.png" alt="" className="add"
onClick={() => setAddMode(true)} />
)}
</div>
{filteredChats.map((chat) => (
<div className="item" key={chat.chatId}
Expand All @@ -106,7 +108,7 @@ const ChatList = () => {
</div>
))}

{addMode && <AddUser />}
{addMode && <AddUser closePopup={() => setAddMode(false)} />}
</div>
);
};
Expand Down
2 changes: 1 addition & 1 deletion src/pages/chatapp/ChatApp.css
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
.inner-container {
width: 80vw;
height: 90vh;
background-color: #aeadad74;
background-color: #dbc5bf;
backdrop-filter: blur(19px) saturate(180%);
border-radius: 12px;
border: 1px solid rgba(255, 255, 255, 0.076);
Expand Down

0 comments on commit 6f08ec1

Please sign in to comment.