Skip to content

Commit

Permalink
Avoid return statement
Browse files Browse the repository at this point in the history
  • Loading branch information
Rawa committed Jul 4, 2024
1 parent c59d28f commit dbe12ff
Showing 1 changed file with 41 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,52 +161,51 @@ private fun ReportProblemScreen(
is SendingReportUiState.Error -> ErrorContent(onSendReport, onClearSendResult)
is SendingReportUiState.Success -> SentContent(state.sendingState)
}
return@ScaffoldWithMediumTopBar
}
}

Column(
modifier =
modifier
.padding(
start = Dimens.sideMargin,
end = Dimens.sideMargin,
bottom = Dimens.verticalSpace,
)
.height(IntrinsicSize.Max),
verticalArrangement = Arrangement.spacedBy(Dimens.mediumPadding)
) {
Text(text = stringResource(id = R.string.problem_report_description))

TextField(
modifier = Modifier.fillMaxWidth(),
value = state.email,
onValueChange = onEmailChanged,
maxLines = 1,
singleLine = true,
placeholder = { Text(text = stringResource(id = R.string.user_email_hint)) },
colors = mullvadWhiteTextFieldColors()
)

TextField(
modifier = Modifier.fillMaxWidth().weight(1f),
value = state.description,
onValueChange = onDescriptionChanged,
placeholder = { Text(stringResource(R.string.user_message_hint)) },
colors = mullvadWhiteTextFieldColors()
)
} else {
Column(
modifier =
modifier
.padding(
start = Dimens.sideMargin,
end = Dimens.sideMargin,
bottom = Dimens.verticalSpace,
)
.height(IntrinsicSize.Max),
verticalArrangement = Arrangement.spacedBy(Dimens.mediumPadding)
) {
Text(text = stringResource(id = R.string.problem_report_description))

Column {
PrimaryButton(
onClick = onNavigateToViewLogs,
text = stringResource(id = R.string.view_logs)
TextField(
modifier = Modifier.fillMaxWidth(),
value = state.email,
onValueChange = onEmailChanged,
maxLines = 1,
singleLine = true,
placeholder = { Text(text = stringResource(id = R.string.user_email_hint)) },
colors = mullvadWhiteTextFieldColors()
)
Spacer(modifier = Modifier.height(Dimens.buttonSpacing))
VariantButton(
onClick = onSendReport,
isEnabled = state.description.isNotEmpty(),
text = stringResource(id = R.string.send)

TextField(
modifier = Modifier.fillMaxWidth().weight(1f),
value = state.description,
onValueChange = onDescriptionChanged,
placeholder = { Text(stringResource(R.string.user_message_hint)) },
colors = mullvadWhiteTextFieldColors()
)

Column {
PrimaryButton(
onClick = onNavigateToViewLogs,
text = stringResource(id = R.string.view_logs)
)
Spacer(modifier = Modifier.height(Dimens.buttonSpacing))
VariantButton(
onClick = onSendReport,
isEnabled = state.description.isNotEmpty(),
text = stringResource(id = R.string.send)
)
}
}
}
}
Expand Down

0 comments on commit dbe12ff

Please sign in to comment.