Skip to content

Commit

Permalink
Allow to drag Submit Transaction modal on failure (#1250)
Browse files Browse the repository at this point in the history
  • Loading branch information
matiasbzurovski committed Jul 26, 2024
1 parent 3e66941 commit 8a11957
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ extension Completion {
.foregroundColor(.app.blue1)
}
.textStyle(.body1Header)
.padding(.top, .medium3)
.padding(.top, .small2)
}

Spacer()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ extension SubmitTransaction {
WithNavigationBar {
viewStore.send(.closeButtonTapped)
} content: {
VStack(spacing: .medium3) {
VStack(spacing: .zero) {
Spacer()
if viewStore.status.failed {
Image(.errorLarge)
Expand All @@ -78,6 +78,7 @@ extension SubmitTransaction {
.textStyle(.sheetTitle)
.multilineTextAlignment(.center)
.padding(.horizontal, .medium2)
.padding(.top, .medium3)
} else {
Image(asset: AssetResource.transactionInProgress)
.opacity(opacity)
Expand All @@ -99,6 +100,7 @@ extension SubmitTransaction {
.textStyle(.body1Regular)
.multilineTextAlignment(.center)
.padding(.horizontal, .medium2)
.padding(.top, .medium3)

HStack {
Text(L10n.TransactionReview.SubmitTransaction.txID)
Expand All @@ -108,6 +110,7 @@ extension SubmitTransaction {
}
.textStyle(.body1Header)
.padding(.horizontal, .medium2)
.padding(.top, .small2)

Spacer()
if viewStore.status.failed, viewStore.showSwitchBackToBrowserMessage {
Expand All @@ -128,9 +131,19 @@ extension SubmitTransaction {
.alert(store: store.scope(state: \.$dismissTransactionAlert, action: { .view(.dismissTransactionAlert($0)) }))
.interactiveDismissDisabled(viewStore.dismissalDisabled)
.presentationDragIndicator(.visible)
.presentationDetents([.fraction(0.66)])
.presentationDetents(viewStore.presentationDetents)
.presentationBackground(.blur)
}
}
}
}

private extension ViewStoreOf<SubmitTransaction> {
var presentationDetents: Set<PresentationDetent> {
if self.status.failed {
[.fraction(0.66), .large]
} else {
[.fraction(0.66)]
}
}
}

0 comments on commit 8a11957

Please sign in to comment.