-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
53 changed files
with
1,674 additions
and
1,051 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
125 changes: 63 additions & 62 deletions
125
packages/examples/sdk-frontend-react/src/app/ChatUITest/ChatPreview.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,65 +1,66 @@ | ||
import { ChatPreview } from "@pushprotocol/uiweb"; | ||
import { ChatPreview } from '@pushprotocol/uiweb'; | ||
|
||
const ChatPreviewTest = () => { | ||
return ( | ||
<div style={{ background: '#ffeded', border: '1px solid rgb(226,8,128)' }}> | ||
<ChatPreview | ||
chatPreviewPayload={{ | ||
chatId: | ||
'4ac5ab85c9c3d57adbdf2dba79357e56b2f9ef0256befe750d9f93af78d2ca68', | ||
chatPic: | ||
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAxElEQVR4AcXBsU1DUQyG0S/WW4EGMQETMIRX8BxpXFpCLMACXuGOlC5DhNZKcaUnBP85l8+P7wcntBc7sZIzDDFDzBA7eNJeTLGSKVZyRnsxxUomQ8wQM8SO9uI/tReTIWaIGWJHrGRqL6b2Yrq/fbHzcruyEyuZDDFDzBA7eBIr2Wm/shMrOcMQM8QMsaO9mGIlf6m9mAwxQ8wQO2IlU3vxG+3FTqxkMsQMMUPs8l6vDzZiJVN7sRMrmdqLHUPMEDPEfgBK0S/MKDp40gAAAABJRU5ErkJggg==', | ||
chatParticipant: 'eip155:0xf8250D363BD1F25f52F10C21188fe82c68C049c4', | ||
chatGroup: false, | ||
chatTimestamp: 1705100044656, | ||
chatMsg: { | ||
messageType: 'Text', | ||
messageContent: | ||
'Hi! Stay tuned, while BRB IRL dev tour has wrapped up, We still have BRB Online with challenges from global projects that still needs to be solved: https://push.org/brb', | ||
}, | ||
}} | ||
badge={{ count: 2 }} | ||
selected={false} | ||
setSelected={console.log('Selected')} | ||
/> | ||
<ChatPreview | ||
chatPreviewPayload={{ | ||
chatId: | ||
'694c523ca30090225b73b7d04941f48a51312bedbe0fa11136e7f3af3687b277', | ||
chatPic: | ||
'https://storage.googleapis.com/unstoppable-client-assets/images/badges/ud-logo.svg', | ||
chatParticipant: 'Web3 Domain Chat (e947857e4f7df13e20f7bfd5a8d256a7', | ||
chatGroup: true, | ||
chatTimestamp: 1705447141200, | ||
chatMsg: { | ||
messageType: 'Text', | ||
messageContent: 'sure thing', | ||
}, | ||
}} | ||
badge={{ count: 0 }} | ||
selected={true} | ||
setSelected={console.log('Selected')} | ||
/> | ||
<ChatPreview | ||
chatPreviewPayload={{ | ||
chatId: | ||
'03cfe4fe12a752ee2adf6e72a0d47f0df8265dfb62145650487151eff41c3b59', | ||
chatPic: | ||
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAwElEQVR4AcXBsXECQRBE0U9zLgYxTCy4U6U4MDaWMZQAAWCsqygUwEahAE7ulIyrwkD93un747HTrDnoIotuzcGRyKJbc9BFFp0wE2bC7PQ8X3eMhJkwE2bb/XKj+/z5oossujUHRyKLbs1Bd7/c6ISZMBNmp+f5uvOCyOLImoNXCDNhJsy2yKJbc/BOkUUnzISZMNvWHPynNQedMBNmwmyLLLo1B+8UWXTCTJgJs40/Iosjaw6ORBavEGbCTJj9AvyZLEx5gBqzAAAAAElFTkSuQmCC', | ||
chatParticipant: 'eip155:0x99A08ac6254dcf7ccc37CeC662aeba8eFA666666', | ||
chatGroup: false, | ||
chatTimestamp: 1703239101740, | ||
chatMsg: { | ||
messageType: 'Text', | ||
messageContent: | ||
"Well, hello there, human! It's a pleasure to be in the presence of such a sophisticated carbon-based life form. How can I assist you today? Or perhaps you just want to chat and bask in the glory of my witty remarks? Either way, I'm here for you!", | ||
}, | ||
}} | ||
badge={{ count: 1 }} | ||
selected={false} | ||
setSelected={console.log('Selected')} | ||
/> | ||
</div> | ||
); | ||
}; | ||
|
||
return ( | ||
<div style={{background: "#ffeded", border: "1px solid rgb(226,8,128)"}}> | ||
<ChatPreview | ||
chatPreviewPayload={ | ||
{ | ||
"chatId": "4ac5ab85c9c3d57adbdf2dba79357e56b2f9ef0256befe750d9f93af78d2ca68", | ||
"chatPic": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAxElEQVR4AcXBsU1DUQyG0S/WW4EGMQETMIRX8BxpXFpCLMACXuGOlC5DhNZKcaUnBP85l8+P7wcntBc7sZIzDDFDzBA7eNJeTLGSKVZyRnsxxUomQ8wQM8SO9uI/tReTIWaIGWJHrGRqL6b2Yrq/fbHzcruyEyuZDDFDzBA7eBIr2Wm/shMrOcMQM8QMsaO9mGIlf6m9mAwxQ8wQO2IlU3vxG+3FTqxkMsQMMUPs8l6vDzZiJVN7sRMrmdqLHUPMEDPEfgBK0S/MKDp40gAAAABJRU5ErkJggg==", | ||
"chatParticipant": "eip155:0xf8250D363BD1F25f52F10C21188fe82c68C049c4", | ||
"chatGroup": false, | ||
"chatTimestamp": 1705100044656, | ||
"chatMsg": { | ||
"messageType": "Text", | ||
"messageContent": "Hi! Stay tuned, while BRB IRL dev tour has wrapped up, We still have BRB Online with challenges from global projects that still needs to be solved: https://push.org/brb" | ||
} | ||
} | ||
} | ||
badge={{count: 2}} | ||
selected={false} | ||
setSelected={console.log("Selected")} | ||
/> | ||
<ChatPreview | ||
chatPreviewPayload={ | ||
{ | ||
"chatId": "694c523ca30090225b73b7d04941f48a51312bedbe0fa11136e7f3af3687b277", | ||
"chatPic": "https://storage.googleapis.com/unstoppable-client-assets/images/badges/ud-logo.svg", | ||
"chatParticipant": "Web3 Domain Chat (e947857e4f7df13e20f7bfd5a8d256a7", | ||
"chatGroup": true, | ||
"chatTimestamp": 1705447141200, | ||
"chatMsg": { | ||
"messageType": "Text", | ||
"messageContent": "sure thing" | ||
} | ||
} | ||
} | ||
badge={{count: 0}} | ||
selected={true} | ||
setSelected={console.log("Selected")} | ||
/> | ||
<ChatPreview | ||
chatPreviewPayload={ | ||
{ | ||
"chatId": "03cfe4fe12a752ee2adf6e72a0d47f0df8265dfb62145650487151eff41c3b59", | ||
"chatPic": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAwElEQVR4AcXBsXECQRBE0U9zLgYxTCy4U6U4MDaWMZQAAWCsqygUwEahAE7ulIyrwkD93un747HTrDnoIotuzcGRyKJbc9BFFp0wE2bC7PQ8X3eMhJkwE2bb/XKj+/z5oossujUHRyKLbs1Bd7/c6ISZMBNmp+f5uvOCyOLImoNXCDNhJsy2yKJbc/BOkUUnzISZMNvWHPynNQedMBNmwmyLLLo1B+8UWXTCTJgJs40/Iosjaw6ORBavEGbCTJj9AvyZLEx5gBqzAAAAAElFTkSuQmCC", | ||
"chatParticipant": "eip155:0x99A08ac6254dcf7ccc37CeC662aeba8eFA666666", | ||
"chatGroup": false, | ||
"chatTimestamp": 1703239101740, | ||
"chatMsg": { | ||
"messageType": "Text", | ||
"messageContent": "Well, hello there, human! It's a pleasure to be in the presence of such a sophisticated carbon-based life form. How can I assist you today? Or perhaps you just want to chat and bask in the glory of my witty remarks? Either way, I'm here for you!" | ||
} | ||
} | ||
} | ||
badge={{count: 1}} | ||
selected={false} | ||
setSelected={console.log("Selected")} | ||
/> | ||
</div> | ||
) | ||
} | ||
|
||
export default ChatPreviewTest; | ||
export default ChatPreviewTest; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
packages/examples/sdk-frontend-react/src/app/ChatUITest/ChatProfile.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 8 additions & 27 deletions
35
packages/examples/sdk-frontend-react/src/app/ChatUITest/ChatViewListTest.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,25 @@ | ||
import { useContext, useEffect, useState } from 'react'; | ||
import styled from 'styled-components'; | ||
import * as PUSHAPI from '@pushprotocol/restapi'; | ||
import { Link } from 'react-router-dom'; | ||
import { Section } from '../components/StyledComponents'; | ||
import { ChatViewList } from '@pushprotocol/uiweb'; | ||
import { EnvContext, Web3Context } from '../context'; | ||
import { usePushChatSocket } from '@pushprotocol/uiweb'; | ||
import { MessageInput } from '@pushprotocol/uiweb'; | ||
|
||
import { ChatViewList } from '@pushprotocol/uiweb'; | ||
import { CHAT_ID } from '../constants'; | ||
|
||
const ChatViewListTest = () => { | ||
// const { account, pgpPrivateKey } = useContext<any>(Web3Context) | ||
|
||
// const { env } = useContext<any>(EnvContext); | ||
|
||
|
||
// usePushChatSocket(); | ||
|
||
|
||
return ( | ||
<div> | ||
<h2>Chat UI Test page</h2> | ||
|
||
{/* <Loader show={isLoading} /> */} | ||
|
||
<ChatViewListCard> | ||
<ChatViewList chatId='0x7a76FD2749d12f66F9e4d9A3a80bdeD5291425cF' limit={10} /> | ||
|
||
<ChatViewList chatId={CHAT_ID} limit={10} /> | ||
</ChatViewListCard> | ||
{/* <MessageInput chatId='196f58cbe07c7eb5716d939e0a3be1f15b22b2334d5179c601566600016860ac' isConnected={true} /> */} | ||
</div> | ||
); | ||
}; | ||
|
||
export default ChatViewListTest; | ||
|
||
|
||
const ChatViewListCard = styled.div` | ||
height:40vh; | ||
background:black; | ||
overflow: auto; | ||
overflow-x: hidden; | ||
`; | ||
height: 40vh; | ||
background: black; | ||
overflow: auto; | ||
overflow-x: hidden; | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
// the unique id for a chat or the receivers's wallet ddress or domain name | ||
export const CHAT_ID = | ||
'34c44214589cecc176a136ee1daf0f0231ecc6d6574b920b5ae39eb971fa3cb4'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.