Fix duplicated strings and use back button

This commit is contained in:
Maxime NATUREL 2023-03-06 17:17:27 +01:00 committed by Florian Renaud
parent d55a1ccb07
commit 3efb141afc
5 changed files with 21 additions and 24 deletions

View file

@ -39,6 +39,7 @@ import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import io.element.android.libraries.designsystem.preview.ElementPreviewDark
import io.element.android.libraries.designsystem.preview.ElementPreviewLight
import io.element.android.libraries.designsystem.theme.components.BackButton
import io.element.android.libraries.designsystem.theme.components.CenterAlignedTopAppBar
import io.element.android.libraries.designsystem.theme.components.DockedSearchBar
import io.element.android.libraries.designsystem.theme.components.Icon
@ -133,9 +134,7 @@ fun CreateRoomSearchBar(
},
leadingIcon = if (active.value) {
{
IconButton(onClick = { closeSearchBar() }) {
Icon(DrawableR.drawable.ic_arrow_back, stringResource(StringR.string.a11y_back))
}
BackButton(onClick = { closeSearchBar() })
}
} else null,
trailingIcon = {

View file

@ -104,7 +104,7 @@ fun ChangeServerView(
topBar = {
TopAppBar(
title = {},
navigationIcon = { BackButton(action = onBackPressed, enabled = interactionEnabled) }
navigationIcon = { BackButton(onClick = onBackPressed, enabled = interactionEnabled) }
)
}
) { padding ->
@ -192,7 +192,7 @@ fun ChangeServerView(
IconButton(onClick = {
homeserverFieldState = ""
}, enabled = interactionEnabled) {
Icon(imageVector = Icons.Filled.Close, contentDescription = stringResource(StringR.string.action_clear))
Icon(imageVector = Icons.Filled.Close, contentDescription = stringResource(StringR.string.a11y_clear))
}
}
} else null,

View file

@ -101,7 +101,7 @@ fun LoginRootScreen(
topBar = {
TopAppBar(
title = {},
navigationIcon = { BackButton(action = onBackPressed, enabled = interactionEnabled) },
navigationIcon = { BackButton(onClick = onBackPressed, enabled = interactionEnabled) },
)
}
) { padding ->
@ -267,7 +267,7 @@ internal fun LoginForm(
IconButton(onClick = {
loginFieldState = ""
}) {
Icon(imageVector = Icons.Filled.Close, contentDescription = stringResource(StringR.string.action_clear))
Icon(imageVector = Icons.Filled.Close, contentDescription = stringResource(StringR.string.a11y_clear))
}
}
} else null,