Skip to content

Commit

Permalink
- added translation keys/strings to CurrencyList/OfferList screens (m…
Browse files Browse the repository at this point in the history
…issed staging the files)
  • Loading branch information
nostrbuddha authored and rodvar committed Nov 26, 2024
1 parent 856a088 commit 14a021c
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,4 +148,10 @@ val FRStrings = Strings(
buttons_next = "[FR] Next",
buttons_submit = "[FR] Submit",
buttons_cancel = "[FR] Cancel",

common_offers = "[FR] offers",
common_search = "[FR] Search",

offers_list_buy_from = "[FR] Buy from",
offers_list_sell_to = "[FR] Sell to",
)
Original file line number Diff line number Diff line change
Expand Up @@ -144,4 +144,10 @@ data class Strings(
val buttons_next: String,
val buttons_submit: String,
val buttons_cancel: String,

val common_offers: String,
val common_search: String,

val offers_list_buy_from: String,
val offers_list_sell_to: String,
)
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import bisqapps.shared.presentation.generated.resources.Res
import cafe.adriel.lyricist.LocalStrings
import coil3.compose.AsyncImage
import network.bisq.mobile.domain.data.model.FiatCurrency
import network.bisq.mobile.presentation.ui.components.atoms.BisqText
Expand All @@ -26,6 +27,7 @@ fun CurrencyProfileCard(
currency: FiatCurrency,
onClick: (FiatCurrency) -> Unit) {

val strings = LocalStrings.current
val interactionSource = remember { MutableInteractionSource() }

Row(
Expand Down Expand Up @@ -61,7 +63,7 @@ fun CurrencyProfileCard(
}
}
BisqText.smallRegular(
text = "${currency.offerCount.toString()} offers",
text = "${currency.offerCount.toString()} ${strings.common_offers}",
color = BisqTheme.colors.primary,
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import network.bisq.mobile.presentation.ui.components.atoms.BisqText
import network.bisq.mobile.presentation.ui.components.molecules.BisqDialog
import network.bisq.mobile.presentation.ui.theme.BisqTheme

// TODO: Update default params with translation keys
@Composable
fun ConfirmationDialog(
title: String = "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ fun CurrencyListScreen() {
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.SpaceBetween,
) {
MaterialTextField(text = "Search", onValueChanged = {})
MaterialTextField(text = strings.common_search, onValueChanged = {})
SortIcon(modifier = Modifier.size(24.dp))
}
Spacer(modifier = Modifier.height(12.dp))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.blur
import androidx.compose.ui.unit.dp
import androidx.navigation.NavController
import cafe.adriel.lyricist.LocalStrings
import network.bisq.mobile.presentation.ViewPresenter
import network.bisq.mobile.presentation.ui.components.layout.BisqStaticScaffold
import network.bisq.mobile.presentation.ui.components.molecules.*
Expand All @@ -31,23 +32,23 @@ interface IOffersList : ViewPresenter {
@Composable
fun OffersListScreen() {
val presenter: ICurrencyList = koinInject()
val strings = LocalStrings.current

val states = listOf(
"Buy from",
"Sell to"
strings.offers_list_buy_from,
strings.offers_list_sell_to
)
val openDialog = remember { mutableStateOf(false) }
val rootNavController: NavController

LaunchedEffect(Unit) {
presenter.onViewAttached()
}

BisqStaticScaffold(
topBar = {
TopBar(title = "Offers")
TopBar(title = strings.common_offers)
},
) {
Box(modifier = Modifier.fillMaxSize().blur(if (openDialog.value) 12.dp else 0.dp)) {
Box(modifier = Modifier.fillMaxSize()) {
Column {
Column(
modifier = Modifier.fillMaxWidth(),
Expand All @@ -62,22 +63,11 @@ fun OffersListScreen() {
) {
items(3) {
OfferCard(onClick = {
openDialog.value = !openDialog.value
// TODO: Do navigation here
})
}
}

if (openDialog.value) {
ConfirmationDialog(
message = "Do you want to take this trade?",
confirmButtonText = "Yes, please",
cancelButtonText = "Cancel",
onDismissRequest = {
openDialog.value = !openDialog.value
},
)
}

}
}
}
Expand Down

0 comments on commit 14a021c

Please sign in to comment.