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

chalabi/mobile on desktop #150

Merged
merged 11 commits into from
Jan 6, 2025
Binary file modified bun.lockb
Binary file not shown.
1 change: 0 additions & 1 deletion components/bank/forms/sendForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ export default function SendForm({
amount: [{ denom: values.selectedToken.coreDenom, amount: amountInBaseUnits }],
});

console.log('Estimating fee for address:', address);
const fee = await estimateFee(address, [msg]);

await tx([msg], {
Expand Down
2 changes: 0 additions & 2 deletions components/groups/modals/memberManagementModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,6 @@ export function MemberManagementModal({
weight: member.markedForDeletion ? '0' : member.weight || '1',
}));

console.log('Member updates:', memberUpdates);

const msg = updateGroupMembers({
admin: groupAdmin,
groupId: BigInt(groupId),
Expand Down
29 changes: 24 additions & 5 deletions components/react/modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,29 @@
}
}, [isOpen, walletStatus, currentWalletName, showContacts]);

useEffect(() => {
if (!isOpen && current?.walletStatus === WalletStatus.Connecting) {
current.disconnect();

Check warning on line 81 in components/react/modal.tsx

View check run for this annotation

Codecov / codecov/patch

components/react/modal.tsx#L81

Added line #L81 was not covered by tests
}
}, [isOpen, current]);

const onWalletClicked = useCallback(
(name: string) => {
const timeoutId = setTimeout(() => {
const wallet = walletRepo?.getWallet(name);
if (wallet?.walletStatus === WalletStatus.Connecting) {
wallet.disconnect();
setCurrentView(ModalView.Error);
}
}, 30000);

Check warning on line 94 in components/react/modal.tsx

View check run for this annotation

Codecov / codecov/patch

components/react/modal.tsx#L87-L94

Added lines #L87 - L94 were not covered by tests
walletRepo?.connect(name);

// 1ms timeout prevents _render from determining the view to show first
setTimeout(() => {
const wallet = walletRepo?.getWallet(name);

if (wallet?.isWalletNotExist) {
clearTimeout(timeoutId);

Check warning on line 101 in components/react/modal.tsx

View check run for this annotation

Codecov / codecov/patch

components/react/modal.tsx#L101

Added line #L101 was not covered by tests
setCurrentView(ModalView.NotExist);
setSelectedWallet(wallet);
}
Expand All @@ -93,13 +107,18 @@
setQRWallet(wallet);
}
}, 1);

Check warning on line 110 in components/react/modal.tsx

View check run for this annotation

Codecov / codecov/patch

components/react/modal.tsx#L110

Added line #L110 was not covered by tests
return () => clearTimeout(timeoutId);
},
[walletRepo]
);

const onCloseModal = useCallback(() => {
if (current?.walletStatus === WalletStatus.Connecting) {
current.disconnect();
}

Check warning on line 119 in components/react/modal.tsx

View check run for this annotation

Codecov / codecov/patch

components/react/modal.tsx#L117-L119

Added lines #L117 - L119 were not covered by tests
setOpen(false);
}, [setOpen]);
}, [setOpen, current]);

const _render = useMemo(() => {
switch (currentView) {
Expand All @@ -125,11 +144,11 @@
);
case ModalView.Connecting:
let subtitle: string;
if (currentWalletData!.mode === 'wallet-connect') {
subtitle = `Approve ${currentWalletData!.prettyName} connection request on your mobile.`;
if (currentWalletData!?.mode === 'wallet-connect') {
subtitle = `Approve ${currentWalletData!.prettyName} connection request on your mobile device.`;

Check warning on line 148 in components/react/modal.tsx

View check run for this annotation

Codecov / codecov/patch

components/react/modal.tsx#L147-L148

Added lines #L147 - L148 were not covered by tests
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Remove unnecessary non-null assertions

The code uses unnecessary non-null assertions (!). Consider using optional chaining instead.

-        if (currentWalletData!?.mode === 'wallet-connect') {
-          subtitle = `Approve ${currentWalletData!.prettyName} connection request on your mobile device.`;
+        if (currentWalletData?.mode === 'wallet-connect') {
+          subtitle = `Approve ${currentWalletData.prettyName} connection request on your mobile device.`;
         } else {
-          subtitle = `Open the ${currentWalletData!?.prettyName} browser extension to connect your wallet.`;
+          subtitle = `Open the ${currentWalletData?.prettyName} browser extension to connect your wallet.`;
         }

Also applies to: 151-151

🧰 Tools
🪛 Biome (1.9.4)

[error] 147-147: Forbidden extra non-null assertion.

Safe fix: Remove extra non-null assertion.

(lint/suspicious/noExtraNonNullAssertion)

🪛 GitHub Check: codecov/patch

[warning] 147-148: components/react/modal.tsx#L147-L148
Added lines #L147 - L148 were not covered by tests

} else {
subtitle = `Open the ${
currentWalletData!.prettyName
currentWalletData!?.prettyName

Check warning on line 151 in components/react/modal.tsx

View check run for this annotation

Codecov / codecov/patch

components/react/modal.tsx#L151

Added line #L151 was not covered by tests
} browser extension to connect your wallet.`;
}

Expand Down
2 changes: 1 addition & 1 deletion components/react/views/Connected.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
<Image
height={0}
width={0}
src={getRealLogo(logo)}
src={name === 'Cosmos MetaMask Extension' ? '/metamask.svg' : getRealLogo(logo)}

Check warning on line 60 in components/react/views/Connected.tsx

View check run for this annotation

Codecov / codecov/patch

components/react/views/Connected.tsx#L60

Added line #L60 was not covered by tests
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Add test coverage for MetaMask logo conditional.

The new conditional logic for MetaMask logo handling is currently not covered by tests.

Consider adding test cases to verify:

  1. Logo rendering for Cosmos MetaMask Extension
  2. Logo rendering for other wallet types
describe('Connected component', () => {
  it('should render MetaMask logo for Cosmos MetaMask Extension', () => {
    render(<Connected name="Cosmos MetaMask Extension" logo="some-logo.svg" {...defaultProps} />);
    expect(screen.getByAltText('Cosmos MetaMask Extension')).toHaveAttribute('src', '/metamask.svg');
  });

  it('should render wallet logo for other wallets', () => {
    const logo = 'wallet-logo.svg';
    render(<Connected name="Other Wallet" logo={logo} {...defaultProps} />);
    expect(screen.getByAltText('Other Wallet')).toHaveAttribute('src', getRealLogo(logo));
  });
});
🧰 Tools
🪛 GitHub Check: codecov/patch

[warning] 60-60: components/react/views/Connected.tsx#L60
Added line #L60 was not covered by tests

alt={name}
className="w-8 h-8 rounded-full mr-2"
/>
Expand Down
2 changes: 1 addition & 1 deletion components/react/views/Connecting.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
</div>
<div className="flex flex-col w-full h-full mt-4 sm:px-8 sm:py-6">
<img
src={getRealLogo(logo)}
src={name === 'Cosmos MetaMask Extension' ? '/metamask.svg' : getRealLogo(logo)}

Check warning on line 46 in components/react/views/Connecting.tsx

View check run for this annotation

Codecov / codecov/patch

components/react/views/Connecting.tsx#L46

Added line #L46 was not covered by tests
alt={name}
className="flex-shrink-0 w-20 h-20 mx-auto aspect-1"
/>
Expand Down
6 changes: 5 additions & 1 deletion components/react/views/Error.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@
<div className="flex flex-col w-full h-full py-6 mt-4 sm:px-8">
<div className="p-3 border rounded-full border-red-600 mx-auto aspect-1 flex-shrink-0">
<Image
src={getRealLogo(logo)}
src={
currentWalletName === 'Cosmos MetaMask Extension'
? '/metamask.svg'
: getRealLogo(logo)
}

Check warning on line 52 in components/react/views/Error.tsx

View check run for this annotation

Codecov / codecov/patch

components/react/views/Error.tsx#L48-L52

Added lines #L48 - L52 were not covered by tests
alt="Wallet type logo"
className="flex-shrink-0 w-16 h-16 aspect-1"
width={16}
Expand Down
2 changes: 1 addition & 1 deletion components/react/views/NotExist.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
</div>
<div className="flex flex-col w-full h-full py-6 mt-4 sm:px-8">
<img
src={getRealLogo(logo)}
src={name === 'Cosmos MetaMask Extension' ? '/metamask.svg' : getRealLogo(logo)}

Check warning on line 43 in components/react/views/NotExist.tsx

View check run for this annotation

Codecov / codecov/patch

components/react/views/NotExist.tsx#L43

Added line #L43 was not covered by tests
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Extract shared wallet logo logic

The logo rendering logic is duplicated across multiple components (Connecting, NotExist, Error).

Consider creating a shared utility:

+ // Add to utils/wallet.ts
+ export const getWalletLogo = (name: string, logo: string): string => {
+   return name === WALLET_TYPES.METAMASK ? WALLET_LOGOS.METAMASK : getRealLogo(logo);
+ };

- src={name === 'Cosmos MetaMask Extension' ? '/metamask.svg' : getRealLogo(logo)}
+ src={getWalletLogo(name, logo)}

This would improve maintainability and ensure consistent behavior across components.

Committable suggestion skipped: line range outside the PR's diff.

🧰 Tools
🪛 GitHub Check: codecov/patch

[warning] 43-43: components/react/views/NotExist.tsx#L43
Added line #L43 was not covered by tests

alt={name}
className="flex-shrink-0 w-16 h-16 mx-auto aspect-1"
/>
Expand Down
64 changes: 46 additions & 18 deletions components/react/views/WalletList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,29 @@
const isDarkMode = document.documentElement.classList.contains('dark');

const social = wallets.filter(wallet =>
['Google', 'Twitter', 'Apple', 'Discord', 'GitHub', 'Reddit'].includes(
['Google', 'Twitter', 'Apple', 'Discord', 'GitHub', 'Reddit', 'Email', 'SMS'].includes(

Check warning on line 18 in components/react/views/WalletList.tsx

View check run for this annotation

Codecov / codecov/patch

components/react/views/WalletList.tsx#L18

Added line #L18 was not covered by tests
wallet.walletInfo.prettyName
)
);

const browser = wallets.filter(wallet =>
['Keplr', 'Cosmostation', 'Leap', 'Station'].includes(wallet.walletInfo.prettyName)
['Keplr', 'Cosmostation', 'Leap', 'Station', 'Cosmos MetaMask Extension'].includes(
wallet.walletInfo.prettyName
)

Check warning on line 26 in components/react/views/WalletList.tsx

View check run for this annotation

Codecov / codecov/patch

components/react/views/WalletList.tsx#L24-L26

Added lines #L24 - L26 were not covered by tests
);

const mobile = wallets.filter(wallet =>
['Wallet Connect', 'Keplr Mobile', 'Cosmostation Mobile', 'Leap Mobile'].includes(
wallet.walletInfo.prettyName
)
['Keplr Mobile', 'Cosmostation Mobile', 'Leap Mobile'].includes(wallet.walletInfo.prettyName)

Check warning on line 30 in components/react/views/WalletList.tsx

View check run for this annotation

Codecov / codecov/patch

components/react/views/WalletList.tsx#L30

Added line #L30 was not covered by tests
);

const hasMobileVersion = (prettyName: string) => {
return mobile.some(w => w.walletInfo.prettyName.startsWith(prettyName));
};

const getMobileWalletName = (browserName: string) => {
return mobile.find(w => w.walletInfo.prettyName.startsWith(browserName))?.walletInfo.name;
};
Comment on lines +34 to +40
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Add input validation to utility functions.

The new utility functions hasMobileVersion and getMobileWalletName should include input validation and error handling.

Consider this implementation:

 const hasMobileVersion = (prettyName: string) => {
+  if (!prettyName) return false;
   return mobile.some(w => w.walletInfo.prettyName.startsWith(prettyName));
 };

 const getMobileWalletName = (browserName: string) => {
+  if (!browserName) return undefined;
   return mobile.find(w => w.walletInfo.prettyName.startsWith(browserName))?.walletInfo.name;
 };
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const hasMobileVersion = (prettyName: string) => {
return mobile.some(w => w.walletInfo.prettyName.startsWith(prettyName));
};
const getMobileWalletName = (browserName: string) => {
return mobile.find(w => w.walletInfo.prettyName.startsWith(browserName))?.walletInfo.name;
};
const hasMobileVersion = (prettyName: string) => {
if (!prettyName) return false;
return mobile.some(w => w.walletInfo.prettyName.startsWith(prettyName));
};
const getMobileWalletName = (browserName: string) => {
if (!browserName) return undefined;
return mobile.find(w => w.walletInfo.prettyName.startsWith(browserName))?.walletInfo.name;
};
🧰 Tools
🪛 GitHub Check: codecov/patch

[warning] 35-41: components/react/views/WalletList.tsx#L35-L41
Added lines #L35 - L41 were not covered by tests


Check warning on line 40 in components/react/views/WalletList.tsx

View check run for this annotation

Codecov / codecov/patch

components/react/views/WalletList.tsx#L32-L40

Added lines #L32 - L40 were not covered by tests
return (
<div className="p-1 relative max-w-sm mx-auto">
<h1 className="text-sm font-semibold text-center mb-6">Connect Wallet</h1>
Expand All @@ -40,22 +49,41 @@
<XMarkIcon className="w-5 h-5" aria-hidden="true" />
</button>

{/* Browser and Social sections - browaer hidden on mobile/tablet */}
{/* Browser and Social sections - browser hidden on mobile/tablet */}

Check warning on line 52 in components/react/views/WalletList.tsx

View check run for this annotation

Codecov / codecov/patch

components/react/views/WalletList.tsx#L52

Added line #L52 was not covered by tests
<div className="hidden md:block">
<div className="space-y-2 mb-4">
{browser.map(({ walletInfo: { name, prettyName, logo } }) => (
<button
key={name}
onClick={() => onWalletClicked(name)}
className="flex items-center w-full p-3 rounded-lg dark:bg-[#ffffff0c] bg-[#f0f0ff5c] dark:hover:bg-[#0000004c] hover:bg-[#a8a8a84c] transition"
>
<img
src={getRealLogo(logo?.toString() ?? '')}
alt={prettyName}
className="w-10 h-10 rounded-xl mr-3"
/>
<span className="text-md">{prettyName}</span>
</button>
<div key={name} className="w-full">
<button
onClick={() => onWalletClicked(name)}
className="flex items-center w-full p-3 rounded-lg dark:bg-[#ffffff0c] bg-[#f0f0ff5c] dark:hover:bg-[#0000004c] hover:bg-[#a8a8a84c] transition"
>
<img
src={
prettyName === 'Cosmos MetaMask Extension'
? '/metamask.svg'
: getRealLogo(logo?.toString() ?? '')
}
alt={prettyName}
className="w-10 h-10 rounded-xl mr-3"
/>
<span className="text-md flex-1 text-left">
{prettyName === 'Cosmos MetaMask Extension' ? 'MetaMask' : prettyName}
</span>
{hasMobileVersion(prettyName) && (
<div
onClick={e => {
e.stopPropagation();
onWalletClicked(getMobileWalletName(prettyName) || '');
}}
className="p-1.5 rounded-lg dark:hover:bg-[#ffffff1a] hover:bg-[#0000000d] dark:bg-[#ffffff37] bg-[#d5d5e4] transition cursor-pointer"
title={`Connect with ${prettyName} Mobile`}
>
<img src={getRealLogo('/sms')} alt="mobile" className="w-5 h-5" />
</div>
)}
</button>
</div>

Check warning on line 86 in components/react/views/WalletList.tsx

View check run for this annotation

Codecov / codecov/patch

components/react/views/WalletList.tsx#L56-L86

Added lines #L56 - L86 were not covered by tests
))}
</div>

Expand Down
40 changes: 27 additions & 13 deletions components/wallet.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { MouseEventHandler, useEffect, useMemo, useState } from 'react';
import React, { MouseEventHandler, useEffect, useMemo, useState, useRef } from 'react';

import { ArrowDownTrayIcon, ArrowPathIcon } from '@heroicons/react/24/outline';
import { ArrowUpIcon, CopyIcon } from './icons';
Expand Down Expand Up @@ -36,20 +36,32 @@
export const WalletSection: React.FC<WalletSectionProps> = ({ chainName }) => {
const { connect, openView, status, username, address } = useChain(chainName);
const [localStatus, setLocalStatus] = useState(status);
const timeoutRef = useRef<ReturnType<typeof setTimeout>>();

Check warning on line 39 in components/wallet.tsx

View check run for this annotation

Codecov / codecov/patch

components/wallet.tsx#L39

Added line #L39 was not covered by tests

useEffect(() => {
let timeoutId: ReturnType<typeof setTimeout>;

if (status === WalletStatus.Connecting) {
timeoutId = setTimeout(() => {
// Clear any existing timeout
if (timeoutRef.current) {
clearTimeout(timeoutRef.current);
}

// Set new timeout
timeoutRef.current = setTimeout(() => {

Check warning on line 49 in components/wallet.tsx

View check run for this annotation

Codecov / codecov/patch

components/wallet.tsx#L43-L49

Added lines #L43 - L49 were not covered by tests
setLocalStatus(WalletStatus.Error);
}, 10000); // 10 seconds timeout
}, 30000); // 30 seconds timeout

Check warning on line 51 in components/wallet.tsx

View check run for this annotation

Codecov / codecov/patch

components/wallet.tsx#L51

Added line #L51 was not covered by tests
} else {
setLocalStatus(status);
// Clear timeout when status changes
if (timeoutRef.current) {
clearTimeout(timeoutRef.current);
}

Check warning on line 57 in components/wallet.tsx

View check run for this annotation

Codecov / codecov/patch

components/wallet.tsx#L54-L57

Added lines #L54 - L57 were not covered by tests
}

// Cleanup on unmount

Check warning on line 60 in components/wallet.tsx

View check run for this annotation

Codecov / codecov/patch

components/wallet.tsx#L60

Added line #L60 was not covered by tests
return () => {
if (timeoutId) clearTimeout(timeoutId);
if (timeoutRef.current) {
clearTimeout(timeoutRef.current);
}

Check warning on line 64 in components/wallet.tsx

View check run for this annotation

Codecov / codecov/patch

components/wallet.tsx#L62-L64

Added lines #L62 - L64 were not covered by tests
};
}, [status]);

Expand Down Expand Up @@ -202,7 +214,11 @@
}

let onClick;
if (status === WalletStatus.Disconnected || status === WalletStatus.Rejected)
if (
status === WalletStatus.Disconnected ||
status === WalletStatus.Rejected ||
status === WalletStatus.Error
)

Check warning on line 221 in components/wallet.tsx

View check run for this annotation

Codecov / codecov/patch

components/wallet.tsx#L217-L221

Added lines #L217 - L221 were not covered by tests
onClick = onClickConnect;
else onClick = openView;

Expand All @@ -211,12 +227,10 @@
return (
<div className="relative group">
<button
onClick={
status === WalletStatus.Disconnected || status === WalletStatus.Rejected
? onClick
: () => {}
}
className={`flex justify-center items-center w-8 h-8 hover:text-primary duration-200 ease-in-out ${status === WalletStatus.Disconnected || status === WalletStatus.Rejected ? 'cursor-pointer' : 'cursor-default'}`}
onClick={onClick}
className={`flex justify-center items-center w-8 h-8 hover:text-primary duration-200 ease-in-out ${
status === WalletStatus.Connected ? 'cursor-default' : 'cursor-pointer'
}`}

Check warning on line 233 in components/wallet.tsx

View check run for this annotation

Codecov / codecov/patch

components/wallet.tsx#L230-L233

Added lines #L230 - L233 were not covered by tests
>
<buttonData.icon className="w-8 h-8" />
</button>
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"@chain-registry/assets": "^1.64.83",
"@cosmjs/cosmwasm-stargate": "0.32.4",
"@cosmjs/stargate": "npm:@liftedinit/[email protected]",
"@cosmos-kit/cosmos-extension-metamask": "^0.12.1",
"@cosmos-kit/react": "2.18.0",
"@cosmos-kit/web3auth": "2.11.0",
"@fontsource/manrope": "^5.0.21",
Expand Down
13 changes: 12 additions & 1 deletion pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
manifestTestnetAssets,
} from '@/config';
import { SignerOptions, wallets } from 'cosmos-kit';
import { wallets as cosmosExtensionWallets } from '@cosmos-kit/cosmos-extension-metamask';
import { ChainProvider } from '@cosmos-kit/react';
import { Registry } from '@cosmjs/proto-signing';
import { TailwindModal } from '../components';
Expand Down Expand Up @@ -145,6 +146,16 @@ function ManifestApp({ Component, pageProps }: ManifestAppProps) {
name: 'Reddit',
logo: '/reddit',
},
{
provider: 'email_passwordless',
name: 'Email',
logo: '/email',
},
{
provider: 'sms_passwordless',
name: 'SMS',
logo: '/sms',
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

Web3Auth configuration requires additional setup

The verification reveals missing critical configuration:

  • Web3Auth dependencies (@web3auth/base and @web3auth/modal) are not present in package.json
  • Required NEXT_PUBLIC_WEB3_CLIENT_ID environment variable is not configured, though it's referenced in the code
  • While email and SMS providers are defined in the UI configuration, the underlying Web3Auth setup appears incomplete

To enable email and SMS authentication:

  • Add required Web3Auth dependencies to package.json
  • Configure NEXT_PUBLIC_WEB3_CLIENT_ID in the environment
  • Verify Web3Auth Modal initialization with proper provider configuration
🔗 Analysis chain

Verify email and SMS authentication configuration.

The addition of email and SMS authentication methods enhances accessibility, but requires proper configuration to function correctly.


Let me gather more information about the Web3Auth configuration and usage in the codebase.


Let me check the Web3Auth configuration and initialization code to understand how email and SMS providers are set up.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify Web3Auth configuration for email and SMS providers
# Check for required environment variables and configuration files

# Check if Web3Auth client ID is configured
if ! grep -q "NEXT_PUBLIC_WEB3_CLIENT_ID" .env*; then
  echo "Warning: Web3Auth client ID environment variable not found"
fi

# Check Web3Auth configuration in package.json
if [ -f "package.json" ]; then
  jq '.dependencies["@web3auth/base"]' package.json
  jq '.dependencies["@web3auth/modal"]' package.json
fi

Length of output: 351


Script:

#!/bin/bash
# Search for Web3Auth related imports and configurations
echo "=== Searching for Web3Auth related imports ==="
rg "@web3auth" -A 3

echo -e "\n=== Searching for Web3Auth configuration patterns ==="
ast-grep --pattern 'new Web3Auth($$$)'

echo -e "\n=== Checking for environment variable usage ==="
rg "NEXT_PUBLIC_WEB3" -A 2

echo -e "\n=== Looking for configuration files ==="
fd -e config.js -e config.ts

Length of output: 882


Script:

#!/bin/bash
# Check Web3Auth configuration and provider setup
echo "=== Checking Web3Auth Modal configuration ==="
rg -A 10 "new Web3Modal" 

echo -e "\n=== Looking for provider configurations ==="
rg "provider.*['\"]email_passwordless['\"]|provider.*['\"]sms_passwordless['\"]" -A 5

echo -e "\n=== Checking authentication related functions ==="
ast-grep --pattern 'async function $_($$_) {
  $$$
  login($$$)
  $$$
}'

Length of output: 923

],

client: {
Expand All @@ -167,7 +178,7 @@ function ManifestApp({ Component, pageProps }: ManifestAppProps) {
);

// combine the web3auth wallets with the other wallets
const combinedWallets = [...web3AuthWallets, ...wallets];
const combinedWallets = [...web3AuthWallets, ...wallets, ...cosmosExtensionWallets];

// this is stop ssr errors when we render the web3auth signing modal
const [isBrowser, setIsBrowser] = useState(false);
Expand Down
2 changes: 1 addition & 1 deletion pages/groups/create.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default function CreateGroup() {
const [currentStep, setCurrentStep] = useState(1);
const [formData, dispatch] = useReducer(formDataReducer, initialFormData);
const { address } = useChain(chainName);
console.log(formData);

const nextStep = () => {
if (currentStep < 5) {
setCurrentStep(currentStep + 1);
Expand Down
7 changes: 7 additions & 0 deletions public/browser-wallet.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions public/email_dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions public/email_light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading