Skip to content

Commit

Permalink
Fix connect button issue (#710)
Browse files Browse the repository at this point in the history
* fix: fixed connect button blocknative

* fix: fixed message fetching

* fix: removed console
  • Loading branch information
mishramonalisha76 authored Sep 14, 2023
1 parent 1f23464 commit 5021ca5
Show file tree
Hide file tree
Showing 9 changed files with 522 additions and 3,803 deletions.
9 changes: 4 additions & 5 deletions packages/uiweb/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,22 @@
"dependencies": {
"@livepeer/react": "^2.6.0",
"@pushprotocol/socket": "^0.5.0",
"@rainbow-me/rainbowkit": "^1.0.8",
"@unstoppabledomains/resolution": "^8.5.0",
"@web3-onboard/core": "^2.21.1",
"@web3-onboard/injected-wallets": "^2.10.5",
"@web3-onboard/react": "^2.8.11",
"@web3-onboard/react": "^2.8.9",
"@web3-onboard/walletconnect": "^2.4.6",
"@web3-react/injected-connector": "^6.0.7",
"date-fns": "^2.28.0",
"emoji-picker-react": "^4.4.9",
"ethers": "^5.6.8",
"font-awesome": "^4.7.0",
"gif-picker-react": "^1.1.0",
"html-react-parser": "^1.4.13",
"moment": "^2.29.4",
"react-icons": "^4.10.1",
"react-toastify": "^9.1.3",
"react-twitter-embed": "^4.0.4",
"wagmi": "^1.3.10",
"ethers": "^5.6.8"
"react-twitter-embed": "^4.0.4"
},
"peerDependencies": {
"@pushprotocol/restapi": "^1.2.15",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
formatFileSize,
getPfp,
pCAIP10ToWallet,
setPfp,
shortenText,
} from '../../../helpers';
import { checkTwitterUrl } from '../helpers/twitter';
Expand Down Expand Up @@ -40,7 +39,7 @@ const SenderMessageAddress = ({ chat }: { chat: IMessagePayload }) => {
);
};

const SenderMessafeProfilePicture = ({ chat }: { chat: IMessagePayload }) => {
const SenderMessageProfilePicture = ({ chat }: { chat: IMessagePayload }) => {
const { account, env } = useContext(ChatDataContext);
const [pfp, setPfp] = useState<string>('');
const getUserPfp = async () => {
Expand Down Expand Up @@ -74,6 +73,8 @@ const SenderMessafeProfilePicture = ({ chat }: { chat: IMessagePayload }) => {
);
};


//can create a wrapper for till the senderMessageAddress and use it for all cards(types of messages)
const MessageCard = ({
chat,
position,
Expand All @@ -94,7 +95,7 @@ const MessageCard = ({
width="fit-content"
maxWidth="70%"
>
{isGroup && <SenderMessafeProfilePicture chat={chat} />}
{isGroup && <SenderMessageProfilePicture chat={chat} />}
<Section justifyContent="start" flexDirection="column">
{isGroup && <SenderMessageAddress chat={chat} />}
<Section
Expand Down Expand Up @@ -194,7 +195,7 @@ const FileCard = ({
gap="6px"
width="fit-content"
>
{isGroup && <SenderMessafeProfilePicture chat={chat} />}
{isGroup && <SenderMessageProfilePicture chat={chat} />}
<Section flexDirection="column">
{isGroup && <SenderMessageAddress chat={chat} />}
<Section
Expand Down Expand Up @@ -247,7 +248,7 @@ const ImageCard = ({
}) => {
return (
<Section flexDirection="row" justifyContent="start" gap="6px">
{isGroup && <SenderMessafeProfilePicture chat={chat} />}
{isGroup && <SenderMessageProfilePicture chat={chat} />}
<Section justifyContent="start" flexDirection="column">
{isGroup && <SenderMessageAddress chat={chat} />}
<Section
Expand Down Expand Up @@ -286,7 +287,7 @@ const GIFCard = ({
gap="6px"
width="fit-content"
>
{isGroup && <SenderMessafeProfilePicture chat={chat} />}
{isGroup && <SenderMessageProfilePicture chat={chat} />}
<Section justifyContent="start" flexDirection="column">
{isGroup && <SenderMessageAddress chat={chat} />}
<Section
Expand Down Expand Up @@ -327,7 +328,7 @@ const TwitterCard = ({
gap="6px"
width="fit-content"
>
{isGroup && <SenderMessafeProfilePicture chat={chat} />}
{isGroup && <SenderMessageProfilePicture chat={chat} />}
<Section justifyContent="start" flexDirection="column">
{isGroup && <SenderMessageAddress chat={chat} />}
<Section
Expand All @@ -344,7 +345,7 @@ const TwitterCard = ({
};

export const ChatViewBubble = ({ chat }: { chat: IMessagePayload }) => {
const { account, setAccount, pgpPrivateKey, setPgpPrivateKey, env, setEnv } =
const { account} =
useChatData();
const position =
pCAIP10ToWallet(chat.fromDID).toLowerCase() !== account?.toLowerCase()
Expand All @@ -366,11 +367,7 @@ export const ChatViewBubble = ({ chat }: { chat: IMessagePayload }) => {
}
}, [chat.toDID, isGroup]);

// useEffect(() => {
// setAccount("");
// setPgpPrivateKey("");
// setEnv(env);
// }, [account, env, pgpPrivateKey])


if (messageType === 'TwitterFeedLink') {
chat.messageType = 'TwitterFeedLink';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { IFeeds } from '@pushprotocol/restapi';
import { ThemeContext } from '../theme/ThemeProvider';
import { Dispatch, useContext } from 'react';
import { Div, Section, Span, Spinner } from '../../reusables';
import { Section, Span, Spinner } from '../../reusables';
import useApproveChatRequest from '../../../hooks/chat/useApproveChatRequest';
import { useChatData } from '../../../hooks';
import { TickSvg } from '../../../icons/Tick';
import styled from 'styled-components';
import { IChatTheme } from '../theme';

Expand All @@ -21,17 +20,19 @@ export interface IApproveRequestBubbleProps {
setChatFeed: Dispatch<IFeeds>;
}


export const ApproveRequestBubble = ({
chatFeed,
chatId,
setChatFeed,
}: IApproveRequestBubbleProps) => {
const { account, pgpPrivateKey, env } = useChatData();
const { pgpPrivateKey } = useChatData();

const ApproveRequestText = {
GROUP: `You were invited to the group ${chatFeed?.groupInformation?.groupName}. Please accept to continue messaging in this group.`,
W2W: ` Please accept to enable push chat from this wallet`,
};

const theme = useContext(ThemeContext);
const { approveChatRequest, loading: approveLoading } =
useApproveChatRequest();
Expand Down Expand Up @@ -88,13 +89,7 @@ export const ApproveRequestBubble = ({
>
{approveLoading ? <Spinner color="#fff" size="24" /> : 'Accept'}
</Button>
{/* <Div
width="auto"
cursor="pointer"
onClick={() => (!approveLoading ? handleApproveChatRequest() : null)}
>
{approveLoading ? <Spinner /> : <TickSvg />}
</Div> */}

</Section>
);
};
Expand Down
Loading

0 comments on commit 5021ca5

Please sign in to comment.