From f18a0b66e08c9b349d8e9bd64bdb637052059c01 Mon Sep 17 00:00:00 2001 From: Swift Coder Date: Mon, 16 Dec 2024 10:22:55 -0500 Subject: [PATCH] Fix non scrollable wallet screen Changelog-Fixed: Fix non scrollable wallet screen Signed-off-by: Swift Coder --- damus/Views/Wallet/WalletView.swift | 84 +++++++++++++++-------------- 1 file changed, 43 insertions(+), 41 deletions(-) diff --git a/damus/Views/Wallet/WalletView.swift b/damus/Views/Wallet/WalletView.swift index 0e6ca27ec..949f9fb62 100644 --- a/damus/Views/Wallet/WalletView.swift +++ b/damus/Views/Wallet/WalletView.swift @@ -19,42 +19,24 @@ struct WalletView: View { } func MainWalletView(nwc: WalletConnectURL) -> some View { - VStack { - if !damus_state.settings.nozaps { - SupportDamus - - Spacer() - } - - VStack(spacing: 5) { - VStack(spacing: 10) { - Text("Wallet Relay", comment: "Label text indicating that below it is the information about the wallet relay.") - .fontWeight(.semibold) - .padding(.top) - - Divider() - - RelayView(state: damus_state, relay: nwc.relay, showActionButtons: .constant(false), recommended: false) + ScrollView { + VStack(spacing: 35) { + if !damus_state.settings.nozaps { + SupportDamus + .padding(.vertical, 20) } - .frame(maxWidth: .infinity, minHeight: 125, alignment: .top) - .padding(.horizontal, 10) - .background(DamusColors.neutral1) - .cornerRadius(10) - .overlay( - RoundedRectangle(cornerRadius: 10) - .stroke(DamusColors.neutral3, lineWidth: 1) - ) - if let lud16 = nwc.lud16 { + VStack(spacing: 5) { VStack(spacing: 10) { - Text("Wallet Address", comment: "Label text indicating that below it is the wallet address.") + Text("Wallet Relay", comment: "Label text indicating that below it is the information about the wallet relay.") .fontWeight(.semibold) + .padding(.top) Divider() - Text(lud16) + RelayView(state: damus_state, relay: nwc.relay, showActionButtons: .constant(false), recommended: false) } - .frame(maxWidth: .infinity, minHeight: 75, alignment: .center) + .frame(maxWidth: .infinity, minHeight: 125, alignment: .top) .padding(.horizontal, 10) .background(DamusColors.neutral1) .cornerRadius(10) @@ -62,23 +44,43 @@ struct WalletView: View { RoundedRectangle(cornerRadius: 10) .stroke(DamusColors.neutral3, lineWidth: 1) ) + + if let lud16 = nwc.lud16 { + VStack(spacing: 10) { + Text("Wallet Address", comment: "Label text indicating that below it is the wallet address.") + .fontWeight(.semibold) + + Divider() + + Text(lud16) + } + .frame(maxWidth: .infinity, minHeight: 75, alignment: .center) + .padding(.horizontal, 10) + .background(DamusColors.neutral1) + .cornerRadius(10) + .overlay( + RoundedRectangle(cornerRadius: 10) + .stroke(DamusColors.neutral3, lineWidth: 1) + ) + } } - } - - Button(action: { - self.model.disconnect() - }) { - HStack { - Text("Disconnect Wallet", comment: "Text for button to disconnect from Nostr Wallet Connect lightning wallet.") + + Button(action: { + self.model.disconnect() + }) { + HStack { + Text("Disconnect Wallet", comment: "Text for button to disconnect from Nostr Wallet Connect lightning wallet.") + } + .frame(minWidth: 300, maxWidth: .infinity, maxHeight: 18, alignment: .center) } - .frame(minWidth: 300, maxWidth: .infinity, maxHeight: 18, alignment: .center) + .buttonStyle(GradientButtonStyle()) + .padding(.bottom, 50) // Bottom padding while Scrolling + } - .buttonStyle(GradientButtonStyle()) - + .navigationTitle(NSLocalizedString("Wallet", comment: "Navigation title for Wallet view")) + .navigationBarTitleDisplayMode(.inline) + .padding() } - .navigationTitle(NSLocalizedString("Wallet", comment: "Navigation title for Wallet view")) - .navigationBarTitleDisplayMode(.inline) - .padding() } func donation_binding() -> Binding {