Skip to content

Commit

Permalink
Make mionr UI changes to select UTXO view
Browse files Browse the repository at this point in the history
  • Loading branch information
esen committed May 21, 2024
1 parent cf95eff commit 0148e2c
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ struct EvmFeeEstimator {
return .init(gasLimit: gasLimit, surchargedGasLimit: surchargedGasLimit, l1Fee: l1Fee)
}

func estimateFee(evmKitWrapper: EvmKitWrapper, transactionData: TransactionData, gasPriceData: GasPriceData, predefinedGasLimit: Int? = nil) async throws -> EvmFeeData {
func estimateFee(evmKitWrapper: EvmKitWrapper, transactionData: TransactionData, gasPriceData: GasPriceData, predefinedGasLimit _: Int? = nil) async throws -> EvmFeeData {
do {
return try await _estimateFee(evmKitWrapper: evmKitWrapper, transactionData: transactionData, gasPrice: gasPriceData.userDefined)
} catch {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ struct OutputSelectorView2: View {
}

var body: some View {
ScrollableThemeView {
VStack(spacing: 0) {
ThemeView {
VStack {
ListSection {
ListRow(minHeight: .heightDoubleLineCell) {
HStack(spacing: .margin8) {
Expand All @@ -32,27 +32,34 @@ struct OutputSelectorView2: View {
}
.padding(EdgeInsets(top: .margin12, leading: .margin16, bottom: .margin12, trailing: .margin16))

ListSection {
ListRow {
HStack(spacing: 0) {
Button(action: {
viewModel.selectUnselectAll()
}) {
Text(viewModel.allSelected ? "send.unselect_all".localized : "send.select_all".localized)
}
.buttonStyle(SecondaryButtonStyle())
ScrollView {
ListSection {
ForEach(viewModel.outputsViewItems) { viewItem in
output(viewItem: viewItem)
}
}
.themeListStyle(.transparent)
}

HorizontalDivider(color: .themeSteel10, height: .heightOneDp)

Spacer()
HStack {
Button(action: {
viewModel.unselectAll()
}) {
Text("send.unselect_all".localized).themeBody(color: viewModel.selectedSet.isEmpty ? .themeGray50 : .themeJacob)
}

ForEach(viewModel.outputsViewItems) { viewItem in
output(viewItem: viewItem)
Spacer()

Button(action: {
viewModel.selectAll()
}) {
Text("send.select_all".localized).themeBody(color: viewModel.allSelected ? .themeGray50 : .themeJacob, alignment: .trailing)
}
}
.themeListStyle(.transparent)
.padding(EdgeInsets(top: .margin12, leading: .margin16, bottom: CGFloat(43), trailing: .margin16))
}
.padding(EdgeInsets(top: .margin12, leading: 0, bottom: .margin32, trailing: 0))
}
.navigationTitle("send.unspent_outputs".localized)
.navigationBarTitleDisplayMode(.inline)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,13 @@ extension OutputSelectorViewModel2 {
sync()
}

func selectUnselectAll() {
if allSelected {
handler.customUtxos = []
} else {
handler.customUtxos = handler.allUtxos
}
func unselectAll() {
handler.customUtxos = []
sync()
}

func selectAll() {
handler.customUtxos = handler.allUtxos
sync()
}

Expand Down

0 comments on commit 0148e2c

Please sign in to comment.