From fc1b5e384dd87692edc18b519569ec110e75ccb0 Mon Sep 17 00:00:00 2001 From: Martin Bonnin Date: Fri, 19 Apr 2024 19:26:06 +0200 Subject: [PATCH] no OpenFeedback for opening & closing keynotes --- .../fr/androidmakers/store/graphql/mappers.kt | 3 +- .../fr/androidmakers/domain/model/Session.kt | 1 + .../ui/agenda/SessionDetailLayout.kt | 40 ++++++++++--------- 3 files changed, 24 insertions(+), 20 deletions(-) diff --git a/shared/data/src/commonMain/kotlin/fr/androidmakers/store/graphql/mappers.kt b/shared/data/src/commonMain/kotlin/fr/androidmakers/store/graphql/mappers.kt index 96e87ab0..eac93e4f 100644 --- a/shared/data/src/commonMain/kotlin/fr/androidmakers/store/graphql/mappers.kt +++ b/shared/data/src/commonMain/kotlin/fr/androidmakers/store/graphql/mappers.kt @@ -56,7 +56,8 @@ fun SessionDetails.toSession(): Session { roomId = this.room?.id ?: "", endsAt = this.endsAt, startsAt = this.startsAt, - isServiceSession = this.type == "service" + isServiceSession = this.type == "service", + type = type ) } diff --git a/shared/domain/src/commonMain/kotlin/fr/androidmakers/domain/model/Session.kt b/shared/domain/src/commonMain/kotlin/fr/androidmakers/domain/model/Session.kt index 1009905b..7585b109 100644 --- a/shared/domain/src/commonMain/kotlin/fr/androidmakers/domain/model/Session.kt +++ b/shared/domain/src/commonMain/kotlin/fr/androidmakers/domain/model/Session.kt @@ -25,4 +25,5 @@ data class Session( val duration: Duration = endsAt.toInstant(TimeZone.UTC) - startsAt.toInstant(TimeZone.UTC), val roomId: String, val isServiceSession: Boolean, + val type: String, ) diff --git a/shared/ui/src/commonMain/kotlin/com/androidmakers/ui/agenda/SessionDetailLayout.kt b/shared/ui/src/commonMain/kotlin/com/androidmakers/ui/agenda/SessionDetailLayout.kt index def66a47..a47694ab 100644 --- a/shared/ui/src/commonMain/kotlin/com/androidmakers/ui/agenda/SessionDetailLayout.kt +++ b/shared/ui/src/commonMain/kotlin/com/androidmakers/ui/agenda/SessionDetailLayout.kt @@ -248,26 +248,28 @@ private fun SessionDetails( .height(16.dp) ) - if (Clock.System.now() > sessionDetails.startTimestamp) { - OpenFeedback( - config = OpenFeedbackFirebaseConfig.default( - context = LocalPlatformContext.current - ), - projectId = "v6kx3QuQkDU4fX0Ta989", - sessionId = sessionDetails.session.id, - ) - } else { - Surface( - shape = RoundedCornerShape(5.dp), - border = BorderStroke(1.dp, separatorColor()), - modifier = Modifier.fillMaxWidth() - ) { - Text( - modifier = Modifier.padding(horizontal = 4.dp, vertical = 8.dp), - text = stringResource(MR.strings.feedbackWaiting), - style = MaterialTheme.typography.bodyMedium, - textAlign = TextAlign.Center + if (sessionDetails.session.type == "talk") { + if (Clock.System.now() > sessionDetails.startTimestamp) { + OpenFeedback( + config = OpenFeedbackFirebaseConfig.default( + context = LocalPlatformContext.current + ), + projectId = "v6kx3QuQkDU4fX0Ta989", + sessionId = sessionDetails.session.id, ) + } else { + Surface( + shape = RoundedCornerShape(5.dp), + border = BorderStroke(1.dp, separatorColor()), + modifier = Modifier.fillMaxWidth() + ) { + Text( + modifier = Modifier.padding(horizontal = 4.dp, vertical = 8.dp), + text = stringResource(MR.strings.feedbackWaiting), + style = MaterialTheme.typography.bodyMedium, + textAlign = TextAlign.Center + ) + } } }