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

add: lazy loading modal solana selector #98

Merged
merged 29 commits into from
Feb 28, 2024
Merged

Conversation

LukassF
Copy link
Contributor

@LukassF LukassF commented Feb 21, 2024

No description provided.

Copy link

vercel bot commented Feb 21, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
aleph-game ❌ Failed (Inspect) Feb 26, 2024 9:26am

sdk/packages/selector-base/src/types.ts Outdated Show resolved Hide resolved
@@ -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[]
Copy link
Member

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 ?

sdk/packages/selector-polkadot/src/detection.ts Outdated Show resolved Hide resolved
Comment on lines 83 to 99
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'
}
Copy link
Member

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/packages/selector-solana/src/adapter.ts Outdated Show resolved Hide resolved
Comment on lines 7 to 23
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
}
Copy link
Member

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
Copy link
Member

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 ?

Comment on lines 22 to 30
export interface WalletMetadata extends Partial<WalletMetadataOriginal> {
slug: string
name: string
walletType: WalletType
mobile: Deeplink | null
desktop: Deeplink | null
image: Images
}

Copy link
Member

Choose a reason for hiding this comment

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

WHAT ? remove this

Copy link
Contributor Author

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'
Copy link
Member

Choose a reason for hiding this comment

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

just export this

Comment on lines 2 to 5
import { type WalletMetadata, type IWalletListItem, type MetadataWallet } from './types'

export const getWalletsList = (
presetList: WalletMetadata[],
Copy link
Member

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

Comment on lines 34 to 38
export interface IPolkadotWalletListItem extends WalletMetadata {
recent?: boolean
detected?: boolean
injectedWallet?: PolkadotWalletInjected
}
Copy link
Member

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

Copy link

🤙🤙🤙🤙 STORYBOOK 🤙🤙🤙🤙

✅ Preview: https://nightly-connect-storybook-ohcd4aa1e-nightlylabs.vercel.app

Copy link

🤙🤙🤙🤙 EXAMPLE PREVIEW 🤙🤙🤙🤙

✅ Preview: https://connect-8w7z837cu-nightlylabs.vercel.app

@@ -163,7 +161,7 @@ export class NightlyConnectAdapter implements Injected {
)
if (!adapter._connectionOptions.disableModal) {
adapter._modal = new NightlyConnectSelectorModal(
adapter.walletsList,
adapter.walletsList as IWalletListItem[],
Copy link
Member

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

Comment on lines 590 to 591
// reject(new Error('Connecting takes too long'))
// TODO we need to have a way to show error on modal
Copy link
Member

Choose a reason for hiding this comment

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

show error ?

Copy link

🤙🤙🤙🤙 STORYBOOK 🤙🤙🤙🤙

✅ Preview: https://nightly-connect-storybook-qwmhn8fha-nightlylabs.vercel.app

Copy link

🤙🤙🤙🤙 EXAMPLE PREVIEW 🤙🤙🤙🤙

✅ Preview: https://connect-fi8bd6a0h-nightlylabs.vercel.app

Copy link

🤙🤙🤙🤙 EXAMPLE PREVIEW 🤙🤙🤙🤙

✅ Preview: https://connect-lf1vuxs3h-nightlylabs.vercel.app

Copy link

🤙🤙🤙🤙 STORYBOOK 🤙🤙🤙🤙

✅ Preview: https://nightly-connect-storybook-31w9a9pi5-nightlylabs.vercel.app

Copy link

🤙🤙🤙🤙 STORYBOOK 🤙🤙🤙🤙

✅ Preview: https://nightly-connect-storybook-b265nl3e7-nightlylabs.vercel.app

Copy link

🤙🤙🤙🤙 EXAMPLE PREVIEW 🤙🤙🤙🤙

✅ Preview: https://connect-a52nhe86l-nightlylabs.vercel.app

Copy link

🤙🤙🤙🤙 STORYBOOK 🤙🤙🤙🤙

✅ Preview: https://nightly-connect-storybook-ch98wdpzw-nightlylabs.vercel.app

Copy link

🤙🤙🤙🤙 EXAMPLE PREVIEW 🤙🤙🤙🤙

✅ Preview: https://connect-pk7m199u9-nightlylabs.vercel.app

Copy link

🤙🤙🤙🤙 STORYBOOK 🤙🤙🤙🤙

✅ Preview: https://nightly-connect-storybook-maeyizs9w-nightlylabs.vercel.app

Copy link

🤙🤙🤙🤙 EXAMPLE PREVIEW 🤙🤙🤙🤙

✅ Preview: https://connect-mh6m75uua-nightlylabs.vercel.app

Copy link

🤙🤙🤙🤙 EXAMPLE PREVIEW 🤙🤙🤙🤙

✅ Preview: https://connect-jwhinmaqk-nightlylabs.vercel.app

Copy link

🤙🤙🤙🤙 STORYBOOK 🤙🤙🤙🤙

✅ Preview: https://nightly-connect-storybook-cfjo59lxe-nightlylabs.vercel.app

Copy link

🤙🤙🤙🤙 EXAMPLE PREVIEW 🤙🤙🤙🤙

✅ Preview: https://connect-obdse9vp4-nightlylabs.vercel.app

Copy link

🤙🤙🤙🤙 STORYBOOK 🤙🤙🤙🤙

✅ Preview: https://nightly-connect-storybook-kwf4rygtu-nightlylabs.vercel.app

Copy link

🤙🤙🤙🤙 STORYBOOK 🤙🤙🤙🤙

✅ Preview: https://nightly-connect-storybook-7ihozmb87-nightlylabs.vercel.app

Copy link

🤙🤙🤙🤙 EXAMPLE PREVIEW 🤙🤙🤙🤙

✅ Preview: https://connect-lssubnbzq-nightlylabs.vercel.app

Copy link

🤙🤙🤙🤙 EXAMPLE PREVIEW 🤙🤙🤙🤙

✅ Preview: https://connect-kptggqjyv-nightlylabs.vercel.app

Copy link

🤙🤙🤙🤙 STORYBOOK 🤙🤙🤙🤙

✅ Preview: https://nightly-connect-storybook-jofg7u0xe-nightlylabs.vercel.app

Copy link

🤙🤙🤙🤙 STORYBOOK 🤙🤙🤙🤙

✅ Preview: https://nightly-connect-storybook-l1wfgzxik-nightlylabs.vercel.app

Copy link

🤙🤙🤙🤙 EXAMPLE PREVIEW 🤙🤙🤙🤙

✅ Preview: https://connect-91m832cpi-nightlylabs.vercel.app

Copy link

🤙🤙🤙🤙 EXAMPLE PREVIEW 🤙🤙🤙🤙

✅ Preview: https://connect-95ghg6fws-nightlylabs.vercel.app

Copy link

🤙🤙🤙🤙 STORYBOOK 🤙🤙🤙🤙

✅ Preview: https://nightly-connect-storybook-6jxwo03sm-nightlylabs.vercel.app

@NorbertBodziony NorbertBodziony merged commit e4ea8a9 into main Feb 28, 2024
4 checks passed
@NorbertBodziony NorbertBodziony deleted the solana_selector_lazy branch February 28, 2024 11:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants