Skip to content

Commit

Permalink
Fix copy in claim details bottom sheet
Browse files Browse the repository at this point in the history
We want the version which has two rows with a subtitle
  • Loading branch information
StylianosGakis committed Nov 14, 2024
1 parent 3f11bb6 commit 6e31902
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 68 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.heightIn
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.layout.wrapContentSize
import androidx.compose.foundation.text.KeyboardActions
import androidx.compose.foundation.text.KeyboardOptions
Expand Down Expand Up @@ -49,7 +51,7 @@ import com.hedvig.android.core.designsystem.component.datepicker.HedvigDatePicke
import com.hedvig.android.core.designsystem.component.textfield.HedvigTextField
import com.hedvig.android.core.designsystem.preview.HedvigPreview
import com.hedvig.android.core.designsystem.theme.HedvigTheme
import com.hedvig.android.core.ui.SelectableHedvigCard
import com.hedvig.android.core.ui.SelectIndicationCircle
import com.hedvig.android.core.ui.getLocale
import com.hedvig.android.core.ui.infocard.VectorWarningCard
import com.hedvig.android.core.ui.rememberHedvigDateTimeFormatter
Expand Down Expand Up @@ -192,6 +194,27 @@ internal fun SelectableCoInsuredList(
)
}

@Composable
private fun SelectableHedvigCard(text: String, isSelected: Boolean, onClick: () -> Unit) {
HedvigCard(onClick = onClick) {
Row(
verticalAlignment = Alignment.CenterVertically,
modifier = Modifier
.heightIn(72.dp)
.fillMaxWidth()
.padding(horizontal = 16.dp, vertical = 10.dp),
) {
Text(
text = text,
style = MaterialTheme.typography.headlineSmall,
modifier = Modifier.weight(1f),
)
Spacer(Modifier.width(8.dp))
SelectIndicationCircle(isSelected)
}
}
}

@Composable
private fun FetchFromSsnFields(
ssn: String?,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ internal class GetQuickLinksUseCase(
add(
StandaloneQuickLink(
quickLinkDestination = QuickLinkDestination.OuterDestination.QuickLinkChangeAddress,
titleRes = R.string.HC_QUICK_ACTIONS_CHANGE_ADDRESS_TITLE,
titleRes = R.string.insurance_details_change_address_button,
hintTextRes = R.string.HC_QUICK_ACTIONS_CHANGE_ADDRESS_SUBTITLE,
),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,11 @@ import androidx.lifecycle.compose.dropUnlessResumed
import com.hedvig.android.core.designsystem.component.button.HedvigContainedButton
import com.hedvig.android.core.designsystem.component.button.HedvigTextButton
import com.hedvig.android.core.designsystem.preview.HedvigPreview
import com.hedvig.android.core.designsystem.theme.HedvigTheme
import com.hedvig.android.core.ui.SelectableHedvigCard
import com.hedvig.android.design.system.hedvig.ChosenState.Chosen
import com.hedvig.android.design.system.hedvig.ChosenState.NotChosen
import com.hedvig.android.design.system.hedvig.HedvigText
import com.hedvig.android.design.system.hedvig.HedvigTheme
import com.hedvig.android.design.system.hedvig.RadioOptionRightAligned
import hedvig.resources.R

@Composable
Expand Down Expand Up @@ -54,42 +57,57 @@ internal fun EditInsuranceBottomSheetContent(
verticalArrangement = Arrangement.spacedBy(4.dp),
) {
if (allowChangeAddress) {
SelectableHedvigCard(
text = stringResource(R.string.insurance_details_change_address_button),
isSelected = selectedItemIndex == 0,
onClick = {
selectedItemIndex = if (selectedItemIndex == 0) {
-1
} else {
0
}
},
)
RadioOptionRightAligned(
chosenState = if (selectedItemIndex == 0) Chosen else NotChosen,
onClick = { selectedItemIndex = 0 },
optionContent = {
Column {
HedvigText(
text = stringResource(R.string.insurance_details_change_address_button),
)
HedvigText(
text = stringResource(R.string.HC_QUICK_ACTIONS_CHANGE_ADDRESS_SUBTITLE),
color = HedvigTheme.colorScheme.textSecondary,
style = HedvigTheme.typography.label,
)
}
},
)
}
if (allowEditCoInsured) {
SelectableHedvigCard(
text = stringResource(R.string.CONTRACT_EDIT_COINSURED),
isSelected = selectedItemIndex == 1,
onClick = {
selectedItemIndex = if (selectedItemIndex == 1) {
-1
} else {
1
RadioOptionRightAligned(
optionContent = {
Column {
HedvigText(
text = stringResource(R.string.CONTRACT_EDIT_COINSURED),
)
HedvigText(
text = stringResource(R.string.HC_QUICK_ACTIONS_CO_INSURED_SUBTITLE),
color = HedvigTheme.colorScheme.textSecondary,
style = HedvigTheme.typography.label,
)
}
},
chosenState = if (selectedItemIndex == 1) Chosen else NotChosen,
onClick = { selectedItemIndex = 1 },
)
}
if (allowChangeTier) {
SelectableHedvigCard(
text = stringResource(R.string.insurance_details_change_coverage),
isSelected = selectedItemIndex == 2,
onClick = {
selectedItemIndex = if (selectedItemIndex == 2) {
-1
} else {
2
RadioOptionRightAligned(
optionContent = {
Column {
HedvigText(
text = stringResource(R.string.insurance_details_change_coverage),
)
HedvigText(
text = stringResource(R.string.HC_QUICK_ACTIONS_UPGRADE_COVERAGE_SUBTITLE),
color = HedvigTheme.colorScheme.textSecondary,
style = HedvigTheme.typography.label,
)
}
},
chosenState = if (selectedItemIndex == 2) Chosen else NotChosen,
onClick = { selectedItemIndex = 2 },
)
}
}
Expand Down Expand Up @@ -119,7 +137,7 @@ internal fun EditInsuranceBottomSheetContent(
@Composable
@HedvigPreview
private fun PreviewEditInsuranceBottomSheetContent() {
HedvigTheme {
com.hedvig.android.core.designsystem.theme.HedvigTheme {
Surface(color = MaterialTheme.colorScheme.background) {
EditInsuranceBottomSheetContent(
allowChangeAddress = true,
Expand Down

0 comments on commit 6e31902

Please sign in to comment.