diff --git a/composeApp/src/commonMain/kotlin/misc/AppUtils.kt b/composeApp/src/commonMain/kotlin/misc/AppUtils.kt index 94d1741..c48dda7 100644 --- a/composeApp/src/commonMain/kotlin/misc/AppUtils.kt +++ b/composeApp/src/commonMain/kotlin/misc/AppUtils.kt @@ -179,7 +179,7 @@ fun handleRomInfo( val iconNames = changelogGroups.map { it.split("\n").first() } val iconMainLink = if (isWeb()) "https://updater.yukonga.top/icon/10/" else recoveryRomInfo.fileMirror!!.icon - val iconNameLink = recoveryRomInfo.icon!! + val iconNameLink = recoveryRomInfo.icon ?: mapOf() val iconLinks = iconLink(iconNames, iconMainLink, iconNameLink) diff --git a/composeApp/src/commonMain/kotlin/ui/components/TextWithIcon.kt b/composeApp/src/commonMain/kotlin/ui/components/TextWithIcon.kt index 34e59b1..474802f 100644 --- a/composeApp/src/commonMain/kotlin/ui/components/TextWithIcon.kt +++ b/composeApp/src/commonMain/kotlin/ui/components/TextWithIcon.kt @@ -47,23 +47,35 @@ fun TextWithIcon( modifier = Modifier.padding(bottom = 8.dp), verticalAlignment = Alignment.CenterVertically ) { - Image( - modifier = Modifier.size(24.dp), - painter = imagePainter, - contentDescription = null, - ) + if (iconLink.isNotEmpty()) { + Image( + modifier = Modifier.size(24.dp), + painter = imagePainter, + contentDescription = null, + ) + Text( + modifier = Modifier.padding(horizontal = 6.dp), + text = iconName, + fontSize = bodyFontSize, + ) + } else { + if (it.isNotEmpty() && it != " ") { + Text( + text = iconName, + fontSize = bodyFontSize, + ) + } + } + } + println(it) + if (it.isNotEmpty() && it != " ") { Text( - modifier = Modifier.padding(horizontal = 6.dp), - text = iconName, - fontSize = bodyFontSize, + text = it, + color = MiuixTheme.colorScheme.onSecondaryVariant, + fontSize = 14.5.sp ) + Spacer(modifier = Modifier.height(padding)) } - Text( - text = it, - color = MiuixTheme.colorScheme.onSecondaryVariant, - fontSize = 14.5.sp - ) - Spacer(modifier = Modifier.height(padding)) } } } \ No newline at end of file