@@ -13,6 +13,7 @@ import androidx.compose.ui.Modifier
1313import androidx.compose.ui.layout.ContentScale
1414import androidx.compose.ui.res.painterResource
1515import androidx.compose.ui.res.stringResource
16+ import androidx.compose.ui.text.AnnotatedString
1617import androidx.compose.ui.text.style.TextAlign
1718import androidx.compose.ui.unit.dp
1819import com.ninecraft.booket.core.common.utils.HighlightedText
@@ -25,10 +26,21 @@ import com.ninecraft.booket.feature.onboarding.R
2526internal fun OnboardingPage (
2627 imageRes : Int ,
2728 titleRes : Int ,
28- highlightTextRes : Int ,
29+ highlightTextRes : Int? = null ,
2930 descriptionRes : Int ,
3031 modifier : Modifier = Modifier ,
3132) {
33+ val titleText =
34+ if (highlightTextRes != null ) {
35+ HighlightedText (
36+ fullText = stringResource(titleRes),
37+ highlightText = stringResource(highlightTextRes),
38+ highlightColor = ReedTheme .colors.bgPrimary,
39+ )
40+ } else {
41+ AnnotatedString (stringResource(titleRes))
42+ }
43+
3244 Column (
3345 modifier = modifier.fillMaxSize(),
3446 horizontalAlignment = Alignment .CenterHorizontally ,
@@ -44,11 +56,7 @@ internal fun OnboardingPage(
4456 )
4557 Spacer (modifier = Modifier .height(ReedTheme .spacing.spacing8))
4658 Text (
47- text = HighlightedText (
48- fullText = stringResource(titleRes),
49- highlightText = stringResource(highlightTextRes),
50- highlightColor = ReedTheme .colors.bgPrimary,
51- ),
59+ text = titleText,
5260 color = Black ,
5361 textAlign = TextAlign .Center ,
5462 style = ReedTheme .typography.heading1Bold,
0 commit comments