File tree Expand file tree Collapse file tree 4 files changed +18
-33
lines changed Expand file tree Collapse file tree 4 files changed +18
-33
lines changed Original file line number Diff line number Diff line change 1
1
import { InputMessage } from "@/components/InputMessage" ;
2
2
import { MessageList } from "@/components/MessageList" ;
3
- import { Title } from "@/components/Title" ;
4
3
import { useState } from "react" ;
5
4
6
5
export const ChatBox = ( {
@@ -20,21 +19,20 @@ export const ChatBox = ({
20
19
} , 400 ) ;
21
20
} ;
22
21
return (
23
- < div className = "float-left flex-shrink flex-grow " >
24
- < Title owner = { owner } />
25
- < div className = "rounded-lg bg-white" >
22
+ < div className = "flex flex-col rounded-md w-full max-h-full bg-white justify-between mb-10" >
23
+ < div className = "rounded-lg w-full overflow-auto" >
26
24
< MessageList owner = { owner } messages = { messages } />
27
- < div className = "p-4" >
28
- < InputMessage
29
- isLoading = { isLoading }
30
- owner = { owner }
31
- ownerAvatar = { ownerAvatar }
32
- sendMessage = { sendMessage }
33
- sendMessageLoading = { sendMessageLoading }
34
- typing = { typing }
35
- resetTyping = { resetTyping }
36
- />
37
- </ div >
25
+ </ div >
26
+ < div className = "p-4" >
27
+ < InputMessage
28
+ isLoading = { isLoading }
29
+ owner = { owner }
30
+ ownerAvatar = { ownerAvatar }
31
+ sendMessage = { sendMessage }
32
+ sendMessageLoading = { sendMessageLoading }
33
+ typing = { typing }
34
+ resetTyping = { resetTyping }
35
+ / >
38
36
</ div >
39
37
</ div >
40
38
) ;
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import { MessageItem } from "@/components/MessageItem";
2
2
3
3
export const MessageList = ( { messages, owner } ) => {
4
4
return (
5
- < div className = "flex h-96 flex-col-reverse gap-4 overflow-y-auto rounded-md p-4" >
5
+ < div className = "flex flex-col-reverse gap-4 overflow-y-auto w-full max-h-full rounded-md p-4" >
6
6
{ messages
7
7
. slice ( 0 )
8
8
. reverse ( )
Original file line number Diff line number Diff line change @@ -69,7 +69,7 @@ export const ChatRoom = () => {
69
69
let bot = { name : "Bot" , avatar : "https://i.pravatar.cc/150?img=32" } ;
70
70
71
71
return (
72
- < div className = "flex content-start justify-center px-80 " >
72
+ < div className = "flex justify-center h-full " >
73
73
< ChatBox
74
74
owner = { user . name }
75
75
ownerAvatar = { user . avatar }
Original file line number Diff line number Diff line change 1
- import { TransferButton } from "@/components/TransferButton" ;
2
1
import { ConnectButton } from "@rainbow-me/rainbowkit" ;
3
2
import { ChatRoom } from "src/pages/ChatRoom" ;
4
3
5
4
export const Home = ( ) => {
6
5
return (
7
6
< >
8
- < div className = "h-screen bg-gray-900 " >
9
- < div className = "flex justify-end pt-2 pr-2 " >
7
+ < div className = "flex flex-col h-screen bg-gray-900 px-8 " >
8
+ < div className = "flex justify-end my-4 " >
10
9
< ConnectButton />
11
10
</ div >
12
- < div className = "pt-32 " >
11
+ < div className = "h-full " >
13
12
< ChatRoom />
14
13
</ div >
15
- < div className = "mt-10 flex items-center justify-center gap-4" >
16
- < TransferButton
17
- token = "0x187C0F98FEF80E87880Db50241D40551eDd027Bf"
18
- amount = "1000000000000000000"
19
- receiver = "0x637C1Ec1d205a4E7a79c9CE4Bd100CD1d19E6080"
20
- />
21
-
22
- < TransferButton
23
- amount = "1000000000000000000"
24
- receiver = "0x637C1Ec1d205a4E7a79c9CE4Bd100CD1d19E6080"
25
- />
26
- </ div >
27
14
</ div >
28
15
</ >
29
16
) ;
You can’t perform that action at this time.
0 commit comments