From 1c197d30470c57d80a992f93100711ce185dfef9 Mon Sep 17 00:00:00 2001 From: Artem Kobzar Date: Fri, 17 May 2024 17:25:59 +0200 Subject: [PATCH] Fix image on abount conf screen --- .../kotlinconf/ui/AboutConfScreen.kt | 26 +++++++++++-------- .../kotlinconf/ui/components/RoomMap.kt | 6 +++-- shared/src/webMain/resources/index.html | 2 +- 3 files changed, 20 insertions(+), 14 deletions(-) diff --git a/shared/src/mobileMain/kotlin/org/jetbrains/kotlinconf/ui/AboutConfScreen.kt b/shared/src/mobileMain/kotlin/org/jetbrains/kotlinconf/ui/AboutConfScreen.kt index 59278c50..c0b5c125 100644 --- a/shared/src/mobileMain/kotlin/org/jetbrains/kotlinconf/ui/AboutConfScreen.kt +++ b/shared/src/mobileMain/kotlin/org/jetbrains/kotlinconf/ui/AboutConfScreen.kt @@ -2,15 +2,7 @@ package org.jetbrains.kotlinconf.ui import androidx.compose.foundation.Image import androidx.compose.foundation.background -import androidx.compose.foundation.layout.Box -import androidx.compose.foundation.layout.Column -import androidx.compose.foundation.layout.ExperimentalLayoutApi -import androidx.compose.foundation.layout.FlowRow -import androidx.compose.foundation.layout.Row -import androidx.compose.foundation.layout.fillMaxWidth -import androidx.compose.foundation.layout.height -import androidx.compose.foundation.layout.padding -import androidx.compose.foundation.layout.size +import androidx.compose.foundation.layout.* import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.verticalScroll import androidx.compose.material.MaterialTheme @@ -65,6 +57,8 @@ import org.jetbrains.kotlinconf.ui.theme.greyGrey20 import org.jetbrains.kotlinconf.ui.theme.greyWhite import org.jetbrains.kotlinconf.ui.theme.orange import org.jetbrains.kotlinconf.ui.theme.whiteGrey +import org.jetbrains.kotlinconf.utils.Screen +import org.jetbrains.kotlinconf.utils.isTooWide @OptIn(ExperimentalResourceApi::class) @Composable @@ -84,7 +78,7 @@ fun AboutConfScreen( val secondDaySpeaker = speakers.all.filter { it.name == stringResource(Res.string.second_day_keynote_speaker) } - + val screenSizeIsTooWide = Screen.isTooWide() val time by service.time.collectAsState() val timeString = "${time.month.name} ${time.dayOfMonth} ${time.hours}:${time.minutes}:${time.seconds}" @@ -100,7 +94,17 @@ fun AboutConfScreen( Column( Modifier.fillMaxWidth().verticalScroll(rememberScrollState()) ) { - AboutConfTopBanner() + Column( + Modifier.run { + if (Screen.isTooWide()) { + width(800.dp).align(Alignment.CenterHorizontally) + } else { + fillMaxWidth() + } + } + ) { + AboutConfTopBanner() + } AboutConfSchedule() AboutConfDescription() AboutConfKeynoteSection(keynoteSpeakers) diff --git a/shared/src/mobileMain/kotlin/org/jetbrains/kotlinconf/ui/components/RoomMap.kt b/shared/src/mobileMain/kotlin/org/jetbrains/kotlinconf/ui/components/RoomMap.kt index ed24f6a5..d7888ac5 100644 --- a/shared/src/mobileMain/kotlin/org/jetbrains/kotlinconf/ui/components/RoomMap.kt +++ b/shared/src/mobileMain/kotlin/org/jetbrains/kotlinconf/ui/components/RoomMap.kt @@ -8,6 +8,7 @@ import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.setValue +import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clipToBounds import androidx.compose.ui.geometry.Offset @@ -52,7 +53,7 @@ enum class Room( @OptIn(ExperimentalResourceApi::class) @Composable -fun RoomMap(room: Room) { +fun ColumnScope.RoomMap(room: Room) { val screenSizeIsTooWide = Screen.isTooWide() var svg: Svg? by remember { mutableStateOf(null) } @@ -65,8 +66,9 @@ fun RoomMap(room: Room) { Modifier .run { if (screenSizeIsTooWide) { - width(900.dp) + width(1000.dp) .height(500.dp) + .align(Alignment.CenterHorizontally) } else { fillMaxWidth() .height(343.dp) diff --git a/shared/src/webMain/resources/index.html b/shared/src/webMain/resources/index.html index eccae192..824ec540 100644 --- a/shared/src/webMain/resources/index.html +++ b/shared/src/webMain/resources/index.html @@ -81,7 +81,7 @@ } .github-link { position: absolute; - right: 0; + right: 80px; width: 37px; height: 37px; margin-left: 0;