Skip to content

Commit 5eba41f

Browse files
committed
chore(token/info): reorder the bottom bar buttons
Signed-off-by: Brandon McAnsh <git@bmcreations.dev>
1 parent 49754af commit 5eba41f

1 file changed

Lines changed: 27 additions & 14 deletions

File tree

  • apps/flipcash/features/tokens/src/main/kotlin/com/flipcash/app/tokens/internal

apps/flipcash/features/tokens/src/main/kotlin/com/flipcash/app/tokens/internal/TokenInfoScreen.kt

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -284,29 +284,30 @@ private fun BottomBarButtons(
284284
) {
285285
if (state.isCashReserve) return@Row
286286
val canGive = state.balance.nativeAmount.isPositive
287-
if (canGive) {
288-
CodeButton(
289-
modifier = Modifier.weight(1f),
290-
buttonState = ButtonState.Filled,
291-
text = stringResource(R.string.action_give),
292-
) {
293-
dispatch(
294-
TokenInfoViewModel.Event.OpenScreen(
295-
AppRoute.Main.Give(mint = loadable.data.address, fromTokenInfo = true)
296-
)
297-
)
298-
}
299-
}
300287

301288
if (state.cashReservesEnabled) {
302289
CodeButton(
303290
modifier = Modifier.weight(1f),
304-
buttonState = if (canGive) ButtonState.Filled20 else ButtonState.Filled,
291+
buttonState = ButtonState.Filled,
305292
text = stringResource(R.string.action_buy),
306293
) {
307294
dispatch(TokenInfoViewModel.Event.OpenPurchaseMethods(forNeededFunds = isForNeededFunds))
308295
}
309296

297+
if (canGive) {
298+
CodeButton(
299+
modifier = Modifier.weight(1f),
300+
buttonState = ButtonState.Filled20,
301+
text = stringResource(R.string.action_give),
302+
) {
303+
dispatch(
304+
TokenInfoViewModel.Event.OpenScreen(
305+
AppRoute.Main.Give(mint = loadable.data.address, fromTokenInfo = true)
306+
)
307+
)
308+
}
309+
}
310+
310311
if (state.canSell) {
311312
CodeButton(
312313
modifier = Modifier
@@ -324,6 +325,18 @@ private fun BottomBarButtons(
324325
)
325326
}
326327
}
328+
} else {
329+
CodeButton(
330+
modifier = Modifier.weight(1f),
331+
buttonState = ButtonState.Filled,
332+
text = stringResource(R.string.action_give),
333+
) {
334+
dispatch(
335+
TokenInfoViewModel.Event.OpenScreen(
336+
AppRoute.Main.Give(mint = loadable.data.address, fromTokenInfo = true)
337+
)
338+
)
339+
}
327340
}
328341
}
329342
}

0 commit comments

Comments
 (0)