Updated on 2026-08-14
This commit is contained in:
parent
2ffe05e93a
commit
f2b49df651
9 changed files with 53 additions and 27 deletions
|
|
@ -10,14 +10,12 @@ import kotlinx.collections.immutable.ImmutableSet
|
|||
* @property apiInfoList environment toggles list
|
||||
* @property onEnvironmentSelect the lambda to be invoked when button is pressed
|
||||
* @property onBackClick the lambda to be invoked when back button is pressed
|
||||
* @property onApplyChangesClick the lambda to be invoked when apply changes button is pressed
|
||||
*/
|
||||
internal data class EnvironmentTogglesScreenUM(
|
||||
@StringRes val title: Int,
|
||||
val apiInfoList: ImmutableSet<ApiInfoUM>,
|
||||
val onEnvironmentSelect: (id: String, environment: String) -> Unit,
|
||||
val onBackClick: () -> Unit,
|
||||
val onApplyChangesClick: () -> Unit,
|
||||
) {
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@ import androidx.compose.ui.res.stringResource
|
|||
import androidx.compose.ui.text.style.TextOverflow
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import androidx.compose.ui.unit.dp
|
||||
import com.tangem.core.ui.components.PrimaryButton
|
||||
import com.tangem.core.ui.components.appbar.AppBarWithBackButton
|
||||
import com.tangem.core.ui.res.TangemTheme
|
||||
import com.tangem.core.ui.res.TangemThemePreview
|
||||
|
|
@ -63,16 +62,6 @@ internal fun EnvironmentTogglesScreen(uiModel: EnvironmentTogglesScreenUM) {
|
|||
),
|
||||
)
|
||||
}
|
||||
|
||||
item {
|
||||
PrimaryButton(
|
||||
text = stringResource(id = R.string.apply_changes),
|
||||
onClick = uiModel.onApplyChangesClick,
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.padding(TangemTheme.dimens.spacing16),
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -174,7 +163,6 @@ private fun PreviewFeatureTogglesScreen() {
|
|||
),
|
||||
onEnvironmentSelect = { _: String, s1: String -> select = s1 },
|
||||
onBackClick = {},
|
||||
onApplyChangesClick = {},
|
||||
),
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ internal class EnvironmentsTogglesViewModel @Inject constructor(
|
|||
/** Setup navigation state property by router [router] */
|
||||
fun setupNavigation(router: InnerTesterRouter) {
|
||||
_uiState.update {
|
||||
it.copy(onBackClick = router::back, onApplyChangesClick = router::back)
|
||||
it.copy(onBackClick = router::back)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -85,7 +85,6 @@ internal class EnvironmentsTogglesViewModel @Inject constructor(
|
|||
apiInfoList = persistentSetOf(),
|
||||
onEnvironmentSelect = ::onToggleValueChange,
|
||||
onBackClick = {},
|
||||
onApplyChangesClick = {},
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue