Skip to content

Commit

Permalink
ios: unify action buttons usage, remove PaginatedScrollView and unuse…
Browse files Browse the repository at this point in the history
…d SFSymbols
  • Loading branch information
krodak committed Nov 28, 2023
1 parent a2cae4a commit 34c13e1
Show file tree
Hide file tree
Showing 42 changed files with 108 additions and 364 deletions.
16 changes: 0 additions & 16 deletions ios/PolkadotVault.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -270,10 +270,6 @@
6DDD737C2940629D00F04CE7 /* LogsMoreActionsModal.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6DDD737B2940629D00F04CE7 /* LogsMoreActionsModal.swift */; };
6DDEF13228AE6039004CA2FD /* signer.udl in Sources */ = {isa = PBXBuildFile; fileRef = 6DDEF12E28AE5EDA004CA2FD /* signer.udl */; };
6DDEF13C28AE7A30004CA2FD /* ApplicationInformation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6DDEF13B28AE7A30004CA2FD /* ApplicationInformation.swift */; };
6DDEF13F28AE7C57004CA2FD /* PrimaryButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6DDEF13E28AE7C57004CA2FD /* PrimaryButton.swift */; };
6DDEF14328AE8794004CA2FD /* SecondaryButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6DDEF14228AE8794004CA2FD /* SecondaryButton.swift */; };
6DDEF14528AE87A7004CA2FD /* EmptyButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6DDEF14428AE87A7004CA2FD /* EmptyButton.swift */; };
6DDF439729878D0E00881AFF /* PaginatedScrollView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6DDF439629878D0E00881AFF /* PaginatedScrollView.swift */; };
6DDF439C29879D3900881AFF /* SecondaryFont.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6DDF439B29879D3900881AFF /* SecondaryFont.swift */; };
6DDF439D2987A23B00881AFF /* Unbounded-Black.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 6DDF439829879D1D00881AFF /* Unbounded-Black.ttf */; };
6DDF439E2987A23E00881AFF /* Unbounded-Bold.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 6DDF439A29879D1D00881AFF /* Unbounded-Bold.ttf */; };
Expand Down Expand Up @@ -619,10 +615,6 @@
6DDEF13328AE6542004CA2FD /* signerFFI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = signerFFI.h; sourceTree = "<group>"; };
6DDEF13428AE6542004CA2FD /* signer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = signer.swift; sourceTree = "<group>"; };
6DDEF13B28AE7A30004CA2FD /* ApplicationInformation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ApplicationInformation.swift; sourceTree = "<group>"; };
6DDEF13E28AE7C57004CA2FD /* PrimaryButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PrimaryButton.swift; sourceTree = "<group>"; };
6DDEF14228AE8794004CA2FD /* SecondaryButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SecondaryButton.swift; sourceTree = "<group>"; };
6DDEF14428AE87A7004CA2FD /* EmptyButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EmptyButton.swift; sourceTree = "<group>"; };
6DDF439629878D0E00881AFF /* PaginatedScrollView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PaginatedScrollView.swift; sourceTree = "<group>"; };
6DDF439829879D1D00881AFF /* Unbounded-Black.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Unbounded-Black.ttf"; sourceTree = "<group>"; };
6DDF439929879D1D00881AFF /* Unbounded-Regular.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Unbounded-Regular.ttf"; sourceTree = "<group>"; };
6DDF439A29879D1D00881AFF /* Unbounded-Bold.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Unbounded-Bold.ttf"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -747,7 +739,6 @@
2D7A7BC826BA97AE0053C1E0 /* Components */ = {
isa = PBXGroup;
children = (
6DDF439629878D0E00881AFF /* PaginatedScrollView.swift */,
6D749C5E2A69C5F00064D7E5 /* Identicons */,
6DEB18ED2A0BAFA60013995E /* Progress */,
6D10EACC297114550063FB71 /* DerivationPathComponents.swift */,
Expand Down Expand Up @@ -1735,9 +1726,6 @@
6DDEF13D28AE7C4B004CA2FD /* Buttons */ = {
isa = PBXGroup;
children = (
6DDEF13E28AE7C57004CA2FD /* PrimaryButton.swift */,
6DDEF14228AE8794004CA2FD /* SecondaryButton.swift */,
6DDEF14428AE87A7004CA2FD /* EmptyButton.swift */,
6D95E97228B4F42300E28A11 /* ActionButton.swift */,
6D932CDE292E05CB008AD883 /* InlineButton.swift */,
6DC5643C28B91EFE003D540B /* NavbarButton.swift */,
Expand Down Expand Up @@ -2135,7 +2123,6 @@
6D199CA2292A8EB300E79113 /* TransactionSummaryModels.swift in Sources */,
6D7129222952B7800048558C /* NetworkSettingsDetails.swift in Sources */,
2DA5F86327566C3600D8DD29 /* TCCall.swift in Sources */,
6DDEF14328AE8794004CA2FD /* SecondaryButton.swift in Sources */,
6D0FA73B2907010E00E45BA6 /* ExportMultipleKeysModal+ViewModel.swift in Sources */,
6DC0FC98296695D000A45883 /* SeedKeysPreview+Helpers.swift in Sources */,
6D9921B7297FB471004891B6 /* PasswordProtectionStatePublisher.swift in Sources */,
Expand Down Expand Up @@ -2238,13 +2225,11 @@
6D16685728F530F4008C664A /* CaptureDeviceConfigurator.swift in Sources */,
6D5DCA032A7CFA2E0050B101 /* ExportKeysSelectionModal.swift in Sources */,
6D8045D928D0761E00237F8C /* QRCodeAddressFooterView.swift in Sources */,
6DDEF14528AE87A7004CA2FD /* EmptyButton.swift in Sources */,
2DA5F8332756653B00D8DD29 /* CameraPreview.swift in Sources */,
6DDD737A29404E5000F04CE7 /* Event+EntryType.swift in Sources */,
6D932CDF292E05CB008AD883 /* InlineButton.swift in Sources */,
6D971AC72942465C00121A36 /* QrData+Helpers.swift in Sources */,
6DDD737C2940629D00F04CE7 /* LogsMoreActionsModal.swift in Sources */,
6DDF439729878D0E00881AFF /* PaginatedScrollView.swift in Sources */,
6DA08B8E29B615390027CFCB /* RecoverKeySetNameView.swift in Sources */,
2DAA82A727885E73002917C0 /* TCNameValueTemplate.swift in Sources */,
6D5801E7289937C0006C41D8 /* ConnectivityMonitoringAssembler.swift in Sources */,
Expand Down Expand Up @@ -2343,7 +2328,6 @@
2DAA829D27885A67002917C0 /* TCMeta.swift in Sources */,
2DA5F86027566C3600D8DD29 /* TCAuthorPublicKey.swift in Sources */,
6D07D370292B40D2001A0B79 /* TransactionSummaryView.swift in Sources */,
6DDEF13F28AE7C57004CA2FD /* PrimaryButton.swift in Sources */,
6D10EAC5296F16EE0063FB71 /* DerivationPathNameView.swift in Sources */,
6D4C0753289AC36100B2EE48 /* Fonts.swift in Sources */,
6D199C9F292A8D1100E79113 /* TransactionDetailsView.swift in Sources */,
Expand Down
2 changes: 1 addition & 1 deletion ios/PolkadotVault/Components/Buttons/ActionButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ struct ActionButton: View {
private var style: ActionButtonStyle

init(
action: @escaping @autoclosure () -> Void,
action: @escaping () -> Void,
text: LocalizedStringKey,
style: ActionButtonStyle
) {
Expand Down
32 changes: 0 additions & 32 deletions ios/PolkadotVault/Components/Buttons/EmptyButton.swift

This file was deleted.

1 change: 0 additions & 1 deletion ios/PolkadotVault/Components/Buttons/NavbarButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ struct NavbarButtonStyle: ButtonStyle {
struct NavbarButton: View {
private let action: () -> Void
private let icon: Image

@State var isDisabled: Bool

init(
Expand Down
32 changes: 0 additions & 32 deletions ios/PolkadotVault/Components/Buttons/PrimaryButton.swift

This file was deleted.

32 changes: 0 additions & 32 deletions ios/PolkadotVault/Components/Buttons/SecondaryButton.swift

This file was deleted.

116 changes: 0 additions & 116 deletions ios/PolkadotVault/Components/PaginatedScrollView.swift

This file was deleted.

45 changes: 0 additions & 45 deletions ios/PolkadotVault/Design/SFSymbols.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,55 +12,10 @@ import SwiftUI
/// Refer to https://developer.apple.com/sf-symbols/ for currently available combinations
enum SFSymbols: String {
case lock
case minus
case plus
case rectangle
case signature
case square
case shield
case trash
case viewfinder
case wifi
case xmark
}

/// Possibly available system variants for `SFSymbol`.
///
/// Refer to https://developer.apple.com/sf-symbols/ for currently available combinations
enum SFSymbolVariant: String {
case circle
case down
case exclamationmark
case fill
case forward
case left
case grid
case medium
case magnifyingglass
case oneByTwo = "1x2"
case portrait
case rectangle
case shield
case square
case slash
case text
case triangle
case trianglebadge
case viewfinder
}

extension Image {
init(_ symbol: SFSymbols) {
self.init(systemName: symbol.rawValue)
}

init(_ symbol: SFSymbols, variant: SFSymbolVariant?) {
self.init(symbol, variants: [variant])
}

init(_ symbol: SFSymbols, variants: [SFSymbolVariant?]) {
let name: String = [[symbol.rawValue], variants.compactMap(\.?.rawValue)]
.flatMap { $0 }.joined(separator: ".")
self.init(systemName: name)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,12 @@ struct HorizontalActionsBottomModal: View {
.foregroundColor(.textAndIconsSecondary)
}
HStack {
SecondaryButton(
action: animateDismissal(dismissAction()),
text: viewModel.dismissActionLabel
ActionButton(
action: { animateDismissal(dismissAction()) },
text: viewModel.dismissActionLabel,
style: .secondary()
)
PrimaryButton(
ActionButton(
action: { animateDismissal(mainAction()) },
text: viewModel.mainActionLabel,
style: viewModel.mainActionStyle
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,15 @@ struct VerticalActionsBottomModal: View {
.foregroundColor(.textAndIconsSecondary)
}
VStack {
PrimaryButton(
ActionButton(
action: { animateDismissal(mainAction()) },
text: viewModel.mainActionLabel,
style: viewModel.mainActionStyle
)
SecondaryButton(
action: animateDismissal(dismissAction()),
text: viewModel.dismissActionLabel
ActionButton(
action: { animateDismissal(dismissAction()) },
text: viewModel.dismissActionLabel,
style: .secondary()
)
}
.padding(.top, Spacing.extraSmall)
Expand Down
Loading

0 comments on commit 34c13e1

Please sign in to comment.