-
Notifications
You must be signed in to change notification settings - Fork 16
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
add: lazy loading modal solana selector #98
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@@ -112,7 +113,7 @@ export class NightlyConnectAdapter implements Injected { | |||
set walletsList(list: IPolkadotWalletListItem[]) { | |||
this._walletsList = list | |||
if (this._modal) { | |||
this._modal.walletsList = list | |||
this._modal.walletsList = list as IWalletListItem[] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need this maybe IPolkadotWalletListItem
is now redundant ?
walletsData[wallet.name.toLocaleLowerCase()] = { | ||
slug: wallet.name, | ||
name: wallet.name, | ||
icon: wallet.icon as string, | ||
link: '', | ||
deeplink: null, | ||
image: { | ||
default: wallet.icon as string, | ||
sm: wallet.icon as string, | ||
md: wallet.icon as string, | ||
lg: wallet.icon as string | ||
}, | ||
desktop: null, | ||
mobile: null, | ||
recent: recentWalletName === wallet.name, | ||
detected: true, | ||
injectedWallet: wallet, | ||
homepage: '', | ||
walletType: 'hybrid' | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you have to unify types?
sdk/bindings/WalletMetadata.ts
Outdated
import type { Deeplink } from './Deeplink' | ||
import type { Images } from './Images' | ||
import type { Network } from './Network' | ||
import type { Platform } from './Platform' | ||
import type { Version } from './Version' | ||
import type { WalletType } from './WalletType' | ||
|
||
export interface WalletMetadata { slug: string, name: string, description: string, homepage: string, chains: Array<Network>, version: Version, walletType: WalletType, mobile: Deeplink | null, desktop: Deeplink | null, image: Images, app: Record<Platform, string>, injectPath: Record<Network, string>, lastUpdatedTimestamp: bigint, } No newline at end of file | ||
export interface WalletMetadata { | ||
slug: string | ||
name: string | ||
description?: string | ||
homepage?: string | ||
chains?: Array<Network> | ||
version?: Version | ||
walletType: WalletType | ||
mobile: Deeplink | null | ||
desktop: Deeplink | null | ||
image: Images | ||
app?: Record<Platform, string> | ||
injectPath?: Record<Network, string> | ||
lastUpdatedTimestamp?: bigint | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DO NOT FORMAT GENERATE FILES
walletsData[wallet.slug.toLocaleLowerCase()] = wallet | ||
walletsData[wallet.slug.toLocaleLowerCase()] = { | ||
...wallet, | ||
recent: recentWalletName === wallet.name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is recent part of api ?
export interface WalletMetadata extends Partial<WalletMetadataOriginal> { | ||
slug: string | ||
name: string | ||
walletType: WalletType | ||
mobile: Deeplink | null | ||
desktop: Deeplink | null | ||
image: Images | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WHAT ? remove this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But wouldnt it then force me to pass all of the fields such as homepage, version, app etc. in for example polkadot selector detection file?
walletsData[wallet.name.toLocaleLowerCase()] = { slug: wallet.name, name: wallet.name, image: { default: wallet.icon as string, sm: wallet.icon as string, md: wallet.icon as string, lg: wallet.icon as string }, desktop: null, mobile: null, recent: recentWalletName === wallet.name, detected: true, injectedWallet: wallet, walletType: 'hybrid' }
@@ -2,8 +2,8 @@ import { type AppBaseInitialize } from '@nightlylabs/nightly-connect-base' | |||
import { type Deeplink } from '@nightlylabs/nightly-connect-base/dist/types/bindings/Deeplink' | |||
import { type Wallet } from '@wallet-standard/core' | |||
import { type WalletType } from '../../../bindings/WalletType' | |||
import { type WalletMetadata } from '../../../bindings/WalletMetadata' | |||
export { type WalletMetadata } from '../../../bindings/WalletMetadata' | |||
import { type WalletMetadata as WalletMetadataOriginal } from '../../../bindings/WalletMetadata' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just export this
import { type WalletMetadata, type IWalletListItem, type MetadataWallet } from './types' | ||
|
||
export const getWalletsList = ( | ||
presetList: WalletMetadata[], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we gonna remove this method each selecto will define it for itself
export interface IPolkadotWalletListItem extends WalletMetadata { | ||
recent?: boolean | ||
detected?: boolean | ||
injectedWallet?: PolkadotWalletInjected | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WalletMetadata should be one from bindings
so you almost got it
🤙🤙🤙🤙 STORYBOOK 🤙🤙🤙🤙
|
🤙🤙🤙🤙 EXAMPLE PREVIEW 🤙🤙🤙🤙
|
@@ -163,7 +161,7 @@ export class NightlyConnectAdapter implements Injected { | |||
) | |||
if (!adapter._connectionOptions.disableModal) { | |||
adapter._modal = new NightlyConnectSelectorModal( | |||
adapter.walletsList, | |||
adapter.walletsList as IWalletListItem[], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need as also
why us IWalletListItem
// reject(new Error('Connecting takes too long')) | ||
// TODO we need to have a way to show error on modal |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
show error ?
🤙🤙🤙🤙 STORYBOOK 🤙🤙🤙🤙
|
🤙🤙🤙🤙 EXAMPLE PREVIEW 🤙🤙🤙🤙
|
🤙🤙🤙🤙 EXAMPLE PREVIEW 🤙🤙🤙🤙
|
🤙🤙🤙🤙 STORYBOOK 🤙🤙🤙🤙
|
🤙🤙🤙🤙 STORYBOOK 🤙🤙🤙🤙
|
🤙🤙🤙🤙 EXAMPLE PREVIEW 🤙🤙🤙🤙
|
🤙🤙🤙🤙 STORYBOOK 🤙🤙🤙🤙
|
🤙🤙🤙🤙 EXAMPLE PREVIEW 🤙🤙🤙🤙
|
🤙🤙🤙🤙 STORYBOOK 🤙🤙🤙🤙
|
🤙🤙🤙🤙 EXAMPLE PREVIEW 🤙🤙🤙🤙
|
🤙🤙🤙🤙 EXAMPLE PREVIEW 🤙🤙🤙🤙
|
🤙🤙🤙🤙 STORYBOOK 🤙🤙🤙🤙
|
🤙🤙🤙🤙 EXAMPLE PREVIEW 🤙🤙🤙🤙
|
🤙🤙🤙🤙 STORYBOOK 🤙🤙🤙🤙
|
🤙🤙🤙🤙 STORYBOOK 🤙🤙🤙🤙
|
🤙🤙🤙🤙 EXAMPLE PREVIEW 🤙🤙🤙🤙
|
🤙🤙🤙🤙 EXAMPLE PREVIEW 🤙🤙🤙🤙
|
🤙🤙🤙🤙 STORYBOOK 🤙🤙🤙🤙
|
🤙🤙🤙🤙 STORYBOOK 🤙🤙🤙🤙
|
🤙🤙🤙🤙 EXAMPLE PREVIEW 🤙🤙🤙🤙
|
🤙🤙🤙🤙 EXAMPLE PREVIEW 🤙🤙🤙🤙
|
🤙🤙🤙🤙 STORYBOOK 🤙🤙🤙🤙
|
No description provided.