From 95573d3af3520ce874e0f32082ddf3cb169c651f Mon Sep 17 00:00:00 2001 From: Radek Novak Date: Wed, 18 Oct 2023 12:39:37 +0200 Subject: [PATCH] Cleanup --- Sample/Example.xcodeproj/project.pbxproj | 6 ++++-- Sample/Example/ExampleApp.swift | 5 ++++- Sources/Web3Modal/Screens/GetAWalletView.swift | 6 +++--- Sources/Web3Modal/Sheets/Web3ModalView.swift | 8 ++++---- 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/Sample/Example.xcodeproj/project.pbxproj b/Sample/Example.xcodeproj/project.pbxproj index 270f8a7..5b688dd 100644 --- a/Sample/Example.xcodeproj/project.pbxproj +++ b/Sample/Example.xcodeproj/project.pbxproj @@ -322,7 +322,7 @@ ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_ENTITLEMENTS = Example/Example.entitlements; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; + CURRENT_PROJECT_VERSION = 2; DEVELOPMENT_ASSET_PATHS = "\"Example/Preview Content\""; DEVELOPMENT_TEAM = W5R8AG9K22; ENABLE_HARDENED_RUNTIME = YES; @@ -330,6 +330,7 @@ GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = Example/Info.plist; INFOPLIST_KEY_CFBundleDisplayName = "Web3Modal Sample"; + INFOPLIST_KEY_NSCameraUsageDescription = "Web3Modal requires access to your phone’s camera."; "INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphoneos*]" = YES; "INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphonesimulator*]" = YES; "INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents[sdk=iphoneos*]" = YES; @@ -363,7 +364,7 @@ ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_ENTITLEMENTS = Example/Example.entitlements; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; + CURRENT_PROJECT_VERSION = 2; DEVELOPMENT_ASSET_PATHS = "\"Example/Preview Content\""; DEVELOPMENT_TEAM = W5R8AG9K22; ENABLE_HARDENED_RUNTIME = YES; @@ -371,6 +372,7 @@ GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = Example/Info.plist; INFOPLIST_KEY_CFBundleDisplayName = "Web3Modal Sample"; + INFOPLIST_KEY_NSCameraUsageDescription = "Web3Modal requires access to your phone’s camera."; "INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphoneos*]" = YES; "INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphonesimulator*]" = YES; "INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents[sdk=iphoneos*]" = YES; diff --git a/Sample/Example/ExampleApp.swift b/Sample/Example/ExampleApp.swift index 53b7386..3ba77aa 100644 --- a/Sample/Example/ExampleApp.swift +++ b/Sample/Example/ExampleApp.swift @@ -2,13 +2,17 @@ import SwiftUI import Web3Modal import WalletConnectSign +#if DEBUG import Atlantis +#endif @main struct ExampleApp: App { init() { + #if DEBUG Atlantis.start() + #endif let metadata = AppMetadata( name: "Web3Modal Swift Dapp", @@ -26,7 +30,6 @@ struct ExampleApp: App { Web3Modal.configure( projectId: projectId, - chainId: Blockchain("eip155:1")!, metadata: metadata ) } diff --git a/Sources/Web3Modal/Screens/GetAWalletView.swift b/Sources/Web3Modal/Screens/GetAWalletView.swift index 86c5926..1fb948f 100644 --- a/Sources/Web3Modal/Screens/GetAWalletView.swift +++ b/Sources/Web3Modal/Screens/GetAWalletView.swift @@ -16,8 +16,8 @@ struct GetAWalletView: View { Text(wallet.name) }) .buttonStyle(W3MListSelectStyle( - imageContent: { - AsyncImage(url: URL(string: "https://api.web3modal.com/getWalletImage/\(wallet.imageId)")) { image in + imageContent: { _ in + AsyncImage(url: URL(string: "https://api.web3modal.com/getWalletImage/\(wallet.imageId)")) { image in image.resizable() } placeholder: { Image.Wallet @@ -32,7 +32,7 @@ struct GetAWalletView: View { Text("Explorer all") }) .buttonStyle(W3MListSelectStyle( - imageContent: { + imageContent: { _ in W3MAllWalletsImage(images: [ .init(image: Image("MockWalletImage", bundle: .UIModule), walletName: "Metamask"), .init(image: Image("MockWalletImage", bundle: .UIModule), walletName: "Trust"), diff --git a/Sources/Web3Modal/Sheets/Web3ModalView.swift b/Sources/Web3Modal/Sheets/Web3ModalView.swift index bad215f..d1df0ce 100644 --- a/Sources/Web3Modal/Sheets/Web3ModalView.swift +++ b/Sources/Web3Modal/Sheets/Web3ModalView.swift @@ -40,7 +40,7 @@ struct Web3ModalView: View { EmptyView() case .getWallet: GetAWalletView( - wallets: Wallet.stubList + wallets: [] ) } } @@ -88,7 +88,7 @@ struct Web3ModalView: View { Text("WalletConnect") }) .buttonStyle(W3MListSelectStyle( - imageContent: { + imageContent: { _ in ZStack { Color.Blue100 @@ -105,7 +105,7 @@ struct Web3ModalView: View { Text("Rainbow") }) .buttonStyle(W3MListSelectStyle( - imageContent: { Image("MockWalletImage", bundle: .UIModule).resizable() } + imageContent: { _ in Image("MockWalletImage", bundle: .UIModule).resizable() } )) Button(action: { @@ -114,7 +114,7 @@ struct Web3ModalView: View { Text("All wallets") }) .buttonStyle(W3MListSelectStyle( - imageContent: { + imageContent: { _ in W3MAllWalletsImage(images: [ .init(image: Image("MockWalletImage", bundle: .UIModule), walletName: "Metamask"), .init(image: Image("MockWalletImage", bundle: .UIModule), walletName: "Trust"),