diff --git a/packages/uiweb/package.json b/packages/uiweb/package.json index 959f43531..86bd7905c 100644 --- a/packages/uiweb/package.json +++ b/packages/uiweb/package.json @@ -34,7 +34,7 @@ "uuid": "^9.0.1" }, "peerDependencies": { - "@pushprotocol/restapi": "0.0.1-alpha.80", + "@pushprotocol/restapi": "1.7.13", "@pushprotocol/socket": "^0.5.0", "react": ">=16.8.0", "styled-components": "^6.0.8" diff --git a/packages/uiweb/src/lib/components/chat/ChatViewBubble/ChatViewBubble.tsx b/packages/uiweb/src/lib/components/chat/ChatViewBubble/ChatViewBubble.tsx index f1702b277..49a4afe39 100644 --- a/packages/uiweb/src/lib/components/chat/ChatViewBubble/ChatViewBubble.tsx +++ b/packages/uiweb/src/lib/components/chat/ChatViewBubble/ChatViewBubble.tsx @@ -19,7 +19,7 @@ import { IMessagePayload, TwitterFeedReturnType } from '../exportedTypes'; const SenderMessageAddress = ({ chat }: { chat: IMessagePayload }) => { const { user } = useContext(ChatDataContext); const theme = useContext(ThemeContext); - return chat.fromCAIP10?.split(':')[1] !== user?.account ? ( + return chat.fromCAIP10 !== user?.account ? ( { justifyContent="start" alignItems="start" > - {chat.fromCAIP10?.split(':')[1] !== user?.account && ( + {chat.fromCAIP10 !== user?.account && (
{pfp && ( { + const { user } = useChatData(); const theme = useContext(ThemeContext); return (
- {isGroup && } + {isGroup && chat?.fromCAIP10 !== user?.account && }
- {isGroup && } + {isGroup && chat?.fromCAIP10 !== user?.account && } {children}
@@ -322,11 +323,12 @@ export const ChatViewBubble = ({ }) => { const { user } = useChatData(); const position = - pCAIP10ToWallet(decryptedMessagePayload.fromDID).toLowerCase() !== user?.account?.toLowerCase() ? 0 : 1; + pCAIP10ToWallet(decryptedMessagePayload.fromDID).toLowerCase() !== pCAIP10ToWallet(user?.account!)?.toLowerCase() + ? 0 + : 1; const { tweetId, messageType }: TwitterFeedReturnType = checkTwitterUrl({ message: decryptedMessagePayload?.messageContent, }); - if (messageType === 'TwitterFeedLink') { decryptedMessagePayload.messageType = 'TwitterFeedLink'; } diff --git a/packages/uiweb/src/lib/components/chat/ChatViewList/ChatViewList.tsx b/packages/uiweb/src/lib/components/chat/ChatViewList/ChatViewList.tsx index a5461664e..00baab89c 100644 --- a/packages/uiweb/src/lib/components/chat/ChatViewList/ChatViewList.tsx +++ b/packages/uiweb/src/lib/components/chat/ChatViewList/ChatViewList.tsx @@ -394,7 +394,9 @@ export const ChatViewList: React.FC = (options: IChatViewLis const dateNum = moment(chat.timestamp).format('L'); // TODO: This is a hack as chat.fromDID is converted with eip to match with user.account creating a bug for omnichain const position = - pCAIP10ToWallet(chat.fromDID)?.toLowerCase() !== user?.account?.toLowerCase() ? 0 : 1; + pCAIP10ToWallet(chat.fromDID)?.toLowerCase() !== pCAIP10ToWallet(user?.account!)?.toLowerCase() + ? 0 + : 1; return ( <> {dates.has(dateNum) ? null : renderDate({ chat, dateNum })} diff --git a/packages/uiweb/src/lib/components/chat/CreateGroup/AddCriteria.tsx b/packages/uiweb/src/lib/components/chat/CreateGroup/AddCriteria.tsx index 6f564ec87..87a3d811a 100644 --- a/packages/uiweb/src/lib/components/chat/CreateGroup/AddCriteria.tsx +++ b/packages/uiweb/src/lib/components/chat/CreateGroup/AddCriteria.tsx @@ -241,7 +241,7 @@ const AddCriteria = ({ handlePrevious, onClose, criteriaStateManager }: ModalHea function: () => setSelectedChainValue(6), } as DropdownValueType); } - + console.debug(dropdownChainsValues); const onQuantityChange = (e: any) => { setQuantity({ ...quantity, value: e.target.value }); }; @@ -263,6 +263,7 @@ const AddCriteria = ({ handlePrevious, onClose, criteriaStateManager }: ModalHea } } + console.debug(selectedChainValue); const rule: Rule = { type: _type, category: category, diff --git a/packages/uiweb/src/lib/components/chat/MessageInput/MessageInput.tsx b/packages/uiweb/src/lib/components/chat/MessageInput/MessageInput.tsx index 658c63127..adec52c20 100644 --- a/packages/uiweb/src/lib/components/chat/MessageInput/MessageInput.tsx +++ b/packages/uiweb/src/lib/components/chat/MessageInput/MessageInput.tsx @@ -291,7 +291,7 @@ export const MessageInput: React.FC = ({ } } else { const sendTextMessage = await sendMessage({ - message: `Hello, please let me join this group, my wallet address is ${user?.account}`, + message: `Hello, please let me join this group, my wallet address is ${pCAIP10ToWallet(user?.account || '')}`, chatId: groupInfo?.groupCreator || '', messageType: 'Text', }); diff --git a/packages/uiweb/src/lib/components/chat/UserProfile/UserProfile.tsx b/packages/uiweb/src/lib/components/chat/UserProfile/UserProfile.tsx index b15cb0d83..4e6c6e445 100644 --- a/packages/uiweb/src/lib/components/chat/UserProfile/UserProfile.tsx +++ b/packages/uiweb/src/lib/components/chat/UserProfile/UserProfile.tsx @@ -5,7 +5,7 @@ import { IUser } from '@pushprotocol/restapi'; import { ethers } from 'ethers'; import styled from 'styled-components'; -import { resolveWeb3Name, shortenText } from '../../../helpers'; +import { pCAIP10ToWallet, resolveWeb3Name, shortenText } from '../../../helpers'; import { useClickAway } from '../../../hooks'; import { useChatData } from '../../../hooks/chat/useChatData'; import useChatProfile from '../../../hooks/chat/useChatProfile'; @@ -81,76 +81,76 @@ export const UserProfile: React.FC = ({ return ( + - + {userProfile && ( +
+ setOptions(true)} + /> +
+ )} + {options && ( + - {userProfile && ( -
+ ref={DropdownRef} + onClick={() => setShowUpdateUserProfileModal(true)} + > + setOptions(true)} /> -
- )} - {options && ( - setShowUpdateUserProfileModal(true)} - > - - - Edit Profile - - + Edit Profile + +
+ )} + {showUpdateUserProfileModal && + createPortal( + , + document.body )} - {showUpdateUserProfileModal && - createPortal( - , - document.body - )} -
+ ); };