Skip to content

Commit f2502c8

Browse files
authored
Merge pull request #20 from DevelopersBreach/shreyas/syntax-code-block
Display syntax within a `CodeExampleBox` on the detail screen
2 parents c6167b4 + 6ceab48 commit f2502c8

File tree

4 files changed

+8
-9
lines changed

4 files changed

+8
-9
lines changed

README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
- [ ] Assign unique IDs to objects and enforce consistent ordering logic
2828
- [ ] Correct usage of visibility modifiers across the codebase
2929
- [ ] Introduce common `@Preview` annotations for reusable Composable previews
30-
- [ ] Add inline code formatting support for syntax display on the `Detail Screen`
30+
- [x] Add code block for syntax display on the `Detail Screen`
3131
- [ ] Implement caching on the `Detail Screen` to store previously viewed topic data
3232
- [ ] Implement dynamic topic loading in `TopicRepository` to support scalability
3333
- [ ] Integrate Room database to persist bookmark states
@@ -74,10 +74,9 @@ Here’s an early concept image illustrating the app’s design:
7474

7575
Here are a couple of early previews from the Android version of the app:
7676

77-
<p>
78-
<img src="assets/img_topic_screen.png" alt="Topic Screen" width="150"/>
79-
<img src="assets/img_detail_screen_variables.png" alt="Detail Screen" width="150"/>
80-
</p>
77+
| Topic | Detail |
78+
| :---: | :----: |
79+
| <img src="assets/img_topic_screen.png" alt="Topic Screen" width="200"/> | <img src="assets/img_detail_screen_variables.png" alt="Detail Screen" width="200" /> |
8180

8281
> *More previews coming soon as the UI progresses!*
8382
-1.28 MB
Loading

assets/img_topic_screen.png

-94.8 KB
Loading

composeApp/src/commonMain/kotlin/com/developersbreach/kotlindictionarymultiplatform/ui/screens/detail/DetailScreenComponents.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package com.developersbreach.kotlindictionarymultiplatform.ui.screens.detail
33
import androidx.compose.foundation.clickable
44
import androidx.compose.foundation.layout.Spacer
55
import androidx.compose.foundation.layout.height
6+
import androidx.compose.foundation.layout.padding
67
import androidx.compose.material3.MaterialTheme
78
import androidx.compose.runtime.Composable
89
import androidx.compose.ui.Modifier
@@ -63,10 +64,9 @@ fun SyntaxSection(
6364
color = MaterialTheme.colorScheme.onPrimary,
6465
)
6566
Spacer(Modifier.height(4.dp))
66-
KdText(
67-
modifier = Modifier,
68-
text = syntax.signature,
69-
style = MaterialTheme.typography.bodyMedium,
67+
CodeExampleBox(
68+
code = syntax.signature,
69+
modifier = Modifier.padding(bottom = 8.dp),
7070
)
7171
syntax.notes?.let {
7272
Spacer(Modifier.height(4.dp))

0 commit comments

Comments
 (0)