Skip to content

Commit

Permalink
Add review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
soulcramer committed Dec 16, 2024
1 parent 06a6c09 commit b231b1c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
package com.adevinta.spark.catalog.configurator

import androidx.compose.foundation.layout.PaddingValues
import androidx.navigation.NavController
import androidx.navigation.NavGraphBuilder
import androidx.navigation.NavHostController
import androidx.navigation.compose.composable
Expand All @@ -43,7 +42,9 @@ internal fun NavGraphBuilder.configuratorsDestination(
ComponentsListScreen(
components = components,
contentPadding = contentPadding,
onConfiguratorClick = navController::navigateToConfiguratorShowcase,
onConfiguratorClick = { id ->
navController.navigate(route = ConfiguratorShowcase(componentId = id))
},
)
}

Expand All @@ -57,7 +58,3 @@ internal fun NavGraphBuilder.configuratorsDestination(
)
}
}

private fun NavController.navigateToConfiguratorShowcase(id: Int) {
navigate(route = ConfiguratorShowcase(componentId = id))
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
package com.adevinta.spark.catalog.examples

import androidx.compose.foundation.layout.PaddingValues
import androidx.navigation.NavController
import androidx.navigation.NavGraphBuilder
import androidx.navigation.NavHostController
import androidx.navigation.compose.composable
Expand Down Expand Up @@ -51,7 +50,7 @@ internal fun NavGraphBuilder.examplesDestination(
components = components,
contentPadding = contentPadding,
onExampleSectionClick = {
navController.navigateToExampleSection(id = it)
navController.navigate(route = ExampleSection(componentId = id))
},
)
}
Expand All @@ -65,7 +64,7 @@ internal fun NavGraphBuilder.examplesDestination(
contentPadding = contentPadding,
onExampleClick = { example ->
val exampleIndex = component.examples.indexOf(example)
navController.navigateToExampleShowcase(id = componentId, index = exampleIndex)
navController.navigate(route = ExampleShowcase(componentId = id, exampleIndex = exampleIndex))
},
)
}
Expand All @@ -78,11 +77,3 @@ internal fun NavGraphBuilder.examplesDestination(
Example(example = example)
}
}

private fun NavController.navigateToExampleSection(id: Int) {
navigate(route = ExampleSection(componentId = id))
}

private fun NavController.navigateToExampleShowcase(id: Int, index: Int) {
navigate(route = ExampleShowcase(componentId = id, exampleIndex = index))
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
package com.adevinta.spark.catalog.icons

import androidx.compose.foundation.layout.PaddingValues
import androidx.navigation.NavController
import androidx.navigation.NavGraphBuilder
import androidx.navigation.NavHostController
import androidx.navigation.compose.composable
Expand All @@ -42,7 +41,7 @@ internal fun NavGraphBuilder.iconsDemoDestination(
contentPadding = contentPadding,
onIconClick = { id, name, isAnimated ->
navController.navigate(
route = IconShowcase(iconId = id, iconName = name, isIconAnimated = isAnimated)
route = IconShowcase(iconId = id, iconName = name, isIconAnimated = isAnimated),
)
},
)
Expand Down

0 comments on commit b231b1c

Please sign in to comment.