Skip to content

Commit

Permalink
feat: add navigate to profilecard
Browse files Browse the repository at this point in the history
  • Loading branch information
mikanIchinose committed Jul 3, 2024
1 parent a06de1c commit b8ffba6
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 11 deletions.
1 change: 1 addition & 0 deletions app-android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ dependencies {
implementation(projects.feature.contributors)
implementation(projects.feature.sessions)
implementation(projects.feature.eventmap)
implementation(projects.feature.profilecard)
implementation(projects.core.model)
implementation(projects.core.data)
implementation(projects.core.designsystem)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ import io.github.droidkaigi.confsched.sessions.sessionScreens
import io.github.droidkaigi.confsched.sessions.timetableScreenRoute
import io.github.droidkaigi.confsched.share.ShareNavigator
import io.github.droidkaigi.confsched.ui.NavHostWithSharedAxisX
import io.github.droidkaigi.confshed.profilecard.navigateProfileCardScreen
import io.github.droidkaigi.confshed.profilecard.profileCardScreen
import io.github.droidkaigi.confshed.profilecard.profileCardScreenRoute
import kotlinx.collections.immutable.PersistentList

@Composable
Expand Down Expand Up @@ -115,6 +118,7 @@ private fun NavGraphBuilder.mainScreen(
onNavigationIconClick = navController::popBackStack,
onEventMapItemClick = externalNavController::navigate,
)
profileCardScreen(contentPadding)
},
)
}
Expand All @@ -125,6 +129,7 @@ class KaigiAppMainNestedGraphStateHolder : MainNestedGraphStateHolder {
override fun routeToTab(route: String): MainScreenTab? {
return when (route) {
timetableScreenRoute -> Timetable
profileCardScreenRoute -> ProfileCard
else -> null
}
}
Expand All @@ -137,7 +142,7 @@ class KaigiAppMainNestedGraphStateHolder : MainNestedGraphStateHolder {
Timetable -> mainNestedNavController.navigateTimetableScreen()
EventMap -> mainNestedNavController.navigateEventMapScreen()
About -> TODO()
ProfileCard -> TODO()
ProfileCard -> mainNestedNavController.navigateProfileCardScreen()
}
}
}
Expand Down
1 change: 1 addition & 0 deletions app-ios-shared/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ kotlin {
api(projects.feature.sessions)
api(projects.feature.eventmap)
api(projects.feature.contributors)
api(projects.feature.profilecard)
implementation(libs.kotlinxCoroutinesCore)
implementation(libs.skieAnnotation)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,19 +137,20 @@ enum class MainScreenTab(
contentDescription = MainStrings.EventMap.asString(),
),

@OptIn(ExperimentalResourceApi::class)
ProfileCard(
icon = IconRepresentation.Drawable(drawableId = Res.drawable.icon_achievement_outline),
selectedIcon = IconRepresentation.Drawable(drawableId = Res.drawable.icon_achievement_fill),
label = MainStrings.Achievements.asString(),
contentDescription = MainStrings.Achievements.asString(),
),
About(
icon = IconRepresentation.Vector(Icons.Outlined.Info),
selectedIcon = IconRepresentation.Vector(Icons.Filled.Info),
label = MainStrings.About.asString(),
contentDescription = MainStrings.About.asString(),
),

@OptIn(ExperimentalResourceApi::class)
ProfileCard(
icon = IconRepresentation.Drawable(drawableId = Res.drawable.icon_achievement_outline),
selectedIcon = IconRepresentation.Drawable(drawableId = Res.drawable.icon_achievement_fill),
label = MainStrings.ProfileCard.asString(),
contentDescription = MainStrings.ProfileCard.asString(),
),
}

data class MainScreenUiState(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import io.github.droidkaigi.confsched.designsystem.strings.StringsBindings
sealed class MainStrings : Strings<MainStrings>(Bindings) {
data object Timetable : MainStrings()
data object EventMap : MainStrings()
data object Achievements : MainStrings()
data object ProfileCard : MainStrings()
data object About : MainStrings()
data object Contributors : MainStrings()
class Time(val hours: Int, val minutes: Int) : MainStrings()
Expand All @@ -17,7 +17,7 @@ sealed class MainStrings : Strings<MainStrings>(Bindings) {
when (item) {
Timetable -> "Timetable"
EventMap -> "Event Map"
Achievements -> "Achievements"
ProfileCard -> "Profile Card"
About -> "About"
Contributors -> "Contributors"
is Time -> "${item.hours}${item.minutes}"
Expand All @@ -27,7 +27,7 @@ sealed class MainStrings : Strings<MainStrings>(Bindings) {
when (item) {
Timetable -> "Timetable"
EventMap -> "Event Map"
Achievements -> "Achievements"
ProfileCard -> "Profile Card"
About -> "About"
Contributors -> "Contributors"
is Time -> "${item.hours}:${item.minutes}"
Expand Down

0 comments on commit b8ffba6

Please sign in to comment.