Rename some private composable functions.

This commit is contained in:
Benoit Marty 2024-10-29 16:41:37 +01:00
parent 85f9459d72
commit 05e70ef5d0
2 changed files with 15 additions and 15 deletions

View file

@ -63,7 +63,7 @@ fun IncomingVerificationView(
) )
}, },
header = { header = {
HeaderContent(step = step) IncomingVerificationHeader(step = step)
}, },
footer = { footer = {
IncomingVerificationBottomMenu( IncomingVerificationBottomMenu(
@ -71,14 +71,14 @@ fun IncomingVerificationView(
) )
} }
) { ) {
Content( IncomingVerificationContent(
step = step, step = step,
) )
} }
} }
@Composable @Composable
private fun HeaderContent(step: Step) { private fun IncomingVerificationHeader(step: Step) {
val iconStyle = when (step) { val iconStyle = when (step) {
Step.Canceled, Step.Canceled,
is Step.Initial -> BigIcon.Style.Default(CompoundIcons.LockSolid()) is Step.Initial -> BigIcon.Style.Default(CompoundIcons.LockSolid())
@ -114,7 +114,7 @@ private fun HeaderContent(step: Step) {
} }
@Composable @Composable
private fun Content( private fun IncomingVerificationContent(
step: Step, step: Step,
) { ) {
when (step) { when (step) {

View file

@ -120,10 +120,10 @@ fun VerifySelfSessionView(
) )
}, },
header = { header = {
HeaderContent(step = step) VerifySelfSessionHeader(step = step)
}, },
footer = { footer = {
BottomMenu( VerifySelfSessionBottomMenu(
screenState = state, screenState = state,
onCancelClick = ::cancelOrResetFlow, onCancelClick = ::cancelOrResetFlow,
onEnterRecoveryKey = onEnterRecoveryKey, onEnterRecoveryKey = onEnterRecoveryKey,
@ -132,7 +132,7 @@ fun VerifySelfSessionView(
) )
} }
) { ) {
Content( VerifySelfSessionContent(
flowState = step, flowState = step,
onLearnMoreClick = onLearnMoreClick, onLearnMoreClick = onLearnMoreClick,
) )
@ -156,9 +156,9 @@ fun VerifySelfSessionView(
} }
@Composable @Composable
private fun HeaderContent(step: Step) { private fun VerifySelfSessionHeader(step: Step) {
val iconStyle = when (step) { val iconStyle = when (step) {
VerifySelfSessionState.Step.Loading -> error("Should not happen") Step.Loading -> error("Should not happen")
is Step.Initial, Step.AwaitingOtherDeviceResponse -> BigIcon.Style.Default(CompoundIcons.LockSolid()) is Step.Initial, Step.AwaitingOtherDeviceResponse -> BigIcon.Style.Default(CompoundIcons.LockSolid())
Step.Canceled -> BigIcon.Style.AlertSolid Step.Canceled -> BigIcon.Style.AlertSolid
Step.Ready, is Step.Verifying -> BigIcon.Style.Default(CompoundIcons.Reaction()) Step.Ready, is Step.Verifying -> BigIcon.Style.Default(CompoundIcons.Reaction())
@ -166,7 +166,7 @@ private fun HeaderContent(step: Step) {
is Step.Skipped -> return is Step.Skipped -> return
} }
val titleTextId = when (step) { val titleTextId = when (step) {
VerifySelfSessionState.Step.Loading -> error("Should not happen") Step.Loading -> error("Should not happen")
is Step.Initial, Step.AwaitingOtherDeviceResponse -> R.string.screen_identity_confirmation_title is Step.Initial, Step.AwaitingOtherDeviceResponse -> R.string.screen_identity_confirmation_title
Step.Canceled -> CommonStrings.common_verification_cancelled Step.Canceled -> CommonStrings.common_verification_cancelled
Step.Ready -> R.string.screen_session_verification_compare_emojis_title Step.Ready -> R.string.screen_session_verification_compare_emojis_title
@ -178,7 +178,7 @@ private fun HeaderContent(step: Step) {
is Step.Skipped -> return is Step.Skipped -> return
} }
val subtitleTextId = when (step) { val subtitleTextId = when (step) {
VerifySelfSessionState.Step.Loading -> error("Should not happen") Step.Loading -> error("Should not happen")
is Step.Initial, Step.AwaitingOtherDeviceResponse -> R.string.screen_identity_confirmation_subtitle is Step.Initial, Step.AwaitingOtherDeviceResponse -> R.string.screen_identity_confirmation_subtitle
Step.Canceled -> R.string.screen_session_verification_cancelled_subtitle Step.Canceled -> R.string.screen_session_verification_cancelled_subtitle
Step.Ready -> R.string.screen_session_verification_ready_subtitle Step.Ready -> R.string.screen_session_verification_ready_subtitle
@ -198,12 +198,12 @@ private fun HeaderContent(step: Step) {
} }
@Composable @Composable
private fun Content( private fun VerifySelfSessionContent(
flowState: Step, flowState: Step,
onLearnMoreClick: () -> Unit, onLearnMoreClick: () -> Unit,
) { ) {
when (flowState) { when (flowState) {
is VerifySelfSessionState.Step.Initial -> { is Step.Initial -> {
ContentInitial(onLearnMoreClick) ContentInitial(onLearnMoreClick)
} }
is Step.Verifying -> { is Step.Verifying -> {
@ -232,7 +232,7 @@ private fun ContentInitial(
} }
@Composable @Composable
private fun BottomMenu( private fun VerifySelfSessionBottomMenu(
screenState: VerifySelfSessionState, screenState: VerifySelfSessionState,
onEnterRecoveryKey: () -> Unit, onEnterRecoveryKey: () -> Unit,
onResetKey: () -> Unit, onResetKey: () -> Unit,
@ -245,7 +245,7 @@ private fun BottomMenu(
val isVerifying = (verificationViewState as? Step.Verifying)?.state is AsyncData.Loading<Unit> val isVerifying = (verificationViewState as? Step.Verifying)?.state is AsyncData.Loading<Unit>
when (verificationViewState) { when (verificationViewState) {
VerifySelfSessionState.Step.Loading -> error("Should not happen") Step.Loading -> error("Should not happen")
is Step.Initial -> { is Step.Initial -> {
VerificationBottomMenu { VerificationBottomMenu {
if (verificationViewState.isLastDevice) { if (verificationViewState.isLastDevice) {