|
1 | | -import { Popover, PopoverButton, PopoverPanel } from "@headlessui/react"; |
2 | | -import { EllipsisVerticalIcon, MagnifyingGlassIcon, MicrophoneIcon, PhotoIcon, PlusIcon, VideoCameraIcon } from "@heroicons/react/24/solid"; |
| 1 | +import ChatHeader from "@/components/ChatHeader"; |
| 2 | +import ChatInput from "@/components/ChatInput"; |
| 3 | +import ChatItem from "@/components/ChatItem"; |
| 4 | +import ChatPanel from "@/components/ChatPanel"; |
| 5 | +import { ChatBubbleLeftIcon, MagnifyingGlassIcon } from "@heroicons/react/24/outline"; |
| 6 | +import { EllipsisVerticalIcon } from "@heroicons/react/24/solid"; |
3 | 7 | import Image from "next/image"; |
4 | 8 |
|
5 | 9 | export default function Page() { |
6 | 10 | return ( |
7 | | - <div className="flex-1 flex flex-col overflow-hidden relative"> |
8 | | - <header className="flex items-center p-4 gap-4 bg-[#F0F2F5] shadow"> |
9 | | - <button className="cursor-pointer"> |
10 | | - <Image |
11 | | - src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcS1MWm4Uc-yhWB5bkRg8r_Vy6ueABFtDb_qSA&s" |
12 | | - alt="Donald Trump" |
13 | | - width={40} |
14 | | - height={40} |
15 | | - className=" rounded-full aspect-square object-cover" /> |
16 | | - </button> |
17 | | - <h1 className="flex-1">Donald Trump</h1> |
18 | | - <div className="flex items-center gap-8"> |
19 | | - <button className="p-2 rounded-full cursor-pointer active:bg-slate-300/60 |
| 11 | + <div className="flex-1 flex overflow-hidden shadow-xl"> |
| 12 | + <div className="bg-[#F0F2F5] w-15"> |
| 13 | + Icons |
| 14 | + </div> |
| 15 | + <div className="bg-white w-md border flex flex-col"> |
| 16 | + <header className="flex items-center p-4 justify-between"> |
| 17 | + <h1 className="font-bold tracking-wide text-xl text-slate-800">Chats</h1> |
| 18 | + <div className="flex gap-6"> |
| 19 | + <button className="p-2 rounded-full cursor-pointer active:bg-slate-300/60 |
20 | 20 | transition-all duration-150 ease-in-out"> |
21 | | - <VideoCameraIcon className="size-6 text-slate-400" /> |
22 | | - </button> |
23 | | - <button className="p-2 rounded-full cursor-pointer active:bg-slate-300/60 |
| 21 | + <ChatBubbleLeftIcon className="size-6 text-gray-700" /> |
| 22 | + </button> |
| 23 | + <button className="p-2 rounded-full cursor-pointer active:bg-slate-300/60 |
24 | 24 | transition-all duration-150 ease-in-out"> |
25 | | - <MagnifyingGlassIcon className="size-6 text-gray-700" /> |
26 | | - </button> |
27 | | - <Popover className="relative"> |
28 | | - <PopoverButton className="p-2 rounded-full cursor-pointer active:bg-slate-300/60 |
29 | | - transition-all duration-150 ease-in-out ring-0 outline-0 focus:bg-slate-300/60"> |
30 | 25 | <EllipsisVerticalIcon className="size-6 text-gray-700" /> |
31 | | - </PopoverButton> |
32 | | - <PopoverPanel as="ul" anchor="bottom start" className="bg-white py-4 shadow rounded-sm |
33 | | - w-52 flex flex-col gap-2 mr-2 z-50"> |
34 | | - <li className="hover:bg-gray-100 px-4 py-2 cursor-pointer">Contact Info</li> |
35 | | - <li className="hover:bg-gray-100 px-4 py-2 cursor-pointer">Select messages</li> |
36 | | - <li className="hover:bg-gray-100 px-4 py-2 cursor-pointer">Mute notifications</li> |
37 | | - <li className="hover:bg-gray-100 px-4 py-2 cursor-pointer">Disappearing messages</li> |
38 | | - <li className="hover:bg-gray-100 px-4 py-2 cursor-pointer">Close chat</li> |
39 | | - <li className="hover:bg-gray-100 px-4 py-2 cursor-pointer">Report</li> |
40 | | - <li className="hover:bg-gray-100 px-4 py-2 cursor-pointer">Block</li> |
41 | | - <li className="hover:bg-gray-100 px-4 py-2 cursor-pointer">Clear chat</li> |
42 | | - <li className="hover:bg-gray-100 px-4 py-2 cursor-pointer">Delete chat</li> |
43 | | - </PopoverPanel> |
44 | | - </Popover> |
45 | | - </div> |
46 | | - </header> |
47 | | - <div className="flex-1 overflow-y-scroll bg-[#EFEAE2] relative flex"> |
48 | | - <div className="w-full h-full absolute bg-[url(./wa-bg.png)]"></div> |
49 | | - <div className="flex flex-col z-50 py-5 px-10 w-full gap-4"> |
50 | | - <div className="relative rounded-lg bg-[#DCF8C6] px-3 py-2 shadow-xs |
51 | | - self-end max-w-[65%]"> |
52 | | - <p className="text-[15px] text-gray-700"> |
53 | | - Halo Admin Joy Dental, saya mau konsultasi gigi |
54 | | - </p> |
55 | | - <div className="flex items-center justify-end gap-1 text-[11px] text-gray-500"> |
56 | | - <span>8:16 AM</span> |
57 | | - <span className="ml-1">✓✓</span> |
58 | | - </div> |
59 | | - {/* Triangle shape for chat bubble */} |
60 | | - <div |
61 | | - className="absolute top-0 -right-2.5 h-4 w-4" |
62 | | - style={{ |
63 | | - clipPath: "polygon(0 0, 100% 0, 0 100%, 0 50%)", |
64 | | - }} |
65 | | - > |
66 | | - <div className="absolute h-5 w-5 transform bg-[#DCF8C6]" /> |
67 | | - </div> |
| 26 | + </button> |
68 | 27 | </div> |
69 | | - |
70 | | - <div className="relative rounded-lg bg-white px-3 py-2 shadow-xs |
71 | | - self-start max-w-[65%]"> |
72 | | - <p className="text-[15px] text-gray-700"> |
73 | | - Terima kasih telah menghubungi Hotline Klinik Gigi Joy Dental. Mohon maaf saat ini di luar jam operasional kami. Kami akan segera menghubungi kembali di jam operasional: |
74 | | - </p> |
75 | | - <div className="flex items-center justify-end gap-1 text-[11px] text-gray-500"> |
76 | | - <span>8:16 AM</span> |
77 | | - <span className="ml-1">✓✓</span> |
78 | | - </div> |
79 | | - {/* Triangle shape for chat bubble */} |
80 | | - <div |
81 | | - className="absolute top-0 -left-2.5 h-4 w-4" |
82 | | - style={{ |
83 | | - clipPath: "polygon(0 0, 0 0, 100% 0, 100% 100%)", |
84 | | - }} |
85 | | - > |
86 | | - <div className="absolute h-5 w-5 transform bg-white" /> |
87 | | - </div> |
88 | | - </div> |
89 | | - </div> |
90 | | - </div> |
91 | | - <div className="flex items-center px-4 py-2 gap-4 bg-[#F0F2F5] |
92 | | - shadow-[0_-1px_3px_0_rgba(0,0,0,0.1),0_-1px_2px_0_rgba(0,0,0,0.06)]"> |
93 | | - <button className="cursor-pointer p-2 rounded-full active:bg-slate-300/60 |
94 | | - transition-all duration-150 ease-in-out"> |
95 | | - <PlusIcon className="size-6 text-gray-700" /> |
96 | | - </button> |
97 | | - <div className="flex-1 flex items-center gap-3 bg-white px-4 py-2 |
98 | | - rounded-lg"> |
99 | | - <button className="cursor-pointer p-2 rounded-full active:bg-slate-300/60 |
100 | | - transition-all duration-150 ease-in-out"> |
101 | | - <PhotoIcon className="size-6 text-gray-700" /> |
| 28 | + </header> |
| 29 | + <div className="flex bg-[#F0F2F5] px-4 py-2 gap-8 rounded-lg mt-2 mx-4"> |
| 30 | + <button className="cursor-pointer"> |
| 31 | + <MagnifyingGlassIcon className="size-4 text-gray-700" /> |
102 | 32 | </button> |
103 | | - <input placeholder="Type a message" className="outline-none flex-1" /> |
| 33 | + <input placeholder="Search" className="flex-1 text-sm outline-0" /> |
104 | 34 | </div> |
105 | | - <button className="cursor-pointer p-2 rounded-full active:bg-slate-300/60 |
106 | | - transition-all duration-150 ease-in-out"> |
107 | | - <MicrophoneIcon className="size-6 text-gray-700" /> |
108 | | - </button> |
| 35 | + <div className="flex items-center gap-4 mt-2 px-4"> |
| 36 | + <button className="bg-[#E7FCE3] text-[#00808D] px-2 py-1 rounded-2xl cursor-pointer |
| 37 | + text-sm font-light">All</button> |
| 38 | + <button className="bg-[#F0F2F5] px-2 py-1 rounded-2xl cursor-pointer text-sm |
| 39 | + font-light hover:brightness-95 transition-all duration-150 ease-linear">Unread</button> |
| 40 | + <button className="bg-[#F0F2F5] px-2 py-1 rounded-2xl cursor-pointer text-sm |
| 41 | + font-light hover:brightness-95 transition-all duration-150 ease-linear">Favorites</button> |
| 42 | + <button className="bg-[#F0F2F5] px-2 py-1 rounded-2xl cursor-pointer text-sm |
| 43 | + font-light hover:brightness-95 transition-all duration-150 ease-linear">Groups</button> |
| 44 | + </div> |
| 45 | + {/* Chat List */} |
| 46 | + <div className="flex-1 mt-2 overflow-y-scroll scrollbar"> |
| 47 | + <ChatItem /> |
| 48 | + <ChatItem /> |
| 49 | + <ChatItem /> |
| 50 | + <ChatItem /> |
| 51 | + <ChatItem /> |
| 52 | + <ChatItem /> |
| 53 | + <ChatItem /> |
| 54 | + <ChatItem /> |
| 55 | + <ChatItem /> |
| 56 | + <ChatItem /> |
| 57 | + </div> |
| 58 | + <div>Get WhyApp for Windows</div> |
| 59 | + </div> |
| 60 | + <div className="flex-1 flex flex-col overflow-hidden relative"> |
| 61 | + <ChatHeader /> |
| 62 | + <ChatPanel /> |
| 63 | + <ChatInput /> |
109 | 64 | </div> |
110 | 65 | </div> |
111 | 66 | ) |
|
0 commit comments