mirror of
https://github.com/bitwarden/android.git
synced 2025-12-10 09:56:45 -06:00
PM-19780: Fix incorrect sub header on authenticator search screen (#5488)
This commit is contained in:
parent
7db8f040e4
commit
fd9bdfa228
@ -33,7 +33,7 @@ fun ItemSearchContent(
|
||||
if (viewState.hasLocalAndSharedItems) {
|
||||
item {
|
||||
BitwardenListHeaderText(
|
||||
label = stringResource(id = R.string.local_codes),
|
||||
label = viewState.localListHeader(),
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.padding(horizontal = 16.dp),
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
package com.bitwarden.authenticator.ui.authenticator.feature.search
|
||||
|
||||
import android.widget.Toast
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.material3.ExperimentalMaterial3Api
|
||||
@ -75,29 +74,24 @@ fun ItemSearchScreen(
|
||||
)
|
||||
},
|
||||
) { innerPadding ->
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.fillMaxSize()
|
||||
.padding(innerPadding),
|
||||
) {
|
||||
val innerModifier = Modifier
|
||||
.fillMaxSize()
|
||||
when (val viewState = state.viewState) {
|
||||
is ItemSearchState.ViewState.Content -> {
|
||||
ItemSearchContent(
|
||||
viewState = viewState,
|
||||
searchHandlers = searchHandlers,
|
||||
modifier = Modifier
|
||||
.fillMaxSize()
|
||||
.padding(paddingValues = innerPadding),
|
||||
)
|
||||
}
|
||||
|
||||
when (val viewState = state.viewState) {
|
||||
is ItemSearchState.ViewState.Content -> {
|
||||
ItemSearchContent(
|
||||
viewState = viewState,
|
||||
searchHandlers = searchHandlers,
|
||||
modifier = innerModifier,
|
||||
)
|
||||
}
|
||||
|
||||
is ItemSearchState.ViewState.Empty -> {
|
||||
ItemSearchEmptyContent(
|
||||
viewState = viewState,
|
||||
modifier = innerModifier,
|
||||
)
|
||||
}
|
||||
is ItemSearchState.ViewState.Empty -> {
|
||||
ItemSearchEmptyContent(
|
||||
viewState = viewState,
|
||||
modifier = Modifier
|
||||
.fillMaxSize()
|
||||
.padding(paddingValues = innerPadding),
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -221,6 +221,11 @@ data class ItemSearchState(
|
||||
val itemList: List<VerificationCodeDisplayItem>,
|
||||
val sharedItems: SharedCodesDisplayState,
|
||||
) : ViewState() {
|
||||
/**
|
||||
* The header to display for the local codes.
|
||||
*/
|
||||
val localListHeader: Text get() = R.string.local_codes.asText(itemList.size)
|
||||
|
||||
/**
|
||||
* Whether or not there should be a "Local codes" header shown above local codes.
|
||||
*/
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user