Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/chat components #658

Merged
merged 34 commits into from
Aug 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
51348e1
feat: created architechture
mishramonalisha76 Aug 2, 2023
ec9485f
fix: added context values (#594)
mishramonalisha76 Aug 2, 2023
5a3c3c9
Chat dataprovider (#596)
KlausMikhaelson Aug 2, 2023
ce78524
fix: added test page for chat ui components (#597)
mishramonalisha76 Aug 2, 2023
ef37fb9
added chatbubble component (#602)
KlausMikhaelson Aug 3, 2023
a9c0a25
fix: added theme
mishramonalisha76 Aug 3, 2023
0f7f1b3
Group chat bubble (#604)
KlausMikhaelson Aug 7, 2023
eb71bbc
feat: adding pfp in text bubbles
KlausMikhaelson Aug 8, 2023
59d034c
fix: replaced hook with function and added pfp to messagebubble
KlausMikhaelson Aug 8, 2023
e85ba71
fix: fixed image alignment
KlausMikhaelson Aug 8, 2023
bba5642
fix: changed border-radius of msg bubble and changed function name
KlausMikhaelson Aug 8, 2023
120a52d
fix: fixed theme and decryptedPrivateKey name (#616)
mishramonalisha76 Aug 8, 2023
90c4421
Merge pull request #617 from ethereum-push-notification-service/pfp-c…
KlausMikhaelson Aug 8, 2023
ad8459c
Message list (#615)
mishramonalisha76 Aug 8, 2023
b374b0a
fix: added theme in msgbubble (#620)
KlausMikhaelson Aug 9, 2023
a9a979e
fix: exported the theme (#623)
KlausMikhaelson Aug 9, 2023
a0d7c18
fix: fixed merge conflicts
mishramonalisha76 Aug 10, 2023
4b1ea94
Typebar component (#631)
KlausMikhaelson Aug 11, 2023
4193fd6
feat: added connectbutton
KlausMikhaelson Aug 13, 2023
bacce52
fix: fixed connectbtn ui and remove disconnect and fixed error on dis…
KlausMikhaelson Aug 15, 2023
fc922c7
fix: fixed create account getting called twice
KlausMikhaelson Aug 15, 2023
81612d6
Merge pull request #637 from ethereum-push-notification-service/conne…
KlausMikhaelson Aug 15, 2023
b21bdb1
Profile Header Component (#636)
corlard3y Aug 16, 2023
f0b313c
Message container (#635)
mishramonalisha76 Aug 16, 2023
4936657
fix: updated svg to react component
0xNilesh Aug 16, 2023
b793e09
fix: changed svg to tsx component
KlausMikhaelson Aug 16, 2023
42ca5c9
refactor: merge conflicts
0xNilesh Aug 16, 2023
2862dc7
fix: fixed review changes (#646)
mishramonalisha76 Aug 17, 2023
4b5e41b
fix: merged with main
mishramonalisha76 Aug 17, 2023
933a361
Profile Header -> Chat Profile fixes (#647)
corlard3y Aug 17, 2023
77e17f4
fix: resolved package not added issue
0xNilesh Aug 17, 2023
39c7fe2
Fix: modal issue in group info && alert remove members (#653)
corlard3y Aug 17, 2023
5a577c6
fix: QA fixes (#654)
corlard3y Aug 17, 2023
c4a2013
refactor: resolved merge conflicts
0xNilesh Aug 18, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { ChatProfile } from "@pushprotocol/uiweb";

export const ChatProfileTest = () => {

return (
<div>
<ChatProfile
// chatId='0x455E5AA18469bC6ccEF49594645666C587A3a71B'
chatId='24b029b8e07e60291bf9d8c0c48ff993fa1e0a99105459f7404c425c92e91bac'
// chatId='36baf37e441fdd94e23406c6c716fc4e91a93a9ee68e070cd5b054534dbe09a6'
style="Info"
/>
</div>
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,17 @@ const ChatUITest = () => {

<Section>
<NavMenu>
<Link to="/ChatProfile" className="nav-button">
CHAT PROFILE
</Link>
<Link to="/messageBubble" className="nav-button">
CHAT BUBBLE
</Link>
<Link to="/messageList" className="nav-button">
MESSAGE LIST
CHAT VIEW LIST
</Link>
<Link to="/messageContainer" className="nav-button">
CHAT VIEW COMPONENT
</Link>
</NavMenu>
</Section>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import { MessageBubble } from "@pushprotocol/uiweb";
import { ChatViewBubble } from "@pushprotocol/uiweb";
import { useEffect, useContext, useState } from "react";
import { EnvContext, Web3Context } from "../context";
import * as PUSHAPI from "@pushprotocol/restapi"
import { ENV } from "@pushprotocol/uiweb";
import { IMessagePayload } from "@pushprotocol/uiweb";

export const MessageBubbles = () => {
export const ChatViewBubbles = () => {
const { env } = useContext<any>(EnvContext);

const { library, account } = useContext<any>(Web3Context)
const [message, setMessage] = useState<IMessagePayload[]>([])
const [ conversationHash , setConversationHash] = useState<string>('');
const [conversationHash, setConversationHash] = useState<string>('');

const librarySigner = library.getSigner()

Expand All @@ -26,32 +26,32 @@ export const MessageBubbles = () => {

const ConversationHash = await PUSHAPI.chat.conversationHash({
account: `eip155:${account}`,
conversationId: '24b029b8e07e60291bf9d8c0c48ff993fa1e0a99105459f7404c425c92e91bac',
conversationId: '831b1d93f36fa2fce6c3d8c7c41c53335c82ad13cbe05478579af235f10716dc',
env: env
});
setConversationHash(ConversationHash.threadHash);
if(ConversationHash?.threadHash){
const chatHistory = await PUSHAPI.chat.history({
threadhash: conversationHash,
account: account,
limit: 10,
toDecrypt: true,
pgpPrivateKey: pgpPrivateKey ? pgpPrivateKey : undefined,
env: env
})
setMessage(chatHistory)
console.log(chatHistory)
}
if (ConversationHash?.threadHash) {
const chatHistory = await PUSHAPI.chat.history({
threadhash: conversationHash,
account: account,
limit: 10,
toDecrypt: true,
pgpPrivateKey: pgpPrivateKey ? pgpPrivateKey : undefined,
env: env
})
setMessage(chatHistory)
console.log(chatHistory)
}
}

useEffect(() => {
fetchMessage()
}, [])

return (
<div style={{ height: "300px", width: "500px" }}>
<div style={{ height: "350px", width: "500px" }}>
{message.map((msg) => (
<MessageBubble chat={msg} />
<ChatViewBubble chat={msg} />
))}
</div>
)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import styled from 'styled-components';

import { Section } from '../components/StyledComponents';

import { ChatViewComponent } from '@pushprotocol/uiweb';


const ChatViewComponentTest = () => {



return (
<div>
<h2>Chat UI Test page</h2>

{/* <Loader show={isLoading} /> */}
<ChatViewComponentCard>

<ChatViewComponent chatId='0xCD0DAdAb45bAF9a06ce1279D1342EcC3F44845af' limit={10}/>
</ChatViewComponentCard>
</div>
);
};

export default ChatViewComponentTest;


const ChatViewComponentCard = styled(Section)`
height:60vh;
`;
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
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';

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='0xe19c4b204a76db09697ea54c9182eba2195542aD' limit={10} />

</ChatViewListCard>
<MessageInput chatId='0xe19c4b204a76db09697ea54c9182eba2195542aD' isConnected={true} />
</div>
);
};

export default ChatViewListTest;


const ChatViewListCard = styled(Section)`
height:40vh;
background:black;
`;

This file was deleted.

Loading
Loading