Skip to content

Commit

Permalink
[ANDROAPP-5591] Make SupportingText annotatedText stateless
Browse files Browse the repository at this point in the history
  • Loading branch information
andresmr committed Sep 27, 2023
1 parent c7ce3df commit 0961e94
Showing 1 changed file with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,13 @@ fun SupportingText(
) {
var isExpanded by remember { mutableStateOf(false) }
val textLayoutResultState = remember { mutableStateOf<TextLayoutResult?>(null) }
val nonClickableTextStyle = DHIS2SCustomTextStyles.regularSupportingText.copy(color = state.color)
val clickableTextStyle = DHIS2SCustomTextStyles.clickableSupportingText.copy(color = state.color)
val nonClickableTextStyle =
DHIS2SCustomTextStyles.regularSupportingText.copy(color = state.color)
val clickableTextStyle =
DHIS2SCustomTextStyles.clickableSupportingText.copy(color = state.color)
var isClickable by remember { mutableStateOf(false) }
var annotatedText by remember {
mutableStateOf(
buildAnnotatedString {
withStyle(style = nonClickableTextStyle) { append(text) }
},
)
var annotatedText = buildAnnotatedString {
withStyle(style = nonClickableTextStyle) { append(text) }
}
val seeMoreTag = "SEE_MORE"
val scope = rememberCoroutineScope()
Expand Down Expand Up @@ -168,4 +166,7 @@ enum class SupportingTextState(val color: Color) {
ERROR(SurfaceColor.Error),
}

data class SupportingTextData(val text: String, val state: SupportingTextState = SupportingTextState.DEFAULT)
data class SupportingTextData(
val text: String,
val state: SupportingTextState = SupportingTextState.DEFAULT,
)

0 comments on commit 0961e94

Please sign in to comment.