Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -314,14 +314,14 @@ internal fun YourInfoTab(
)
}

HorizontalDivider(modifier = Modifier.padding(horizontal = 16.dp))
Spacer(Modifier.height(16.dp))
ContractOwnerSection(
coInsuredList = coInsured,
modifier = Modifier.padding(horizontal = 16.dp),
contractHolderDisplayName = contractHolderDisplayName,
contractHolderSSN = contractHolderSSN,
)
HorizontalDivider(modifier = Modifier.padding(horizontal = 16.dp))
Spacer(Modifier.height(16.dp))
ContractOwnerSection(
coInsuredList = coInsured,
modifier = Modifier.padding(horizontal = 16.dp),
contractHolderDisplayName = contractHolderDisplayName,
contractHolderSSN = contractHolderSSN,
)

if (allowEditCoInsured && coInsured.isNotEmpty()) {
CoInsuredSection(
Expand Down Expand Up @@ -834,11 +834,7 @@ internal fun ContractOwnerSection(
}

@Composable
internal fun CoInsuredSection(
coInsuredList: List<CoInsured>,
isCoOwner: Boolean,
modifier: Modifier,
) {
internal fun CoInsuredSection(coInsuredList: List<CoInsured>, isCoOwner: Boolean, modifier: Modifier) {
val dateTimeFormatter = rememberHedvigDateTimeFormatter()
val birthDateTimeFormatter = rememberHedvigBirthDateDateTimeFormatter()
Column(modifier = modifier) {
Expand Down Expand Up @@ -929,27 +925,30 @@ private fun PreviewYourInfoTab(
DisplayItem("Type", Text("Homeowner")),
DisplayItem("Size", Text("56 m2")),
),
coInsured = if (onlyInsuranceHolder) emptyList() else
coInsured = if (onlyInsuranceHolder) {
emptyList()
} else {
listOf(
CoInsured(
ssn = "199101131000",
birthDate = null,
firstName = "Hu",
lastName = "Li",
activatesOn = LocalDate.fromEpochDays(300),
terminatesOn = null,
hasMissingInfo = false,
),
CoInsured(
ssn = "1234020312",
birthDate = null,
firstName = "Testersson",
lastName = "Tester",
activatesOn = null,
terminatesOn = null,
hasMissingInfo = false,
),
),
CoInsured(
ssn = "199101131000",
birthDate = null,
firstName = "Hu",
lastName = "Li",
activatesOn = LocalDate.fromEpochDays(300),
terminatesOn = null,
hasMissingInfo = false,
),
CoInsured(
ssn = "1234020312",
birthDate = null,
firstName = "Testersson",
lastName = "Tester",
activatesOn = null,
terminatesOn = null,
hasMissingInfo = false,
),
)
},
coOwners = listOf(),
allowChangeAddress = true,
allowTerminatingInsurance = true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,8 @@ private fun PreviewTerminationRedirectionDestinationWithImage() {
TerminationRedirectionDestination(
redirection = SurveyOptionRedirection(
title = "Bring Hedvig to your new home",
description = "Move your insurance to your new home with Hedvig and get 15% off your home insurance the first year.",
description = "Move your insurance to your new home with Hedvig and get 15% off your home insurance " +
"the first year.",
type = RedirectionType.UPDATE_ADDRESS,
actionText = "See price for new home",
image = RedirectionImage(url = "", overlayText = "15% off"),
Expand All @@ -179,7 +180,8 @@ private fun PreviewTerminationRedirectionDestinationWithoutImage() {
TerminationRedirectionDestination(
redirection = SurveyOptionRedirection(
title = "Bring Hedvig to your new home",
description = "Move your insurance to your new home with Hedvig and get 15% off your home insurance the first year.",
description = "Move your insurance to your new home with Hedvig and get 15% off your home insurance " +
"the first year.",
type = RedirectionType.UPDATE_ADDRESS,
actionText = "See price for new home",
image = null,
Expand Down
Loading