Skip to content

Commit

Permalink
onboarding buttons only have one clear button
Browse files Browse the repository at this point in the history
  • Loading branch information
reez committed Nov 10, 2024
1 parent dd4ec93 commit 94698cb
Showing 1 changed file with 26 additions and 28 deletions.
54 changes: 26 additions & 28 deletions BDKSwiftExampleWallet/View/OnboardingView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,41 +29,39 @@ struct OnboardingView: View {

Spacer()

Button {
showingScanner = true
} label: {
Image(
systemName: viewModel.words.isEmpty
? "qrcode.viewfinder" : "clear"
)
.contentTransition(.symbolEffect(.replace))
}
.tint(
viewModel.words.isEmpty ? .secondary : .primary
)
.font(.title)
.padding()
if viewModel.words.isEmpty {
Button {
showingScanner = true
} label: {
Image(systemName: "qrcode.viewfinder")
.contentTransition(.symbolEffect(.replace))
}
.tint(.secondary)
.font(.title)
.padding()

Button {
if viewModel.words.isEmpty {
Button {
if let clipboardContent = UIPasteboard.general.string {
viewModel.words = clipboardContent
}
} else {
} label: {
Image(systemName: "arrow.down.square")
.contentTransition(.symbolEffect(.replace))
}
.tint(.secondary)
.font(.title)
.padding()
} else {
Button {
viewModel.words = ""
} label: {
Image(systemName: "clear")
.contentTransition(.symbolEffect(.replace))
}
} label: {
Image(
systemName: viewModel.words.isEmpty
? "arrow.down.square" : "clear"
)
.contentTransition(.symbolEffect(.replace))
.tint(.primary)
.font(.title)
.padding()
}
.tint(
viewModel.words.isEmpty ? .secondary : .primary
)
.font(.title)
.padding()
}

Spacer()
Expand Down

0 comments on commit 94698cb

Please sign in to comment.