Skip to content

Commit 3d3faef

Browse files
committed
fix: formatting in codeblock
1 parent d926890 commit 3d3faef

File tree

1 file changed

+20
-15
lines changed

1 file changed

+20
-15
lines changed

src/pages/news/storytale/index.md

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -36,24 +36,29 @@ We will also provide developers with a set of runtime APIs and Gradle tasks, whi
3636

3737
Let's write a simple use case, assuming we have a `PrimaryButton` component.
3838

39-
`@Composable`
40-
`fun PrimaryButton(`
41-
`text: String,`
42-
`onClick: () -> Unit = {},`
43-
`enabled: Boolean = true`
44-
`) {`
45-
`Button(onClick = onClick, enabled = enabled) {`
46-
`Text(text)`
47-
`}`
48-
`}`
39+
```kotlin
40+
@Composable
41+
fun PrimaryButton(
42+
text: String,
43+
onClick: () -> Unit = {},
44+
enabled: Boolean = true
45+
) {
46+
Button(onClick = onClick, enabled = enabled) {
47+
Text(text)
48+
}
49+
}
50+
```
4951

5052
In the project, we can create a `commonStories` folder and then write the following code:
5153

52-
`val PrimaryButton by story {`
53-
`val enabled by parameter(true)`
54-
`val text by parameter("Click Me")`
55-
`PrimaryButton(text = text, enabled = enabled)`
56-
**`}`**
54+
```kotlin
55+
val PrimaryButton by story {
56+
val enabled by parameter(true)
57+
val text by parameter("Click Me")
58+
59+
PrimaryButton(text = text, enabled = enabled)
60+
}
61+
```
5762

5863
Then, depending on the target platform, we can run the `storiesRun` command, and we'll be able to see this visualized component on the corresponding platform. We'll also be able to edit `PrimaryButton`'s text and enabled parameters. That's it\!
5964

0 commit comments

Comments
 (0)