Skip to content

Commit

Permalink
Finish Create ChatRoom LAyout
Browse files Browse the repository at this point in the history
  • Loading branch information
Wadie-ess committed Sep 17, 2023
1 parent 4a31073 commit 6fda9fc
Show file tree
Hide file tree
Showing 5 changed files with 94 additions and 15 deletions.
18 changes: 18 additions & 0 deletions frontend/code/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions frontend/code/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"@types/react": "^18.2.15",
"@types/react-dom": "^18.2.7",
"axios": "^1.5.0",
"preline": "^1.9.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-hook-form": "^7.46.1",
Expand Down
68 changes: 62 additions & 6 deletions frontend/code/src/Components/Chat/Components/MessageHelpers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import {
yas3,
yas4,
SearchIcon,
EditIcon,
More,
// EditIcon,
// More,
Send,
Close,
Bio,
// Close,
// Bio,
GroupChat,
check,
MessageDummy,
Expand Down Expand Up @@ -129,6 +129,11 @@ export const ChatPlaceHolder = ({

export const OnlineNowUsers = () => {
const [Users] = useState(MessageDummy);
const [selectedOption, setSelectedOption] = useState("Public"); // Initialize with a default value

const handleOptionChange = (e: any) => {
setSelectedOption(e.target.value);
};
return (
<>
<div className="online-now-container pt-5 pl-5 pb-2 pr-3 bg-[#1A1C26]">
Expand Down Expand Up @@ -162,6 +167,55 @@ export const OnlineNowUsers = () => {
/>
</div>
</div>

<div className="flex flex-row form-control justify-around">
<label className="label cursor-pointer ">
<span className="label-text pr-2">Public</span>
<input
type="radio"
name="radio-10"
value="Public"
className="radio checked:bg-purple-500"
checked={selectedOption === "Public"}
onChange={handleOptionChange}
/>
</label>
<label className="label cursor-pointer">
<span className="label-text pr-2">Private</span>
<input
type="radio"
name="radio-10"
value="Private"
className="radio checked:bg-red-500"
checked={selectedOption === "Private"}
onChange={handleOptionChange}
/>
</label>
<label className="label cursor-pointer">
<span className="label-text pr-2">Protected</span>
<input
type="radio"
name="radio-10"
value="Protected"
className="radio checked:bg-orange-500"
checked={selectedOption === "Protected"}
onChange={handleOptionChange}
/>
</label>
</div>

{/* Conditionally render the text input */}
{selectedOption === "Protected" && (
<div className="flex flex-row p-3">
<div className="flex flex-row w-full justify-center pt-2">
<p>Group Password</p>
<input
type="Password"
className="input w-full shadow-xl max-w-lg bg-[#272932] placeholder:text-gray-400 font-poppins text-base font-normal leading-normal"
/>
</div>
</div>
)}
<p className="p-2">Select To Add Friends</p>

{/* Scrollable part */}
Expand All @@ -180,8 +234,10 @@ export const OnlineNowUsers = () => {
</div>

<div className="modal-action">
<a href="#" className="btn hover:bg-green-700">
Done!
{
// eslint-disable-next-line
}<a href="#" className="btn hover:bg-purple-500">
{" "}
</a>
</div>
</div>
Expand Down
16 changes: 8 additions & 8 deletions frontend/code/src/Components/Chat/index.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import {
UserImage,
yas,
yas1,
yas2,
yas3,
yas4,
SearchIcon,
EditIcon,
// UserImage,
// yas1,
// yas2,
// yas3,
// yas4,
// SearchIcon,
// EditIcon,
// GroupChat,
More,
Send,
Close,
Bio,
GroupChat,
} from "./Components/tools/Assets";
import { useState } from "react";
import {
Expand Down
6 changes: 5 additions & 1 deletion frontend/code/tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ module.exports = {
"./src/**/*.{js,jsx,ts,tsx}",
"./src/**/**/*.{js,jsx,ts,tsx}",
"./src/**/**/**/*.{js,jsx,ts,tsx}",

],
theme: {
extend: {
Expand All @@ -25,7 +26,10 @@ module.exports = {
},
},

plugins: [require("daisyui")],
plugins: [
require("daisyui"),
require('preline/plugin'),
],
daisyui: {
themes: [
{
Expand Down

0 comments on commit 6fda9fc

Please sign in to comment.