mirror of
https://github.com/msfjarvis/compose-lobsters
synced 2025-08-13 18:27:00 +05:30
feat(common): add preview for ThemedRichText
This commit is contained in:
parent
2f7291844f
commit
0da964e790
1 changed files with 25 additions and 0 deletions
|
@ -13,6 +13,8 @@ import com.halilibo.richtext.markdown.Markdown
|
|||
import com.halilibo.richtext.ui.RichText
|
||||
import com.halilibo.richtext.ui.RichTextStyle
|
||||
import com.halilibo.richtext.ui.string.RichTextStringStyle
|
||||
import dev.msfjarvis.claw.common.theme.LobstersTheme
|
||||
import dev.msfjarvis.claw.common.ui.preview.ThemePreviews
|
||||
|
||||
@Composable
|
||||
fun ThemedRichText(
|
||||
|
@ -39,3 +41,26 @@ fun ThemedRichText(
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ThemePreviews
|
||||
@Composable
|
||||
fun ThemedRichTextPreview() {
|
||||
val text =
|
||||
"""
|
||||
### Heading
|
||||
This is a paragraph body
|
||||
|
||||
```
|
||||
This is a code block
|
||||
```
|
||||
|
||||
This is an `inline code block`
|
||||
|
||||
[This is a link](https://github.com/msfjarvis/compose-lobsters)
|
||||
|
||||

|
||||
"""
|
||||
.trimIndent()
|
||||
|
||||
LobstersTheme { ThemedRichText(text = text) }
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue