Skip to content

Commit a7da803

Browse files
fix: pulled main
2 parents 5f72e2f + 3655f6e commit a7da803

File tree

6 files changed

+78
-73
lines changed

6 files changed

+78
-73
lines changed

packages/uiweb/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"uuid": "^9.0.1"
3535
},
3636
"peerDependencies": {
37-
"@pushprotocol/restapi": "0.0.1-alpha.80",
37+
"@pushprotocol/restapi": "1.7.13",
3838
"@pushprotocol/socket": "^0.5.0",
3939
"react": ">=16.8.0",
4040
"styled-components": "^6.0.8"

packages/uiweb/src/lib/components/chat/ChatViewBubble/ChatViewBubble.tsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import { IMessagePayload, TwitterFeedReturnType } from '../exportedTypes';
1919
const SenderMessageAddress = ({ chat }: { chat: IMessagePayload }) => {
2020
const { user } = useContext(ChatDataContext);
2121
const theme = useContext(ThemeContext);
22-
return chat.fromCAIP10?.split(':')[1] !== user?.account ? (
22+
return chat.fromCAIP10 !== user?.account ? (
2323
<Span
2424
theme={theme}
2525
alignSelf="start"
@@ -55,7 +55,7 @@ const SenderMessageProfilePicture = ({ chat }: { chat: IMessagePayload }) => {
5555
justifyContent="start"
5656
alignItems="start"
5757
>
58-
{chat.fromCAIP10?.split(':')[1] !== user?.account && (
58+
{chat.fromCAIP10 !== user?.account && (
5959
<Section alignItems="start">
6060
{pfp && (
6161
<Image
@@ -83,6 +83,7 @@ const MessageWrapper = ({
8383
isGroup: boolean;
8484
maxWidth?: string;
8585
}) => {
86+
const { user } = useChatData();
8687
const theme = useContext(ThemeContext);
8788
return (
8889
<Section
@@ -93,12 +94,12 @@ const MessageWrapper = ({
9394
width="fit-content"
9495
maxWidth={maxWidth || 'auto'}
9596
>
96-
{isGroup && <SenderMessageProfilePicture chat={chat} />}
97+
{isGroup && chat?.fromCAIP10 !== user?.account && <SenderMessageProfilePicture chat={chat} />}
9798
<Section
9899
justifyContent="start"
99100
flexDirection="column"
100101
>
101-
{isGroup && <SenderMessageAddress chat={chat} />}
102+
{isGroup && chat?.fromCAIP10 !== user?.account && <SenderMessageAddress chat={chat} />}
102103
{children}
103104
</Section>
104105
</Section>
@@ -322,11 +323,12 @@ export const ChatViewBubble = ({
322323
}) => {
323324
const { user } = useChatData();
324325
const position =
325-
pCAIP10ToWallet(decryptedMessagePayload.fromDID).toLowerCase() !== user?.account?.toLowerCase() ? 0 : 1;
326+
pCAIP10ToWallet(decryptedMessagePayload.fromDID).toLowerCase() !== pCAIP10ToWallet(user?.account!)?.toLowerCase()
327+
? 0
328+
: 1;
326329
const { tweetId, messageType }: TwitterFeedReturnType = checkTwitterUrl({
327330
message: decryptedMessagePayload?.messageContent,
328331
});
329-
330332
if (messageType === 'TwitterFeedLink') {
331333
decryptedMessagePayload.messageType = 'TwitterFeedLink';
332334
}

packages/uiweb/src/lib/components/chat/ChatViewList/ChatViewList.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,9 @@ export const ChatViewList: React.FC<IChatViewListProps> = (options: IChatViewLis
394394
const dateNum = moment(chat.timestamp).format('L');
395395
// TODO: This is a hack as chat.fromDID is converted with eip to match with user.account creating a bug for omnichain
396396
const position =
397-
pCAIP10ToWallet(chat.fromDID)?.toLowerCase() !== user?.account?.toLowerCase() ? 0 : 1;
397+
pCAIP10ToWallet(chat.fromDID)?.toLowerCase() !== pCAIP10ToWallet(user?.account!)?.toLowerCase()
398+
? 0
399+
: 1;
398400
return (
399401
<>
400402
{dates.has(dateNum) ? null : renderDate({ chat, dateNum })}

packages/uiweb/src/lib/components/chat/CreateGroup/AddCriteria.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ const AddCriteria = ({ handlePrevious, onClose, criteriaStateManager }: ModalHea
241241
function: () => setSelectedChainValue(6),
242242
} as DropdownValueType);
243243
}
244-
244+
console.debug(dropdownChainsValues);
245245
const onQuantityChange = (e: any) => {
246246
setQuantity({ ...quantity, value: e.target.value });
247247
};
@@ -263,6 +263,7 @@ const AddCriteria = ({ handlePrevious, onClose, criteriaStateManager }: ModalHea
263263
}
264264
}
265265

266+
console.debug(selectedChainValue);
266267
const rule: Rule = {
267268
type: _type,
268269
category: category,

packages/uiweb/src/lib/components/chat/MessageInput/MessageInput.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ export const MessageInput: React.FC<MessageInputProps> = ({
291291
}
292292
} else {
293293
const sendTextMessage = await sendMessage({
294-
message: `Hello, please let me join this group, my wallet address is ${user?.account}`,
294+
message: `Hello, please let me join this group, my wallet address is ${pCAIP10ToWallet(user?.account || '')}`,
295295
chatId: groupInfo?.groupCreator || '',
296296
messageType: 'Text',
297297
});

packages/uiweb/src/lib/components/chat/UserProfile/UserProfile.tsx

Lines changed: 63 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { IUser } from '@pushprotocol/restapi';
55
import { ethers } from 'ethers';
66
import styled from 'styled-components';
77

8-
import { resolveWeb3Name, shortenText } from '../../../helpers';
8+
import { pCAIP10ToWallet, resolveWeb3Name, shortenText } from '../../../helpers';
99
import { useClickAway } from '../../../hooks';
1010
import { useChatData } from '../../../hooks/chat/useChatData';
1111
import useChatProfile from '../../../hooks/chat/useChatProfile';
@@ -81,76 +81,76 @@ export const UserProfile: React.FC<UserProfileProps> = ({
8181

8282
return (
8383
<Conatiner
84-
height="inherit"
85-
justifyContent="space-between"
86-
overflow="hidden"
87-
width="100%"
88-
padding="14px 10px"
89-
borderRadius={theme?.borderRadius?.userProfile}
90-
background={theme?.backgroundColor?.userProfileBackground}
84+
height="inherit"
85+
justifyContent="space-between"
86+
overflow="hidden"
87+
width="100%"
88+
padding="14px 10px"
89+
borderRadius={theme?.borderRadius?.userProfile}
90+
background={theme?.backgroundColor?.userProfileBackground}
91+
theme={theme}
92+
>
93+
<ProfileContainer
9194
theme={theme}
92-
>
93-
<ProfileContainer
95+
member={{
96+
web3Name: web3Name,
97+
abbrRecipient: shortenText(pCAIP10ToWallet(user?.account || ''), 8, true) as string,
98+
recipient: user!.account,
99+
icon: userProfile?.profile?.picture || null,
100+
}}
101+
copy={true}
102+
customStyle={{
103+
fontSize: theme?.fontSize?.userProfileText,
104+
fontWeight: theme?.fontWeight?.userProfileText,
105+
textColor: theme?.textColor?.userProfileText,
106+
}}
107+
loading={!userProfile ? true : false}
108+
/>
109+
{userProfile && (
110+
<Section>
111+
<Image
112+
src={VerticalEllipsisIcon}
113+
height="21px"
114+
maxHeight="21px"
115+
color={theme?.iconColor?.userProfileSettings}
116+
width={'auto'}
117+
cursor="pointer"
118+
onClick={() => setOptions(true)}
119+
/>
120+
</Section>
121+
)}
122+
{options && (
123+
<DropDownBar
94124
theme={theme}
95-
member={{
96-
web3Name: web3Name,
97-
abbrRecipient: shortenText(user?.account || '', 8, true) as string,
98-
recipient: user!.account,
99-
icon: userProfile?.profile?.picture || null,
100-
}}
101-
copy={true}
102-
customStyle={{
103-
fontSize: theme?.fontSize?.userProfileText,
104-
fontWeight: theme?.fontWeight?.userProfileText,
105-
textColor: theme?.textColor?.userProfileText,
106-
}}
107-
loading={!userProfile ? true : false}
108-
/>
109-
{userProfile && (
110-
<Section>
125+
ref={DropdownRef}
126+
onClick={() => setShowUpdateUserProfileModal(true)}
127+
>
128+
<DropDownItem cursor="pointer">
111129
<Image
112-
src={VerticalEllipsisIcon}
113-
height="21px"
114-
maxHeight="21px"
115-
color={theme?.iconColor?.userProfileSettings}
130+
src={UserProfileIcon}
131+
height="32px"
132+
maxHeight="32px"
116133
width={'auto'}
117134
cursor="pointer"
118-
onClick={() => setOptions(true)}
119135
/>
120-
</Section>
121-
)}
122-
{options && (
123-
<DropDownBar
124-
theme={theme}
125-
ref={DropdownRef}
126-
onClick={() => setShowUpdateUserProfileModal(true)}
127-
>
128-
<DropDownItem cursor="pointer">
129-
<Image
130-
src={UserProfileIcon}
131-
height="32px"
132-
maxHeight="32px"
133-
width={'auto'}
134-
cursor="pointer"
135-
/>
136136

137-
<TextItem cursor="pointer">Edit Profile</TextItem>
138-
</DropDownItem>
139-
</DropDownBar>
137+
<TextItem cursor="pointer">Edit Profile</TextItem>
138+
</DropDownItem>
139+
</DropDownBar>
140+
)}
141+
{showUpdateUserProfileModal &&
142+
createPortal(
143+
<UpdateUserProfileModal
144+
theme={theme}
145+
setModal={setShowUpdateUserProfileModal}
146+
userProfile={userProfile!}
147+
setUserProfile={setUserProfile}
148+
updateUserProfileModalBackground={updateUserProfileModalBackground}
149+
updateUserProfileModalPositionType={updateUserProfileModalPositionType}
150+
/>,
151+
document.body
140152
)}
141-
{showUpdateUserProfileModal &&
142-
createPortal(
143-
<UpdateUserProfileModal
144-
theme={theme}
145-
setModal={setShowUpdateUserProfileModal}
146-
userProfile={userProfile!}
147-
setUserProfile={setUserProfile}
148-
updateUserProfileModalBackground={updateUserProfileModalBackground}
149-
updateUserProfileModalPositionType={updateUserProfileModalPositionType}
150-
/>,
151-
document.body
152-
)}
153-
</Conatiner>
153+
</Conatiner>
154154
);
155155
};
156156

0 commit comments

Comments
 (0)