Skip to content

UI tweaks to onboarding screen #243

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

Closed
wants to merge 1 commit into from
Closed
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "BDKLogo.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
23 changes: 18 additions & 5 deletions BDKSwiftExampleWallet/Resources/Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,9 @@
}
}
}
},
"An example bitcoin wallet\npowered by Bitcoin Dev Kit" : {

},
"Are you sure you want to delete the seed?" : {
"localizations" : {
Expand All @@ -245,7 +248,6 @@
}
},
"BDK Wallet" : {
"extractionState" : "stale",
"localizations" : {
"fr" : {
"stringUnit" : {
Expand Down Expand Up @@ -297,8 +299,12 @@
}
}
}
},
"Create wallet" : {

},
"Create Wallet" : {
"extractionState" : "stale",
"localizations" : {
"fr" : {
"stringUnit" : {
Expand Down Expand Up @@ -347,8 +353,12 @@
}
}
}
},
"Esplora server" : {

},
"Esplora Server" : {
"extractionState" : "stale",
"localizations" : {
"fr" : {
"stringUnit" : {
Expand Down Expand Up @@ -524,9 +534,6 @@
},
"Please make sure to write it down and store it securely." : {

},
"powered by Bitcoin Dev Kit" : {

},
"Receive" : {
"localizations" : {
Expand Down Expand Up @@ -583,7 +590,10 @@
"Seed is not synced across devices." : {

},
"Select Bitcoin Network" : {
"Select bitcoin network" : {

},
"Select esplora server" : {

},
"Select Fee" : {
Expand Down Expand Up @@ -611,6 +621,9 @@
},
"Send Transaction" : {

},
"Server" : {

},
"Settings Error" : {
"localizations" : {
Expand Down
113 changes: 53 additions & 60 deletions BDKSwiftExampleWallet/View/OnboardingView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ struct OnboardingView: View {
.ignoresSafeArea()

VStack {

HStack {
Spacer()
Button {
Expand All @@ -48,65 +47,60 @@ struct OnboardingView: View {
.padding()
}

Spacer()

VStack(spacing: 25) {
Image(systemName: "bitcoinsign.circle")
VStack {
Image("BDKLogo")
.resizable()
.foregroundStyle(
.secondary
)
.frame(width: 100, height: 100, alignment: .center)
Text("powered by Bitcoin Dev Kit")
.foregroundStyle(
LinearGradient(
gradient: Gradient(
colors: [
.secondary,
.primary,
]
),
startPoint: .topLeading,
endPoint: .bottomTrailing
)
)
.fontWidth(.expanded)
.fontWeight(.medium)
.frame(width: 150, height: 150, alignment: .center)
.padding(40)
Text("BDK Wallet")
.textStyle(BitcoinTitle1())
Text("An example bitcoin wallet\npowered by Bitcoin Dev Kit")
.textStyle(BitcoinBody3())
.multilineTextAlignment(.center)
.padding()
}
.padding()

Picker(
"Network",
selection: $viewModel.selectedNetwork
) {
Text("Signet").tag(Network.signet)
Text("Testnet").tag(Network.testnet)
}
.pickerStyle(.automatic)
.tint(.primary)
.accessibilityLabel("Select Bitcoin Network")

Picker(
"Esplora Server",
selection: $viewModel.selectedURL
) {
ForEach(viewModel.availableURLs, id: \.self) { url in
Text(
url.replacingOccurrences(
of: "https://",
with: ""
).replacingOccurrences(
of: "http://",
with: ""
)
)
.tag(url)

Spacer()

NavigationStack {
HStack {
Text("Network")
Spacer()
Picker(
"Network",
selection: $viewModel.selectedNetwork
) {
Text("Signet").tag(Network.signet)
Text("Testnet").tag(Network.testnet)
}
.pickerStyle(.automatic)
.tint(.bitcoinOrange)
.accessibilityLabel("Select bitcoin network")
}
}
.pickerStyle(.automatic)
.tint(.primary)
HStack{
Text("Server")
Spacer()
Picker(
"Esplora server",
selection: $viewModel.selectedURL
) {
ForEach(viewModel.availableURLs, id: \.self) { url in
Text(
url.replacingOccurrences(
of: "https://",
with: ""
).replacingOccurrences(
of: "http://",
with: ""
)
)
.tag(url)
}
}
.pickerStyle(.automatic)
.tint(.bitcoinOrange)
.accessibilityLabel("Select esplora server")
}
}.padding(.horizontal, 50)

if viewModel.wordArray != [] {
SeedPhraseView(
Expand All @@ -121,21 +115,20 @@ struct OnboardingView: View {

Spacer()

Button("Create Wallet") {
Button("Create wallet") {
viewModel.createWallet()
}
.buttonStyle(
BitcoinFilled(
tintColor: .primary,
textColor: Color(uiColor: .systemBackground),
tintColor: .bitcoinOrange,
isCapsule: true
)
)
.padding()

}

}
}.padding(.bottom, 20)
.alert(isPresented: $showingOnboardingViewErrorAlert) {
Alert(
title: Text("Onboarding Error"),
Expand Down
Loading