feat(CON-265) : Aligner les flux de l'api d'UI avec les nouveaux dev back

This commit is contained in:
2025-02-11 17:00:53 +01:00
parent c57c9b7d05
commit af91841857
36 changed files with 144 additions and 176 deletions

View File

@ -3,12 +3,14 @@ import androidx.compose.animation.slideIn
import androidx.compose.animation.slideOut
import androidx.compose.runtime.Composable
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.IntOffset
import androidx.navigation.NavGraph.Companion.findStartDestination
import androidx.navigation.NavHostController
import androidx.navigation.compose.NavHost
import androidx.navigation.compose.composable
import androidx.navigation.toRoute
import fr.openium.consentium.R
import fr.openium.consentium.api.Consentium
import fr.openium.consentium.ui.screens.main.MainScreen
import fr.openium.consentium.ui.screens.splash.SplashScreen
@ -79,6 +81,9 @@ fun DemoNavGraph(navHostController: NavHostController) {
composable<Destination.Consent> { backStackEntry ->
val consent = backStackEntry.toRoute<Destination.Consent>()
val appId = stringResource(R.string.app_id)
val apiKey = stringResource(R.string.api_key)
val context = LocalContext.current
ConsentiumComponent(
defaultLandingPage = consent.landingPage,
@ -91,7 +96,8 @@ fun DemoNavGraph(navHostController: NavHostController) {
},
consentium = Consentium(
context = context,
applicationId = "ApplicationId",
apiKey = apiKey,
appId = appId,
),
colors = ConsentiumDefaults.colors(
primary = Primary,

View File

@ -27,8 +27,9 @@ fun SplashScreen(
) {
// Property
val context = LocalContext.current
val consentiumKey = stringResource(R.string.consentium_api_key)
val consentium = remember { Consentium(context = context, applicationId = consentiumKey) }
val apiKey = stringResource(R.string.api_key)
val appId = stringResource(R.string.app_id)
val consentium = remember { Consentium(context = context, apiKey = apiKey, appId = appId) }
// Effect
LaunchedEffect(Unit) {

View File

@ -1,4 +1,5 @@
<resources>
<string name="app_name">Consentium</string>
<string translatable="false" name="consentium_api_key">01938ce4-331a-7592-9e90-f09201ff4f36</string>
<string name="app_id" translatable="false">01938ce4-331a-7592-9e90-f09201ff4f36</string>
<string name="api_key" translatable="false">c452a27f-2e90-427d-be82-2f631c31dd09</string>
</resources>