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

Import Assets from figma #33

Merged
merged 16 commits into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions Sample/Example.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ENTITLEMENTS = Example/Example.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 9;
CURRENT_PROJECT_VERSION = 10;
DEVELOPMENT_ASSET_PATHS = "\"Example/Preview Content\"";
DEVELOPMENT_TEAM = W5R8AG9K22;
ENABLE_HARDENED_RUNTIME = YES;
Expand Down Expand Up @@ -364,7 +364,7 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ENTITLEMENTS = Example/Example.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 9;
CURRENT_PROJECT_VERSION = 10;
DEVELOPMENT_ASSET_PATHS = "\"Example/Preview Content\"";
DEVELOPMENT_TEAM = W5R8AG9K22;
ENABLE_HARDENED_RUNTIME = YES;
Expand Down
4 changes: 4 additions & 0 deletions Sources/Web3Modal/Components/Web3ModalButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ public struct Web3ModalButton: View {
}
}

#if DEBUG

struct Web3Button_Preview: PreviewProvider {
static let store = { () -> Store in
let store = Store()
Expand All @@ -39,3 +41,5 @@ struct Web3Button_Preview: PreviewProvider {
}
}
}

#endif
2 changes: 1 addition & 1 deletion Sources/Web3Modal/Core/Web3Modal.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public class Web3Modal {
}()

struct Config {
static let sdkVersion = "swift-1.0.0-beta.9"
static let sdkVersion = "swift-1.0.0-beta.10"
static let sdkType = "w3m"

let projectId: String
Expand Down
17 changes: 11 additions & 6 deletions Sources/Web3Modal/Screens/AccountView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ struct AccountView: View {
UIPasteboard.general.string = store.session?.accounts.first?.address
store.toast = .init(style: .success, message: "Address copied")
} label: {
Image.LargeCopy
Image.Medium.copy
.resizable()
.frame(width: 12, height: 12)
.foregroundColor(.Foreground250)
Expand Down Expand Up @@ -70,11 +70,11 @@ struct AccountView: View {
variant: .transparent,
size: .s,
leadingImage: {
Image.Compass
Image.Medium.compass
.resizable()
},
trailingImage: {
Image.ExternalLink
Image.Bold.externalLink
.resizable()
}
))
Expand All @@ -94,6 +94,7 @@ struct AccountView: View {
uiImage: store.chainImages[selectedChain.imageId] ?? UIImage()
)
.resizable()
.frame(width: 32, height: 32)
.clipShape(Circle())
}))

Expand All @@ -106,9 +107,13 @@ struct AccountView: View {
Text("Disconnect")
}
.buttonStyle(W3MListSelectStyle(imageContent: { _ in
Image.Disconnect
Image.Medium.disconnect
.resizable()
.frame(width: 22, height: 22)
.frame(width: 14, height: 14)
.padding(Spacing.xxxs)
.frame(width: 32, height: 32)
.background(.GrayGlass010)
.clipShape(Circle())
}))

Spacer()
Expand Down Expand Up @@ -175,7 +180,7 @@ struct AccountView: View {
store.isModalShown = false
}
} label: {
Image.LargeClose
Image.Medium.xMark
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions Sources/Web3Modal/Screens/ChainSwitch/ChainSelectView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ struct ChainSelectView: View {
router.setRoute(Router.NetworkSwitchSubpage.whatIsANetwork)
} label: {
HStack {
Image.QuestionMarkCircle
Image.Bold.questionMarkCircle
.resizable()
.frame(width: 12, height: 12)

Expand Down Expand Up @@ -170,7 +170,7 @@ struct ChainSelectView: View {
Button {
router.goBack()
} label: {
Image.LargeBackward
Image.Medium.chevronLeft
}
}

Expand All @@ -180,7 +180,7 @@ struct ChainSelectView: View {
store.isModalShown = false
}
} label: {
Image.LargeClose
Image.Medium.xMark
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ struct NetworkDetailView: View {
.clipShape(Polygon(count: 6, relativeCornerRadius: 0.25))
.cornerRadius(Radius.m)
.overlay(alignment: .bottomTrailing) {
Image.ToastError
Image.Original.toastError
.padding(2)
.background(Color.Background125)
.clipShape(Circle())
Expand Down Expand Up @@ -70,7 +70,7 @@ struct NetworkDetailView: View {
.foregroundColor(.Blue100)
}
.padding(Spacing.xl)
.buttonStyle(W3MButtonStyle(size: .m, variant: .accent, leftIcon: Image.Retry))
.buttonStyle(W3MButtonStyle(size: .m, variant: .accent, leftIcon: Image.Bold.refresh))
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ final class NetworkDetailViewModel: ObservableObject {
return
}

if error.message.contains("4001") {
self.switchFailed = true
return
}

if !self.triedAddingChain {
guard let from = store.selectedChain else {
return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ struct WhatIsNetworkView: View {
}) {
HStack {
Text("Learn More")
Image.ExternalLink
Image.Bold.externalLink
}
}
.buttonStyle(W3MButtonStyle(size: .m))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ struct ConnectWithQRCode: View {
}, label: {
Text("Copy Link")
})
.buttonStyle(W3MActionEntryStyle(leftIcon: .LargeCopy))
.buttonStyle(W3MActionEntryStyle(leftIcon: .Bold.copy))
.disabled(store.uri == nil)
}
.padding([.top, .horizontal], Spacing.xl)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ struct GetAWalletView: View {
AsyncImage(url: URL(string: "https://api.web3modal.com/getWalletImage/\(wallet.imageId)")) { image in
image.resizable()
} placeholder: {
Image.Wallet
Image.Medium.wallet
}
}
))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ struct WalletDetailView: View {
viewModel.handle(.didTapCopy)
} label: {
HStack {
Image.LargeCopy
Image.Bold.copy
.resizable()
.frame(width: 12, height: 12)
Text("Copy link")
Expand Down Expand Up @@ -95,7 +95,7 @@ struct WalletDetailView: View {
.frame(width: 80, height: 80)
.cornerRadius(Radius.m)
.overlay(alignment: .bottomTrailing) {
Image.ToastError
Image.Original.toastError
.padding(2)
.background(Color.Background125)
.clipShape(Circle())
Expand Down Expand Up @@ -135,7 +135,7 @@ struct WalletDetailView: View {
.font(.small600)
.foregroundColor(.Blue100)
}
.buttonStyle(W3MButtonStyle(size: .m, variant: .accent, leftIcon: Image.Retry))
.buttonStyle(W3MButtonStyle(size: .m, variant: .accent, leftIcon: Image.Bold.refresh))
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ struct WhatIsWalletView: View {
router.setRoute(Router.ConnectingSubpage.getWallet)
}) {
HStack {
Image.Wallet
Image.Bold.wallet
Text("Get a wallet")
}
}
Expand Down
6 changes: 3 additions & 3 deletions Sources/Web3Modal/Sheets/Web3ModalView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,15 @@ struct Web3ModalView: View {
Button(action: {
router.setRoute(Router.ConnectingSubpage.whatIsAWallet)
}, label: {
Image.QuestionMarkCircle
Image.Medium.questionMarkCircle
})
}

private func backButton() -> some View {
Button {
router.goBack()
} label: {
Image.LargeBackward
Image.Medium.chevronLeft
}
}

Expand All @@ -101,7 +101,7 @@ struct Web3ModalView: View {
store.isModalShown = false
}
} label: {
Image.LargeClose
Image.Medium.xMark
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions Sources/Web3ModalUI/Components/W3MActionEntryStyle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -71,22 +71,22 @@ public struct W3MActionEntryStyle: ButtonStyle {
Text("Copy link")
})
.buttonStyle(W3MActionEntryStyle(
leftIcon: Image.LargeCopy
leftIcon: Image.Medium.desktop
))

Button(action: {}, label: {
Text("Copy link")
})
.buttonStyle(W3MActionEntryStyle(
leftIcon: Image.LargeCopy,
leftIcon: Image.Regular.copy,
isPressedOverride: true
))

Button(action: {}, label: {
Text("Copy link")
})
.buttonStyle(W3MActionEntryStyle(
leftIcon: Image.LargeCopy
leftIcon: Image.Regular.copy
))
.disabled(true)
}
Expand Down
32 changes: 16 additions & 16 deletions Sources/Web3ModalUI/Components/W3MButtonStyle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -110,24 +110,24 @@ public struct W3MButtonStyle: ButtonStyle {
Button(action: {}) {
Text("Button")
}
.buttonStyle(W3MButtonStyle(size: .s, leftIcon: .Desktop))
.buttonStyle(W3MButtonStyle(size: .s, leftIcon: .Medium.desktop))

Button(action: {}) {
Text("Button")
}
.buttonStyle(W3MButtonStyle(size: .s, rightIcon: .Phone, isPressedOverride: true))
.buttonStyle(W3MButtonStyle(size: .s, rightIcon: .Medium.mobile, isPressedOverride: true))
}

HStack {
Button(action: {}) {
Text("Button")
}
.buttonStyle(W3MButtonStyle(size: .s, leftIcon: .Desktop, rightIcon: .Phone))
.buttonStyle(W3MButtonStyle(size: .s, leftIcon: .Medium.desktop, rightIcon: .Medium.mobile))

Button(action: {}) {
Text("Button")
}
.buttonStyle(W3MButtonStyle(size: .s, leftIcon: .Desktop, rightIcon: .Phone))
.buttonStyle(W3MButtonStyle(size: .s, leftIcon: .Medium.desktop, rightIcon: .Medium.mobile))
.disabled(true)

Button(action: {}) {
Expand All @@ -151,24 +151,24 @@ public struct W3MButtonStyle: ButtonStyle {
Button(action: {}) {
Text("Button")
}
.buttonStyle(W3MButtonStyle(size: .s, variant: .accent, leftIcon: .Desktop))
.buttonStyle(W3MButtonStyle(size: .s, variant: .accent, leftIcon: .Medium.desktop))

Button(action: {}) {
Text("Button")
}
.buttonStyle(W3MButtonStyle(size: .s, variant: .accent, rightIcon: .Phone, isPressedOverride: true))
.buttonStyle(W3MButtonStyle(size: .s, variant: .accent, rightIcon: .Medium.mobile, isPressedOverride: true))
}

HStack {
Button(action: {}) {
Text("Button")
}
.buttonStyle(W3MButtonStyle(size: .s, variant: .accent, leftIcon: .Desktop, rightIcon: .Phone))
.buttonStyle(W3MButtonStyle(size: .s, variant: .accent, leftIcon: .Medium.desktop, rightIcon: .Medium.mobile))

Button(action: {}) {
Text("Button")
}
.buttonStyle(W3MButtonStyle(size: .s, variant: .accent, leftIcon: .Desktop, rightIcon: .Phone))
.buttonStyle(W3MButtonStyle(size: .s, variant: .accent, leftIcon: .Medium.desktop, rightIcon: .Medium.mobile))
.disabled(true)

Button(action: {}) {
Expand All @@ -195,24 +195,24 @@ public struct W3MButtonStyle: ButtonStyle {
Button(action: {}) {
Text("Button")
}
.buttonStyle(W3MButtonStyle(leftIcon: .Desktop))
.buttonStyle(W3MButtonStyle(leftIcon: .Medium.desktop))

Button(action: {}) {
Text("Button")
}
.buttonStyle(W3MButtonStyle(rightIcon: .Phone, isPressedOverride: true))
.buttonStyle(W3MButtonStyle(rightIcon: .Medium.mobile, isPressedOverride: true))
}

HStack {
Button(action: {}) {
Text("Button")
}
.buttonStyle(W3MButtonStyle(leftIcon: .Desktop, rightIcon: .Phone))
.buttonStyle(W3MButtonStyle(leftIcon: .Medium.desktop, rightIcon: .Medium.mobile))

Button(action: {}) {
Text("Button")
}
.buttonStyle(W3MButtonStyle(leftIcon: .Desktop, rightIcon: .Phone))
.buttonStyle(W3MButtonStyle(leftIcon: .Medium.desktop, rightIcon: .Medium.mobile))
.disabled(true)

Button(action: {}) {
Expand All @@ -236,24 +236,24 @@ public struct W3MButtonStyle: ButtonStyle {
Button(action: {}) {
Text("Button")
}
.buttonStyle(W3MButtonStyle(variant: .accent, leftIcon: .Desktop))
.buttonStyle(W3MButtonStyle(variant: .accent, leftIcon: .Medium.desktop))

Button(action: {}) {
Text("Button")
}
.buttonStyle(W3MButtonStyle(variant: .accent, rightIcon: .Phone, isPressedOverride: true))
.buttonStyle(W3MButtonStyle(variant: .accent, rightIcon: .Medium.mobile, isPressedOverride: true))
}

HStack {
Button(action: {}) {
Text("Button")
}
.buttonStyle(W3MButtonStyle(variant: .accent, leftIcon: .Desktop, rightIcon: .Phone))
.buttonStyle(W3MButtonStyle(variant: .accent, leftIcon: .Medium.desktop, rightIcon: .Medium.mobile))

Button(action: {}) {
Text("Button")
}
.buttonStyle(W3MButtonStyle(variant: .accent, leftIcon: .Desktop, rightIcon: .Phone))
.buttonStyle(W3MButtonStyle(variant: .accent, leftIcon: .Medium.desktop, rightIcon: .Medium.mobile))
.disabled(true)

Button(action: {}) {
Expand Down
Loading