Skip to content

Commit

Permalink
chore: remove "upgrade to smart account" screen (#3375)
Browse files Browse the repository at this point in the history
  • Loading branch information
magiziz authored Dec 4, 2024
1 parent 76acc12 commit 26e9f12
Show file tree
Hide file tree
Showing 13 changed files with 65 additions and 295 deletions.
20 changes: 20 additions & 0 deletions .changeset/angry-phones-hunt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
'@reown/appkit-scaffold-ui': patch
'@reown/appkit-adapter-ethers': patch
'@reown/appkit-adapter-ethers5': patch
'@reown/appkit-adapter-solana': patch
'@reown/appkit-adapter-wagmi': patch
'@reown/appkit': patch
'@reown/appkit-utils': patch
'@reown/appkit-cdn': patch
'@reown/appkit-common': patch
'@reown/appkit-core': patch
'@reown/appkit-experimental': patch
'@reown/appkit-polyfills': patch
'@reown/appkit-siwe': patch
'@reown/appkit-siwx': patch
'@reown/appkit-ui': patch
'@reown/appkit-wallet': patch
---

Removed upgrade to smart account screen
1 change: 0 additions & 1 deletion packages/core/src/controllers/RouterController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ export interface RouterControllerState {
| 'UpdateEmailPrimaryOtp'
| 'UpdateEmailSecondaryOtp'
| 'UpgradeEmailWallet'
| 'UpgradeToSmartAccount'
| 'WalletReceive'
| 'WalletSend'
| 'WalletSendPreview'
Expand Down
1 change: 0 additions & 1 deletion packages/scaffold-ui-new/exports/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ export * from '../src/views/w3m-email-verify-otp-view/index.js'
export * from '../src/views/w3m-email-verify-device-view/index.js'
export * from '../src/views/w3m-approve-transaction-view/index.js'
export * from '../src/views/w3m-upgrade-wallet-view/index.js'
export * from '../src/views/w3m-upgrade-to-smart-account-view/index.js'
export * from '../src/views/w3m-update-email-wallet-view/index.js'
export * from '../src/views/w3m-update-email-primary-otp-view/index.js'
export * from '../src/views/w3m-update-email-secondary-otp-view/index.js'
Expand Down
2 changes: 0 additions & 2 deletions packages/scaffold-ui-new/src/modal/w3m-router/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,6 @@ export class W3mRouter extends LitElement {
return html`<w3m-onramp-fiat-select-view></w3m-onramp-fiat-select-view>`
case 'UpgradeEmailWallet':
return html`<w3m-upgrade-wallet-view></w3m-upgrade-wallet-view>`
case 'UpgradeToSmartAccount':
return html`<w3m-upgrade-to-smart-account-view></w3m-upgrade-to-smart-account-view>`
case 'UpdateEmailWallet':
return html`<w3m-update-email-wallet-view></w3m-update-email-wallet-view>`
case 'UpdateEmailPrimaryOtp':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,12 @@ export class W3mAccountWalletFeaturesWidget extends LitElement {

@state() private profileName = AccountController.state.profileName

@state() private smartAccountDeployed = AccountController.state.smartAccountDeployed

@state() private network = ChainController.state.activeCaipNetwork

@state() private currentTab = AccountController.state.currentTab

@state() private tokenBalance = AccountController.state.tokenBalance

@state() private preferredAccountType = AccountController.state.preferredAccountType

@state() private features = OptionsController.state.features

public constructor() {
Expand All @@ -60,8 +56,6 @@ export class W3mAccountWalletFeaturesWidget extends LitElement {
this.profileName = val.profileName
this.currentTab = val.currentTab
this.tokenBalance = val.tokenBalance
this.smartAccountDeployed = val.smartAccountDeployed
this.preferredAccountType = val.preferredAccountType
} else {
ModalController.close()
}
Expand Down Expand Up @@ -97,7 +91,6 @@ export class W3mAccountWalletFeaturesWidget extends LitElement {
gap="m"
>
${this.network && html`<wui-network-icon .network=${this.network}></wui-network-icon>`}
${this.activateAccountTemplate()}
<wui-profile-button
@click=${this.onProfileButtonClick.bind(this)}
address=${ifDefined(this.address)}
Expand Down Expand Up @@ -195,24 +188,6 @@ export class W3mAccountWalletFeaturesWidget extends LitElement {
return html`<wui-balance dollars="0" pennies="00"></wui-balance>`
}

private activateAccountTemplate() {
const smartAccountEnabled = ChainController.checkIfSmartAccountEnabled()

if (
!smartAccountEnabled ||
this.preferredAccountType !== W3mFrameRpcConstants.ACCOUNT_TYPES.EOA ||
this.smartAccountDeployed
) {
return null
}

return html` <wui-promo
text=${'Activate your account'}
@click=${this.onUpdateToSmartAccount.bind(this)}
data-testid="activate-smart-account-promo"
></wui-promo>`
}

private onTabChange(index: number) {
AccountController.setCurrentTab(index)
}
Expand Down Expand Up @@ -265,10 +240,6 @@ export class W3mAccountWalletFeaturesWidget extends LitElement {
})
RouterController.push('WalletSend')
}

private onUpdateToSmartAccount() {
RouterController.push('UpgradeToSmartAccount')
}
}

declare global {
Expand Down
4 changes: 1 addition & 3 deletions packages/scaffold-ui-new/src/partials/w3m-header/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ function headings() {
Transactions: 'Activity',
UnsupportedChain: 'Switch Network',
UpgradeEmailWallet: 'Upgrade your Wallet',
UpgradeToSmartAccount: undefined,
UpdateEmailWallet: 'Edit Email',
UpdateEmailPrimaryOtp: 'Confirm Current Email',
UpdateEmailSecondaryOtp: 'Confirm New Email',
Expand Down Expand Up @@ -211,11 +210,10 @@ export class W3mHeader extends LitElement {
const { view } = RouterController.state
const isConnectHelp = view === 'Connect'
const isApproveTransaction = view === 'ApproveTransaction'
const isUpgradeToSmartAccounts = view === 'UpgradeToSmartAccount'
const isConnectingSIWEView = view === 'ConnectingSiwe'
const isAccountView = view === 'Account'

const shouldHideBack = isApproveTransaction || isUpgradeToSmartAccounts || isConnectingSIWEView
const shouldHideBack = isApproveTransaction || isConnectingSIWEView

if (isAccountView) {
return html`<wui-select
Expand Down

This file was deleted.

1 change: 0 additions & 1 deletion packages/scaffold-ui/exports/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ export * from '../src/views/w3m-email-verify-otp-view/index.js'
export * from '../src/views/w3m-email-verify-device-view/index.js'
export * from '../src/views/w3m-approve-transaction-view/index.js'
export * from '../src/views/w3m-upgrade-wallet-view/index.js'
export * from '../src/views/w3m-upgrade-to-smart-account-view/index.js'
export * from '../src/views/w3m-update-email-wallet-view/index.js'
export * from '../src/views/w3m-update-email-primary-otp-view/index.js'
export * from '../src/views/w3m-update-email-secondary-otp-view/index.js'
Expand Down
2 changes: 0 additions & 2 deletions packages/scaffold-ui/src/modal/w3m-router/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,6 @@ export class W3mRouter extends LitElement {
return html`<w3m-onramp-fiat-select-view></w3m-onramp-fiat-select-view>`
case 'UpgradeEmailWallet':
return html`<w3m-upgrade-wallet-view></w3m-upgrade-wallet-view>`
case 'UpgradeToSmartAccount':
return html`<w3m-upgrade-to-smart-account-view></w3m-upgrade-to-smart-account-view>`
case 'UpdateEmailWallet':
return html`<w3m-update-email-wallet-view></w3m-update-email-wallet-view>`
case 'UpdateEmailPrimaryOtp':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,12 @@ export class W3mAccountWalletFeaturesWidget extends LitElement {

@state() private profileName = AccountController.state.profileName

@state() private smartAccountDeployed = AccountController.state.smartAccountDeployed

@state() private network = ChainController.state.activeCaipNetwork

@state() private currentTab = AccountController.state.currentTab

@state() private tokenBalance = AccountController.state.tokenBalance

@state() private preferredAccountType = AccountController.state.preferredAccountType

@state() private features = OptionsController.state.features

public constructor() {
Expand All @@ -60,8 +56,6 @@ export class W3mAccountWalletFeaturesWidget extends LitElement {
this.profileName = val.profileName
this.currentTab = val.currentTab
this.tokenBalance = val.tokenBalance
this.smartAccountDeployed = val.smartAccountDeployed
this.preferredAccountType = val.preferredAccountType
} else {
ModalController.close()
}
Expand Down Expand Up @@ -95,9 +89,9 @@ export class W3mAccountWalletFeaturesWidget extends LitElement {
.padding=${['0', 'xl', 'm', 'xl'] as const}
alignItems="center"
gap="m"
data-testid="w3m-account-wallet-features-widget"
>
${this.network && html`<wui-network-icon .network=${this.network}></wui-network-icon>`}
${this.activateAccountTemplate()}
<wui-profile-button
@click=${this.onProfileButtonClick.bind(this)}
address=${ifDefined(this.address)}
Expand Down Expand Up @@ -195,24 +189,6 @@ export class W3mAccountWalletFeaturesWidget extends LitElement {
return html`<wui-balance dollars="0" pennies="00"></wui-balance>`
}

private activateAccountTemplate() {
const smartAccountEnabled = ChainController.checkIfSmartAccountEnabled()

if (
!smartAccountEnabled ||
this.preferredAccountType !== W3mFrameRpcConstants.ACCOUNT_TYPES.EOA ||
this.smartAccountDeployed
) {
return null
}

return html` <wui-promo
text=${'Activate your account'}
@click=${this.onUpdateToSmartAccount.bind(this)}
data-testid="activate-smart-account-promo"
></wui-promo>`
}

private onTabChange(index: number) {
AccountController.setCurrentTab(index)
}
Expand Down Expand Up @@ -265,10 +241,6 @@ export class W3mAccountWalletFeaturesWidget extends LitElement {
})
RouterController.push('WalletSend')
}

private onUpdateToSmartAccount() {
RouterController.push('UpgradeToSmartAccount')
}
}

declare global {
Expand Down
4 changes: 1 addition & 3 deletions packages/scaffold-ui/src/partials/w3m-header/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ function headings() {
Transactions: 'Activity',
UnsupportedChain: 'Switch Network',
UpgradeEmailWallet: 'Upgrade your Wallet',
UpgradeToSmartAccount: undefined,
UpdateEmailWallet: 'Edit Email',
UpdateEmailPrimaryOtp: 'Confirm Current Email',
UpdateEmailSecondaryOtp: 'Confirm New Email',
Expand Down Expand Up @@ -211,11 +210,10 @@ export class W3mHeader extends LitElement {
const { view } = RouterController.state
const isConnectHelp = view === 'Connect'
const isApproveTransaction = view === 'ApproveTransaction'
const isUpgradeToSmartAccounts = view === 'UpgradeToSmartAccount'
const isConnectingSIWEView = view === 'ConnectingSiwe'
const isAccountView = view === 'Account'

const shouldHideBack = isApproveTransaction || isUpgradeToSmartAccounts || isConnectingSIWEView
const shouldHideBack = isApproveTransaction || isConnectingSIWEView

if (isAccountView) {
return html`<wui-select
Expand Down
Loading

0 comments on commit 26e9f12

Please sign in to comment.