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

Main Release @uiweb 1.7.2 #1421

Merged
merged 69 commits into from
Nov 7, 2024
Merged
Changes from 1 commit
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
360083d
fixed chat responsiveness
HarshRajat May 15, 2024
d864378
fixed preview link alignment to right
HarshRajat May 15, 2024
3115854
added relative imports for better management
HarshRajat May 15, 2024
9e7432e
Merge pull request #1289 from push-protocol/uiweb-absolute-imports
HarshRajat May 16, 2024
e0f7bae
Merge pull request #1287 from push-protocol/responsiveness-mobile-uiw…
HarshRajat May 16, 2024
f5070a2
Search issue (#1270)
mishramonalisha76 May 21, 2024
8d360bc
fix: Merge branch 'main' into alpha
mohammeds1992 May 21, 2024
1cfec21
fix: fixed support chat init issue (#1292)
mishramonalisha76 May 22, 2024
c244626
fix(chatviewlist): increase hidden/encrypted chat blur
corlard3y May 22, 2024
c52e517
Added Reaction support, (#1303)
HarshRajat May 23, 2024
4d56d45
fix: add selected option
corlard3y May 24, 2024
b0ac6c5
fix: add return fn
corlard3y May 27, 2024
2f37ba6
fix: add comment to fn
corlard3y May 27, 2024
89975b4
fix: add push bot address
corlard3y May 27, 2024
e5bd9fa
fix: export const
corlard3y May 27, 2024
7c60e1b
fix: reset chat_id
corlard3y May 27, 2024
74be11e
fix: remove console
corlard3y May 27, 2024
d8241be
fix: update dark mode theme
corlard3y May 27, 2024
122fb44
fix: code review comments
corlard3y May 27, 2024
ed630b5
fix: add null check
corlard3y May 27, 2024
19f3f6b
fix: update conditions
corlard3y May 27, 2024
4a161c8
fix: pending wallet address copy issue fixed
abhishek-01k May 28, 2024
8c45b54
fix: update chatprevie badge conditions
corlard3y May 29, 2024
bbf6778
fix: tooltip was not properly aligned
abhishek-01k May 29, 2024
2f3ade1
fix: scrollbar in member list in group info was not visible
abhishek-01k May 29, 2024
d8b026f
Merge pull request #1312 from push-protocol/1307-bug-increase-bg-blur…
corlard3y May 29, 2024
8512e41
Merge pull request #1324 from push-protocol/skeleton-loading-dark-mode
corlard3y May 29, 2024
06254e6
Merge pull request #1323 from push-protocol/1320-bug-chat-badge
corlard3y May 29, 2024
794666e
Space - id integration (#1322)
mishramonalisha76 May 29, 2024
b295043
fix: fixed the blurr issue in chat on join and accept group (#1305)
mishramonalisha76 May 29, 2024
738383d
fix: fixed lint issue
mishramonalisha76 May 29, 2024
952f06d
Merge branch 'main' of github.com:push-protocol/push-sdk into alpha
rohitmalhotra1420 May 31, 2024
82087a9
fixed build error for incorrect naming
rohitmalhotra1420 May 31, 2024
5f57d4a
Merge branch 'alpha' into SDK-#1298-scrollbar-not-visible-on-member-info
abhishek-01k May 31, 2024
58636d0
Merge pull request #1326 from push-protocol/SDK-1297-copying-pendingW…
abhishek-01k May 31, 2024
cc8dc28
Merge pull request #1328 from push-protocol/SDK-1299-Tooltip-not-prop…
abhishek-01k May 31, 2024
7877b61
Merge pull request #1329 from push-protocol/SDK-#1298-scrollbar-not-v…
abhishek-01k May 31, 2024
2c43806
fixes ui representation for domain resolution (#1336)
mishramonalisha76 Jun 7, 2024
957e093
fix: updated guild validation url (#1363)
mishramonalisha76 Jun 20, 2024
b0c77c2
Merged main into alpha
rohitmalhotra1420 Jun 20, 2024
0afda4d
fix: fixed group creation (#1365)
mishramonalisha76 Jun 24, 2024
5333500
Merge branch 'main' of github.com:push-protocol/push-sdk into alpha
rohitmalhotra1420 Jun 25, 2024
484f95d
fix: fix lint issues
Aman035 Jul 1, 2024
7866a3d
fix: made Group Chat Modal More Persistent (#1339)
abhishek-01k Jul 2, 2024
ec13651
fix: fixed font sizes and dark theme (#1376)
mishramonalisha76 Jul 9, 2024
6396697
Add erc1155 to token gating group conditions (#1382)
kalashshah Aug 7, 2024
cf8e91e
Merge branch 'main' of github.com:push-protocol/push-sdk into alpha
rohitmalhotra1420 Aug 8, 2024
64976c6
Replaced useResolveWeb3Name hook with resolveWeb3Name helper function…
mishramonalisha76 Sep 9, 2024
f972997
Notification Ui change (#1396)
mishramonalisha76 Oct 7, 2024
0ef40ee
Merge branch 'main' of github.com:push-protocol/push-sdk into alpha
rohitmalhotra1420 Oct 7, 2024
d2804c4
Push Chat Reply Feature (#1399)
HarshRajat Oct 9, 2024
b15d35a
Merge branch 'main' of github.com:push-protocol/push-sdk into alpha
rohitmalhotra1420 Oct 9, 2024
6ddf9d7
Merge branch 'alpha' of github.com:push-protocol/push-sdk into alpha
rohitmalhotra1420 Oct 9, 2024
52ecf45
uiweb lock file updated
rohitmalhotra1420 Oct 9, 2024
e46025f
Add support for new chains in the chat criteria modal (#1404)
corlard3y Oct 14, 2024
b32e8a0
fix: fixed the theme for chat reply feature
abhishek-01k Oct 14, 2024
7320a38
Added new infura key (#1408)
mishramonalisha76 Oct 14, 2024
d2fda66
lock files fixed
rohitmalhotra1420 Oct 15, 2024
3312dbc
Merge branch 'main' of github.com:push-protocol/push-sdk into alpha
rohitmalhotra1420 Oct 15, 2024
a123764
fix: fixed the twitter preview Size issue
abhishek-01k Oct 15, 2024
050e2a1
fix: modified the address for the reply preview
abhishek-01k Oct 16, 2024
85233ee
Merge pull request #1409 from push-protocol/chat-reply-issue-fixed
abhishek-01k Oct 24, 2024
f96f451
Release 1.7.0 (#1411) (#1413)
mishramonalisha76 Oct 24, 2024
b4745ab
Revert "Release 1.7.0 (#1411) (#1413)" (#1414)
mishramonalisha76 Oct 24, 2024
000294f
fix: merge main
mohammeds1992 Nov 6, 2024
c89d7ee
Stream fixes (#1417)
mohammeds1992 Nov 6, 2024
52f8576
fix: merge
mohammeds1992 Nov 6, 2024
573a858
Stream and UserProfile Fix (#1419)
mishramonalisha76 Nov 7, 2024
e23ab16
Merge branch 'main' of github.com:push-protocol/push-sdk into alpha
rohitmalhotra1420 Nov 7, 2024
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
Prev Previous commit
Next Next commit
Space - id integration (#1322)
* feat: integrating spaceid in uiweb

* fix: fixed project id setting error

* fix: removed unnecessary code

* fix: added space id

* Update AddWallets.tsx

* fix: made some optimisations

* fix: fixed lint issues

---------

Co-authored-by: KlausMikhaelson <satyamsingh5076@gmail.com>
  • Loading branch information
mishramonalisha76 and KlausMikhaelson authored May 29, 2024
commit 794666edfa70d54f89c0622b06eda604d7e2e2df
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@ import { ChatPreviewSearchList } from '@pushprotocol/uiweb';
import styled from 'styled-components';

const ChatPreviewSearchListTest = () => {
const walletAddress = "0xFA3F8E79fb9B03e7a04295594785b91588Aa4DC8";
const walletAddress = 'fabio.eth';
return (
<>
<Conatiner>
3 changes: 1 addition & 2 deletions packages/examples/sdk-frontend-react/src/app/constants.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
// the unique id for a chat or the receivers's wallet ddress or domain name
export const CHAT_ID =
'34c44214589cecc176a136ee1daf0f0231ecc6d6574b920b5ae39eb971fa3cb4';
export const CHAT_ID = 'allen.bnb';
1 change: 1 addition & 0 deletions packages/uiweb/package.json
Original file line number Diff line number Diff line change
@@ -10,6 +10,7 @@
"@livepeer/react": "^2.6.0",
"@pushprotocol/socket": "^0.5.0",
"@unstoppabledomains/resolution": "^8.5.0",
"@web3-name-sdk/core": "^0.1.15",
"@web3-onboard/coinbase": "^2.2.5",
"@web3-onboard/core": "^2.21.1",
"@web3-onboard/injected-wallets": "^2.10.5",
Original file line number Diff line number Diff line change
@@ -42,7 +42,7 @@ export const ChatPreview: React.FC<IChatPreviewProps> = (options: IChatPreviewPr
setFormattedAddress(address);
if (!options.chatPreviewPayload?.chatGroup) {
try {
const result = await resolveWeb3Name(address, user);
const result = await resolveWeb3Name(address, user?.env);
if (result) setWeb3Name(result);
} catch (e) {
// console.debug(e);
Original file line number Diff line number Diff line change
@@ -93,7 +93,7 @@ export const ChatProfile: React.FC<IChatProfile> = ({
// To setup web3 name, asynchrounously
const setupWeb3Name = async (address: string) => {
console.debug('UIWeb::ChatProfile::setupWeb3Name sending address for resolution', address);
const result = await resolveWeb3Name(address, user);
const result = await resolveWeb3Name(address, user?.env);
console.debug('UIWeb::ChatProfile::setupWeb3Name got result as ', address, result);

setInitialized((prevState) => ({
@@ -372,7 +372,7 @@ const AddonComponentSection = styled(Section)`

@media ${device.mobileL} {
gap: 5px;
} ;
}
`;

const ImageItem = styled.div`
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useContext, useEffect, useRef, useState } from 'react';
import { createPortal } from 'react-dom';

import { IUser } from '@pushprotocol/restapi';
import { IUser, CONSTANTS } from '@pushprotocol/restapi';
import { ethers } from 'ethers';
import styled from 'styled-components';

@@ -15,7 +15,7 @@ import { ProfileContainer } from '../reusables';
import { ThemeContext } from '../theme/ThemeProvider';
import { UpdateUserProfileModal } from './UpdateUserProfileModal';

import { CoreContractChainId, InfuraAPIKey, ProfilePicture, device } from '../../../config';
import { Constants, CoreContractChainId, InfuraAPIKey, ProfilePicture, device } from '../../../config';
import VerticalEllipsisIcon from '../../../icons/VerticalEllipsis.svg';
import UserProfileIcon from '../../../icons/userCircleGear.svg';
import { MODAL_BACKGROUND_TYPE, MODAL_POSITION_TYPE } from '../../../types';
@@ -50,7 +50,7 @@ export const UserProfile: React.FC<UserProfileProps> = ({
(async () => {
const fetchedUser = await fetchChatProfile({ user });
if (fetchedUser) {
const result = await resolveWeb3Name(fetchedUser?.wallets, user);
const result = await resolveWeb3Name(fetchedUser?.wallets, user?.env);
setWeb3Name(result);
setUserProfile(fetchedUser);
}
Original file line number Diff line number Diff line change
@@ -62,7 +62,6 @@ export const AddWallets = ({
};

const handleSearch = async ({ searchedText }: { searchedText: string }): Promise<void> => {
//fix ens search
const newChatUser = await getNewChatUser({
searchText: searchedText,
fetchChatProfile: fetchUserProfile,
39 changes: 17 additions & 22 deletions packages/uiweb/src/lib/components/supportChat/AddressInfo.tsx
Original file line number Diff line number Diff line change
@@ -1,32 +1,34 @@
import { ethers } from 'ethers';
import React, { useContext, useEffect, useState } from 'react';

import styled from 'styled-components';
import { Constants, ENV, InfuraAPIKey, allowedNetworks } from '../../config';
import { ethers } from 'ethers';

import { ChatProps } from './Chat';

import { SupportChatPropsContext } from '../../context';
import { copyToClipboard, pCAIP10ToWallet, resolveWeb3Name, } from '../../helpers';
import { Constants, ENV, InfuraAPIKey, allowedNetworks } from '../../config';

import { copyToClipboard, pCAIP10ToWallet, resolveWeb3Name } from '../../helpers';
import { CopySvg } from '../../icons/CopySvg';
import { ChatProps } from './Chat';

export const AddressInfo: React.FC = () => {

const { supportAddress, env, theme, user } = useContext<ChatProps>(SupportChatPropsContext);

const [ensName, setEnsName] = useState<string>('');
const [pushUser, setPushUser] = useState<any>({});
const [isCopied, setIsCopied] = useState<boolean>(false);
const walletAddress = pCAIP10ToWallet(supportAddress!);
const l1ChainId = (allowedNetworks[env!]?.includes(1)) ? 1 : 5;
const l1ChainId = allowedNetworks[env!]?.includes(1) ? 1 : 5;
const provider = new ethers.providers.InfuraProvider(l1ChainId, InfuraAPIKey);

useEffect(() => {
const getUser = async () => {
if(user){
const fetchedUser = await user.info();
const ensNameResult = await resolveWeb3Name(supportAddress!, user)
setEnsName(ensNameResult!)
setPushUser(fetchedUser);
}

if (user) {
const fetchedUser = await user.info();
const ensNameResult = await resolveWeb3Name(supportAddress!, user?.env);
setEnsName(ensNameResult!);
setPushUser(fetchedUser);
}
};
getUser();
}, [supportAddress, user]);
@@ -36,20 +38,13 @@ setPushUser(fetchedUser);
<Section>
<ImgSpan>
<Image
src={
pushUser?.profile?.picture
? pushUser?.profile.picture
: Constants.DEFAULT_PROFILE_PICTURE
}
src={pushUser?.profile?.picture ? pushUser?.profile.picture : Constants.DEFAULT_PROFILE_PICTURE}
alt="address profile"
/>
</ImgSpan>
<Span theme={theme}>
{ensName && `${ensName}`}
{!ensName &&
`${walletAddress.substring(0, 8)}...${walletAddress.substring(
walletAddress.length - 8
)}`}
{!ensName && `${walletAddress.substring(0, 8)}...${walletAddress.substring(walletAddress.length - 8)}`}
</Span>
</Section>
{!isCopied && (
18 changes: 8 additions & 10 deletions packages/uiweb/src/lib/config/constants.ts
Original file line number Diff line number Diff line change
@@ -60,7 +60,7 @@ const TESTNET_NETWORK = {
ARBITRUM: 'eip155:421614',
FUSE: 'eip155:123',
BERACHAIN: 'eip155:80085',
CYBER_CONNECT: 'eip155:111557560'
CYBER_CONNECT: 'eip155:111557560',
};
const MAINET_NETWORK = {
ETHEREUM: 'eip155:1',
@@ -70,7 +70,7 @@ const MAINET_NETWORK = {
POLYGON_ZK_EVM: 'eip155:1101',
ARBITRUM: 'eip155:42161',
FUSE: 'eip155:122',
CYBER_CONNECT: "eip155:7560"
CYBER_CONNECT: 'eip155:7560',
};

export const BLOCKCHAIN_NETWORK = {
@@ -88,7 +88,7 @@ export const allowedNetworks = {
10, // for optimism mainnet
42161, // for arbitrum mainnet
122, // for fuse mainnet
7569 // for cyber connect mainnet
7569, // for cyber connect mainnet
],
dev: [
11155111, // for eth sepolia
@@ -99,7 +99,7 @@ export const allowedNetworks = {
123, // for fuse testnet
80085, // for berachain testnet
2442, // polygon zkevm
111557560 // cyber connect testnet
111557560, // cyber connect testnet
],
staging: [
// 42, //for kovan
@@ -111,7 +111,7 @@ export const allowedNetworks = {
123, // for fuse testnet
80085, // for berachain testnet
2442, // polygon zkevm
111557560 // cyber connect testnet
111557560, // cyber connect testnet
],
local: [
11155111, // for eth sepolia
@@ -122,7 +122,7 @@ export const allowedNetworks = {
123, // for fuse testnet
80085, // for berachain testnet
2442, // polygon zkevm
111557560 // cyber connect testnet
111557560, // cyber connect testnet
],
};

@@ -152,10 +152,8 @@ export const FILE_ICON = (extension: string) =>

// Livekit Server URLs
export const LIVEKIT_SERVER_URL = 'https://spacev2-demo-17wvllxz.livekit.cloud';
export const LIVEKIT_SERVER_WEBSOCKET_URL =
'wss://spacev2-demo-17wvllxz.livekit.cloud';
export const LIVEKIT_TOKEN_GENERATOR_SERVER_URL =
'https://ms-lk-server.onrender.com';
export const LIVEKIT_SERVER_WEBSOCKET_URL = 'wss://spacev2-demo-17wvllxz.livekit.cloud';
export const LIVEKIT_TOKEN_GENERATOR_SERVER_URL = 'https://ms-lk-server.onrender.com';
export const GUEST_MODE_ACCOUNT = '0x0000000000000000000000000000000000000001';

export const pushBotAddress = "eip155:0x99A08ac6254dcf7ccc37CeC662aeba8eFA666666";
80 changes: 20 additions & 60 deletions packages/uiweb/src/lib/helpers/address.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { InfuraProvider, Web3Provider } from '@ethersproject/providers';
import { CONSTANTS, Env, PushAPI, SignerType } from '@pushprotocol/restapi';
import { SignerType, CONSTANTS } from '@pushprotocol/restapi';
import { ethers } from 'ethers';
import { CoreContractChainId, InfuraAPIKey } from '../config';
import { getUdResolver } from './udResolver';
import { ENV, allowedNetworks } from '../config';
import { createWeb3Name } from '@web3-name-sdk/core';
import { getUdResolverClient } from './udResolver';

/**
*
@@ -46,69 +46,29 @@ export const pCAIP10ToWallet = (wallet: string): string => {
return wallet;
};

export const resolveEns = (address: string, provider: Web3Provider) => {
export const resolveWeb3Name = async (address: string, env: ENV) => {
env = env || CONSTANTS.ENV.PROD;
const walletLowercase = pCAIP10ToWallet(address).toLowerCase();
const checksumWallet = ethers.utils.getAddress(walletLowercase);
// let provider = ethers.getDefaultProvider('mainnet');
// if (
// window.location.hostname == 'app.push.org' ||
// window.location.hostname == 'staging.push.org' ||
// window.location.hostname == 'dev.push.org' ||
// window.location.hostname == 'alpha.push.org' ||
// window.location.hostname == 'w2w.push.org'
// ) {
// provider = new ethers.providers.InfuraProvider(
// 'mainnet',
// appConfig.infuraAPIKey
// );
// }

provider.lookupAddress(checksumWallet).then((ens) => {
if (ens) {
return ens;
} else {
return null;
}
});
};

export const getProvider = (user: PushAPI | undefined): any => {
const envKey = user ? user.env : CONSTANTS.ENV.PROD; // Default to 'PROD' if user.env is not in Constants.ENV
const chainId = CoreContractChainId[envKey as keyof typeof CoreContractChainId]; // Use 'as' to assert the type
const provider = new ethers.providers.InfuraProvider(chainId, InfuraAPIKey);

return provider;
};

export const resolveWeb3Name = async (address: string, user: PushAPI | undefined) => {
const walletLowercase = pCAIP10ToWallet(address).toLowerCase();
const checksumWallet = ethers.utils.getAddress(walletLowercase);

// get provider
const provider = getProvider(user);
const web3NameClient = createWeb3Name();

let result: string | null = null;

try {
const ens = await provider.lookupAddress(checksumWallet);
if (ens) {
result = ens;
} else {
try {
const udResolver = getUdResolver(user ? user.env : CONSTANTS.ENV.PROD);
if (!udResolver) {
throw new Error('UIWeb::helpers::address::resolveWeb3Name::Error in UD resolver');
}
result = await web3NameClient.getDomainName({
address: checksumWallet,
queryChainIdList: allowedNetworks[env],
});
if (!result) {
const udResolverClient = getUdResolverClient(env);
if (!udResolverClient) {
throw new Error('UIWeb::helpers::address::resolveWeb3Name::Error in UD resolver');
}
// attempt reverse resolution on provided address
const udDomainName = await udResolverClient.reverse(checksumWallet);

// attempt reverse resolution on provided address
const udName = await udResolver.reverse(checksumWallet);
if (udName) {
result = udName;
} else {
result = null;
}
} catch (err) {
console.error('UIWeb::helpers::address::resolveWeb3Name::Error in resolving via UD', err);
if (udDomainName) {
result = udDomainName;
}
}
} catch (err) {
24 changes: 9 additions & 15 deletions packages/uiweb/src/lib/helpers/chat/search.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import type { Env, IFeeds, IUser, PushAPI } from '@pushprotocol/restapi';
import { add } from 'date-fns';
import { ethers } from 'ethers';
import { CoreContractChainId, ENV, InfuraAPIKey, ProfilePicture } from '../../config';
import type { FetchProfileParams, GetProfileParams } from '../../hooks';
import type { ChatFeedsType, NotificationFeedsType, ParsedNotificationType, Web3NameListType } from '../../types';
import { pCAIP10ToWallet, walletToPCAIP10 } from '../address';
import { getUdResolver } from '../udResolver';
import { getUdResolverClient } from '../udResolver';
import { displayDefaultUser } from './user';
import { createWeb3Name } from '@web3-name-sdk/core';

export const getObjectsWithMatchingKeys = (
obj: ChatFeedsType,
@@ -60,23 +58,19 @@ export const getNewChatUser = async ({
};

export const getAddress = async (searchText: string, env: Env) => {
const udResolver = getUdResolver(env);
const provider = new ethers.providers.InfuraProvider(CoreContractChainId[env], InfuraAPIKey);
const udResolverClient = getUdResolverClient(env);
const web3NameClient = createWeb3Name();
let address: string | null = null;
if (searchText.includes('.')) {
try {
if (!udResolver) throw new Error('No udResolver available for the network');
address = await udResolver?.owner(searchText);
} catch (err) {
try {
address = await provider.resolveName(searchText);
} catch (err) {
console.debug(err);
address = await web3NameClient.getAddress(searchText);
if (!address) {
if (!udResolverClient) throw new Error('No udResolverClient available for the network');
address = await udResolverClient?.owner(searchText);
}

} catch (err) {
console.debug(err);
}

return address || null;
} else if (await ethers.utils.isAddress(pCAIP10ToWallet(searchText))) {
return searchText;
Loading