Skip to content

Commit

Permalink
improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Abhinav committed Mar 19, 2023
1 parent 189d31b commit 5fd0e6c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 19 deletions.
19 changes: 4 additions & 15 deletions src/jvmMain/kotlin/ui/menu/FooterSection.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,8 @@

package ui.menu

import androidx.compose.foundation.layout.ColumnScope
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.heightIn
import androidx.compose.foundation.text.ClickableText
import androidx.compose.runtime.*
import androidx.compose.ui.Alignment
import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
Expand All @@ -20,19 +15,14 @@ import androidx.compose.ui.text.SpanStyle
import androidx.compose.ui.text.buildAnnotatedString
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.withStyle
import androidx.compose.ui.unit.dp
import utils.openInBrowser
import java.net.URI

@Composable
fun ColumnScope.FooterSection() {
FooterText()
Spacer(modifier = Modifier.fillMaxWidth().heightIn(24.dp))
}

@OptIn(ExperimentalComposeUiApi::class)
@Composable
fun ColumnScope.FooterText() {
fun FooterText(
modifier: Modifier
) {

var isOptionActive by remember { mutableStateOf(false) }

Expand Down Expand Up @@ -67,8 +57,7 @@ fun ColumnScope.FooterText() {
openInBrowser(URI(annotation.item))
}
},
modifier = Modifier
.align(Alignment.CenterHorizontally)
modifier = modifier
.onPointerEvent(PointerEventType.Enter) { isOptionActive = true }
.onPointerEvent(PointerEventType.Exit) { isOptionActive = false }
)
Expand Down
4 changes: 3 additions & 1 deletion src/jvmMain/kotlin/ui/menu/GameMenu.kt
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ fun GameMenu(game: Game) {
HeroSection(game) {
isDialogOpen = true
}
FooterSection()
Spacer(modifier = Modifier.fillMaxWidth().heightIn(24.dp))
FooterText(Modifier.align(Alignment.CenterHorizontally))
Spacer(modifier = Modifier.fillMaxWidth().heightIn(24.dp))
}

if (isDialogOpen) {
Expand Down
5 changes: 2 additions & 3 deletions src/jvmMain/kotlin/ui/menu/HeroSection.kt
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,10 @@ import ui.theme.MenuOptionBackgroundColor
import ui.theme.MenuOptionBorderColor

@Composable
fun ColumnScope.HeroSection(game: Game, onCustomTextInputClicked: () -> Unit) {
fun HeroSection(game: Game, onCustomTextInputClicked: () -> Unit) {
Row(
modifier = Modifier
.fillMaxSize()
.weight(1f),
.fillMaxWidth(),
horizontalArrangement = Arrangement.Center
) {
HeroSectionMenuButton(
Expand Down

0 comments on commit 5fd0e6c

Please sign in to comment.