taler-ios

iOS apps for GNU Taler (wallet)
Log | Files | Refs | README | LICENSE

commit ced4d03919aaa4f3295b5ad0446d00893208f89a
parent 6482d336af029312de847f0f654e66b895551fc8
Author: Marc Stibane <marc@taler.net>
Date:   Tue, 28 Nov 2023 11:08:02 +0100

Exchange: ToS

Diffstat:
MTalerWallet1/Views/Exchange/ExchangeRowView.swift | 11++++++++++-
MTalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawTOSView.swift | 12+++++++++---
2 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/TalerWallet1/Views/Exchange/ExchangeRowView.swift b/TalerWallet1/Views/Exchange/ExchangeRowView.swift @@ -42,7 +42,7 @@ struct ExchangeRowView: View { HStack(spacing: 0) { // can't use the built in Label because it adds the accessory arrow Text(baseURL.trimURL()) - .accessibilityFont(.body) + .accessibilityFont(.headline) NavigationLink(destination: LazyView { EmptyView() // TODO: Deposit }, tag: 1, selection: $buttonSelected @@ -54,6 +54,15 @@ struct ExchangeRowView: View { }, tag: 2, selection: $buttonSelected ) { EmptyView() }.frame(width: 0).opacity(0) }.listRowSeparator(.hidden) + NavigationLink(destination: LazyView { + WithdrawTOSView(stack: stack.push(), + exchangeBaseUrl: baseURL, + viewID: VIEW_WITHDRAW_TOS, + acceptAction: nil) // pop back to here + }) { + Text("Terms of Service") // VIEW_WITHDRAW_TOS + .accessibilityFont(.body) + }.listRowSeparator(.hidden) let depositTitle = iconOnly ? depositTitle0 : depositTitle1 let withdrawTitle = iconOnly ? withdrawTitle0 : withdrawTitle1 diff --git a/TalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawTOSView.swift b/TalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawTOSView.swift @@ -110,9 +110,15 @@ extension WithdrawTOSView { } } }.safeAreaInset(edge: .bottom) { - Button(String(localized: "Accept Terms of Service", comment: "Button"), action: acceptAction) - .buttonStyle(TalerButtonStyle(type: .prominent)) - .padding(.horizontal) + let currentEtag = tos.currentEtag + let showButton = tos.acceptedEtag == nil ? true + : tos.acceptedEtag! == tos.currentEtag ? false + : true + if showButton { + Button(String(localized: "Accept Terms of Service", comment: "Button"), action: acceptAction) + .buttonStyle(TalerButtonStyle(type: .prominent)) + .padding(.horizontal) + } } .listStyle(myListStyle.style).anyView } else {