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

Message container #635

Merged
merged 23 commits into from
Aug 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
bb316e0
fix: added theme in msgbubble
KlausMikhaelson Aug 9, 2023
36639c1
fix: fixed import
mishramonalisha76 Aug 9, 2023
25c7965
fix: fixed message-list
mishramonalisha76 Aug 9, 2023
1f0ab88
fix: added approve intent
mishramonalisha76 Aug 9, 2023
072a8b4
fix: fixed socket groups
mishramonalisha76 Aug 10, 2023
a294c73
fix: added fixes
mishramonalisha76 Aug 10, 2023
537b793
fix: fixed message container bugs
mishramonalisha76 Aug 11, 2023
65a9ab3
fix: fixed socket bug
mishramonalisha76 Aug 11, 2023
ea88471
fix: fixed message from socket
mishramonalisha76 Aug 12, 2023
025cd5a
fix: fixed minor issues
mishramonalisha76 Aug 12, 2023
905bd59
fix: fixed typebar theming
KlausMikhaelson Aug 14, 2023
605c6ee
fix: fixed env issue
KlausMikhaelson Aug 14, 2023
c60d087
Merge pull request #638 from ethereum-push-notification-service/typeb…
0xNilesh Aug 14, 2023
f9e21dc
fix: fixed message not updating issue
KlausMikhaelson Aug 15, 2023
b262c42
refactor: added isConnected prop in msgContainer
0xNilesh Aug 15, 2023
fbdca8c
Merge branch 'feat/chat-components' into message-container
0xNilesh Aug 15, 2023
465b62b
refactor: resolve merge conflicts
0xNilesh Aug 15, 2023
c5304b4
fix: fixed request sending
mishramonalisha76 Aug 16, 2023
c03ee39
fix: merged with main
mishramonalisha76 Aug 16, 2023
3129e21
fix: fixed decryption
mishramonalisha76 Aug 16, 2023
e5b96a6
fix: fixed env issue
mishramonalisha76 Aug 16, 2023
3ce4d9b
refactor: resolved merge conflicts
0xNilesh Aug 16, 2023
2b8b0dc
feat: added profile header in message container
KlausMikhaelson Aug 16, 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
Expand Up @@ -35,6 +35,9 @@ const ChatUITest = () => {
<Link to="/messageList" className="nav-button">
MESSAGE LIST
</Link>
<Link to="/messageContainer" className="nav-button">
MESSAGE CONTAINER
</Link>
</NavMenu>
</Section>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export const MessageBubbles = () => {
}, [])

return (
<div style={{ height: "300px", width: "500px" }}>
<div style={{ height: "350px", width: "500px" }}>
{message.map((msg) => (
<MessageBubble chat={msg} />
))}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
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 { EnvContext, Web3Context } from '../context';
import { MessageContainer } from '@pushprotocol/uiweb';


const MessageContainerTest = () => {



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

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

<MessageContainer chatId='24b029b8e07e60291bf9d8c0c48ff993fa1e0a99105459f7404c425c92e91bac' limit={10}/>
</MessageContainerCard>
</div>
);
};

export default MessageContainerTest;


const MessageContainerCard = styled(Section)`
height:60vh;
`;
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,7 @@ const MessageListTest = () => {
const { account, pgpPrivateKey } = useContext<any>(Web3Context)

const { env } = useContext<any>(EnvContext);
const [conversationHash, setConversationHash] = useState<string>('');

const fetchConversationHash = async () => {
const ConversationHash = await PUSHAPI.chat.conversationHash({
account: `eip155:${account}`,
conversationId: '831b1d93f36fa2fce6c3d8c7c41c53335c82ad13cbe05478579af235f10716dc',
env: env
});
setConversationHash(ConversationHash.threadHash);
}
console.log(conversationHash)
useEffect(() => {
if (pgpPrivateKey) {
fetchConversationHash();
}
})


usePushChatSocket();
return (
Expand All @@ -37,8 +22,7 @@ const MessageListTest = () => {
{/* <Loader show={isLoading} /> */}

<MessageListCard >

<MessageList conversationHash={conversationHash} limit={10} isConnected={false} />
<MessageList chatId='0xe19c4b204a76db09697ea54c9182eba2195542aD' limit={10} />

</MessageListCard>
<TypeBar chatId='0xe19c4b204a76db09697ea54c9182eba2195542aD' isConnected={true} />
Expand All @@ -51,4 +35,5 @@ export default MessageListTest;

const MessageListCard = styled(Section)`
height:40vh;
background:black;
`;
13 changes: 8 additions & 5 deletions packages/examples/sdk-frontend-react/src/app/app.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useEffect, useMemo, useState } from 'react';
import { useContext, useEffect, useMemo, useState } from 'react';
import styled from 'styled-components';
import { Route, Routes, Link } from 'react-router-dom';
import { useWeb3React } from '@web3-react/core';
Expand Down Expand Up @@ -79,6 +79,7 @@ import {
import ChatUITest from './ChatUITest/ChatUITest';
import MessageListTest from './ChatUITest/MessageListTest';
import { MessageBubbles } from './ChatUITest/MessageBubbles';
import MessageContainerTest from './ChatUITest/MessageContainer';
import { ProfileHeaderTest } from './ChatUITest/ProfileHeader';
import { lightChatTheme } from '@pushprotocol/uiweb';

Expand Down Expand Up @@ -211,8 +212,7 @@ const checkForWeb3Data = ({

export function App() {
const { account, library, active, chainId } = useWeb3React();

const [env, setEnv] = useState<ENV>(ENV.DEV);
const [env, setEnv] = useState<ENV>(ENV.STAGING);
const [isCAIP, setIsCAIP] = useState(false);

const { SpaceWidgetComponent } = useSpaceComponents();
Expand Down Expand Up @@ -492,7 +492,11 @@ export function App() {
path="messageList"
element={<MessageListTest />}
/>
<Route
<Route
path="messageContainer"
element={<MessageContainerTest />}
/>
<Route
path="profileHeader"
element={<ProfileHeaderTest />}
/>
Expand All @@ -501,7 +505,6 @@ export function App() {
{/* <ChatWidgetTest /> */}
<SpaceWidgetComponent spaceId={spaceId} />
</SpacesUIProvider>

</ChatUIProvider>
</AccountContext.Provider>
</SocketContext.Provider>
Expand Down
Loading
Loading