Skip to content

Commit

Permalink
Merge branch 'develop' into ds/claim-flow
Browse files Browse the repository at this point in the history
  • Loading branch information
StylianosGakis committed Nov 25, 2024
2 parents 398c16f + f620aff commit 6caeae8
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 46 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,13 @@ fun ProductVariantFragment.toProductVariant() = ProductVariant(
url = document.url,
type = @Suppress("ktlint:standard:max-line-length")
when (document.type) {
InsuranceDocumentType.TERMS_AND_CONDITIONS -> com.hedvig.android.data.productvariant.InsuranceVariantDocument.InsuranceDocumentType.TERMS_AND_CONDITIONS
InsuranceDocumentType.PRE_SALE_INFO_EU_STANDARD -> com.hedvig.android.data.productvariant.InsuranceVariantDocument.InsuranceDocumentType.PRE_SALE_INFO_EU_STANDARD
InsuranceDocumentType.PRE_SALE_INFO -> com.hedvig.android.data.productvariant.InsuranceVariantDocument.InsuranceDocumentType.PRE_SALE_INFO
InsuranceDocumentType.GENERAL_TERMS -> com.hedvig.android.data.productvariant.InsuranceVariantDocument.InsuranceDocumentType.GENERAL_TERMS
InsuranceDocumentType.PRIVACY_POLICY -> com.hedvig.android.data.productvariant.InsuranceVariantDocument.InsuranceDocumentType.PRIVACY_POLICY
InsuranceDocumentType.UNKNOWN__ -> com.hedvig.android.data.productvariant.InsuranceVariantDocument.InsuranceDocumentType.UNKNOWN__
InsuranceDocumentType.TERMS_AND_CONDITIONS -> InsuranceVariantDocument.InsuranceDocumentType.TERMS_AND_CONDITIONS
InsuranceDocumentType.PRE_SALE_INFO_EU_STANDARD -> InsuranceVariantDocument.InsuranceDocumentType.PRE_SALE_INFO_EU_STANDARD
InsuranceDocumentType.PRE_SALE_INFO -> InsuranceVariantDocument.InsuranceDocumentType.PRE_SALE_INFO
InsuranceDocumentType.GENERAL_TERMS -> InsuranceVariantDocument.InsuranceDocumentType.GENERAL_TERMS
InsuranceDocumentType.PRIVACY_POLICY -> InsuranceVariantDocument.InsuranceDocumentType.PRIVACY_POLICY
InsuranceDocumentType.UNKNOWN__ -> InsuranceVariantDocument.InsuranceDocumentType.UNKNOWN__
InsuranceDocumentType.SCAR_TABLE -> InsuranceVariantDocument.InsuranceDocumentType.UNKNOWN__
},
)
},
Expand Down
4 changes: 1 addition & 3 deletions app/feature/feature-delete-account/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,16 @@ dependencies {
implementation(libs.arrow.core)
implementation(libs.compose.richtext)
implementation(libs.compose.richtextCommonmark)
implementation(libs.compose.richtextMaterial)
implementation(libs.coroutines.core)
implementation(libs.koin.compose)
implementation(libs.koin.core)
implementation(libs.kotlinx.serialization.core)
implementation(projects.apolloCore)
implementation(projects.apolloOctopusPublic)
implementation(projects.authCorePublic)
implementation(projects.designSystemHedvig)
implementation(projects.coreCommonPublic)
implementation(projects.coreDesignSystem)
implementation(projects.coreResources)
implementation(projects.coreUi)
implementation(projects.moleculeAndroid)
implementation(projects.moleculePublic)
implementation(projects.navigationCommon)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@ import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.ButtonColors
import androidx.compose.material3.ButtonDefaults
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.ui.Modifier
Expand All @@ -20,13 +15,16 @@ import androidx.compose.ui.tooling.preview.datasource.CollectionPreviewParameter
import androidx.compose.ui.unit.dp
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import com.halilibo.richtext.commonmark.Markdown
import com.halilibo.richtext.ui.material3.RichText
import com.hedvig.android.core.designsystem.component.button.HedvigContainedButton
import com.hedvig.android.core.designsystem.component.error.HedvigErrorSection
import com.hedvig.android.core.designsystem.component.progress.HedvigFullScreenCenterAlignedProgress
import com.hedvig.android.core.designsystem.preview.HedvigPreview
import com.hedvig.android.core.designsystem.theme.HedvigTheme
import com.hedvig.android.core.ui.scaffold.HedvigScaffold
import com.hedvig.android.design.system.hedvig.HedvigButton
import com.hedvig.android.design.system.hedvig.HedvigErrorSection
import com.hedvig.android.design.system.hedvig.HedvigFullScreenCenterAlignedProgress
import com.hedvig.android.design.system.hedvig.HedvigPreview
import com.hedvig.android.design.system.hedvig.HedvigRedTextButton
import com.hedvig.android.design.system.hedvig.HedvigScaffold
import com.hedvig.android.design.system.hedvig.HedvigText
import com.hedvig.android.design.system.hedvig.HedvigTheme
import com.hedvig.android.design.system.hedvig.RichText
import com.hedvig.android.design.system.hedvig.Surface
import com.hedvig.android.feature.chat.DeleteAccountViewModel
import hedvig.resources.R

Expand Down Expand Up @@ -71,6 +69,7 @@ private fun DeleteAccountScreen(
buttonText = stringResource(R.string.general_back_button),
onButtonClick = navigateBack,
modifier = Modifier.weight(1f),
isButtonRed = false,
)
}

Expand All @@ -85,10 +84,7 @@ private fun DeleteAccountScreen(
onButtonClick = initiateAccountDeletion,
modifier = Modifier.weight(1f),
isButtonLoading = uiState.isPerformingDeletion,
buttonColors = ButtonDefaults.buttonColors(
containerColor = MaterialTheme.colorScheme.error,
contentColor = MaterialTheme.colorScheme.onError,
),
isButtonRed = true,
)
}
}
Expand All @@ -102,20 +98,15 @@ private fun DeleteScreenContents(
description: String,
buttonText: String,
onButtonClick: () -> Unit,
isButtonRed: Boolean,
modifier: Modifier = Modifier,
isButtonLoading: Boolean = false,
buttonColors: ButtonColors = ButtonDefaults.buttonColors(
containerColor = MaterialTheme.colorScheme.primary,
contentColor = MaterialTheme.colorScheme.onPrimary,
disabledContainerColor = MaterialTheme.colorScheme.primary.copy(alpha = 0.12f),
disabledContentColor = MaterialTheme.colorScheme.onPrimary.copy(alpha = 0.38f),
),
) {
Column(modifier) {
Spacer(Modifier.height(16.dp))
Text(
HedvigText(
text = title,
style = MaterialTheme.typography.headlineMedium,
style = HedvigTheme.typography.headlineMedium,
modifier = Modifier
.fillMaxWidth()
.padding(horizontal = 16.dp),
Expand All @@ -133,15 +124,26 @@ private fun DeleteScreenContents(
Spacer(Modifier.height(16.dp))
Spacer(Modifier.weight(1f))
Spacer(Modifier.height(8.dp))
HedvigContainedButton(
text = buttonText,
onClick = onButtonClick,
isLoading = isButtonLoading,
colors = buttonColors,
modifier = Modifier
.fillMaxWidth()
.padding(horizontal = 16.dp),
)
if (isButtonRed) {
HedvigRedTextButton(
text = buttonText,
onClick = onButtonClick,
modifier = Modifier
.fillMaxWidth()
.padding(horizontal = 16.dp),
)
} else {
HedvigButton(
text = buttonText,
onClick = onButtonClick,
enabled = true,
isLoading = isButtonLoading,
modifier = Modifier
.fillMaxWidth()
.padding(horizontal = 16.dp),
)
}

Spacer(Modifier.height(16.dp))
}
}
Expand All @@ -160,8 +162,10 @@ private fun DeleteAccountUiState.CanNotDelete.descriptionStringRes(): Int {
return when (this) {
DeleteAccountUiState.CanNotDelete.AlreadyRequestedDeletion ->
R.string.DELETE_ACCOUNT_PROCESSED_DESCRIPTION

DeleteAccountUiState.CanNotDelete.HasActiveInsurance ->
R.string.DELETE_ACCOUNT_YOU_HAVE_ACTIVE_INSURANCE_DESCRIPTION

DeleteAccountUiState.CanNotDelete.HasOngoingClaim ->
R.string.DELETE_ACCOUNT_YOU_HAVE_ACTIVE_CLAIM_DESCRIPTION
}
Expand All @@ -173,7 +177,7 @@ private fun PreviewDeleteAccountScreen(
@PreviewParameter(DeleteAccountUiStateProvider::class) uiState: DeleteAccountUiState,
) {
HedvigTheme {
Surface(color = MaterialTheme.colorScheme.background) {
Surface(color = HedvigTheme.colorScheme.backgroundPrimary) {
DeleteAccountScreen(uiState, {}, {}, {}, {})
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ private fun PagerSelector(pagerState: PagerState, modifier: Modifier = Modifier)
}
},
modifier = modifier.fillMaxWidth(),
tabSize = TabSize.Medium,
tabSize = TabSize.Small,
tabStyle = Filled,
)
}
Expand Down
4 changes: 2 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ coil = "2.7.0"
composeRichtext = "1.0.0-alpha01"
coreLibraryDesugaring = "2.1.3"
coroutines = "1.9.0"
datadog = "2.15.1"
dependencyAnalysis = "2.4.2"
datadog = "2.16.0"
dependencyAnalysis = "2.5.0"
firebaseCrashlyticsBuildtools = "3.0.2"
hedvigAuthlib = "1.4.3"
junit = "4.13.2"
Expand Down

0 comments on commit 6caeae8

Please sign in to comment.