Skip to content

Commit ef0817d

Browse files
committed
feat: Some fine tuning
1 parent b2971c8 commit ef0817d

File tree

4 files changed

+36
-10
lines changed

4 files changed

+36
-10
lines changed

composeApp/src/wasmJsMain/kotlin/org/nsh07/nsh07/network/GitHubApiClient.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class GitHubApiClient(
2323
parameter("q", "user:$username")
2424
parameter("sort", "stars")
2525
parameter("order", "desc")
26-
parameter("per_page", "5")
26+
parameter("per_page", "3")
2727
}
2828
} catch (_: UnresolvedAddressException) {
2929
return Result.Error(NetworkError.NO_INTERNET)

composeApp/src/wasmJsMain/kotlin/org/nsh07/nsh07/ui/homeScreen/AppHomeScreen.kt

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ fun AppHomeScreen(
185185
.padding(start = cardPadding)
186186
.clickable { uriHandler.openUri("https://www.linkedin.com/in/nsh07/") }
187187
) {
188-
Text("View LinkedIn Profile ", style = typography.bodyLarge, fontWeight = FontWeight.SemiBold)
188+
Text("View LinkedIn profile ", style = typography.bodyLarge, fontWeight = FontWeight.SemiBold)
189189
Icon(painterResource(Res.drawable.open_in_browser), null, Modifier.size(16.dp))
190190
}
191191
Spacer(Modifier.height(112.dp))
@@ -194,10 +194,21 @@ fun AppHomeScreen(
194194
ProjectCard(
195195
project = it,
196196
cardPadding = cardPadding,
197-
projectImageUri = "",
198197
modifier = Modifier.padding(bottom = 32.dp)
199198
)
200199
}
200+
item("github link text") {
201+
Row(
202+
verticalAlignment = Alignment.CenterVertically,
203+
modifier = Modifier
204+
.padding(start = cardPadding)
205+
.clickable { uriHandler.openUri("https://github.com/nsh07") }
206+
) {
207+
Text("View all projects on GitHub ", style = typography.bodyLarge, fontWeight = FontWeight.SemiBold)
208+
Icon(painterResource(Res.drawable.open_in_browser), null, Modifier.size(16.dp))
209+
}
210+
Spacer(Modifier.height(112.dp))
211+
}
201212
item("work in progress") {
202213
Column(
203214
horizontalAlignment = Alignment.CenterHorizontally,

composeApp/src/wasmJsMain/kotlin/org/nsh07/nsh07/ui/homeScreen/ExperienceCard.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import androidx.compose.foundation.background
44
import androidx.compose.foundation.clickable
55
import androidx.compose.foundation.layout.*
66
import androidx.compose.foundation.shape.CircleShape
7+
import androidx.compose.material3.ExperimentalMaterial3ExpressiveApi
78
import androidx.compose.material3.Icon
89
import androidx.compose.material3.MaterialTheme.colorScheme
910
import androidx.compose.material3.MaterialTheme.shapes
@@ -27,6 +28,7 @@ import org.jetbrains.compose.resources.painterResource
2728
import kotlin.text.Typography.bullet
2829
import kotlin.text.Typography.mdash
2930

31+
@OptIn(ExperimentalMaterial3ExpressiveApi::class)
3032
@Composable
3133
fun ExperienceCard(
3234
experience: Experience,
@@ -38,7 +40,7 @@ fun ExperienceCard(
3840

3941
Box(
4042
modifier
41-
.clip(shapes.large)
43+
.clip(shapes.largeIncreased)
4244
.clickable { uriHandler.openUri(experience.companyUrl) }
4345
) {
4446
Row(Modifier.fillMaxWidth().padding(cardPadding)) {

composeApp/src/wasmJsMain/kotlin/org/nsh07/nsh07/ui/homeScreen/ProjectCard.kt

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
package org.nsh07.nsh07.ui.homeScreen
22

3+
import androidx.compose.foundation.border
34
import androidx.compose.foundation.clickable
45
import androidx.compose.foundation.layout.*
6+
import androidx.compose.material3.CircularWavyProgressIndicator
7+
import androidx.compose.material3.ExperimentalMaterial3ExpressiveApi
58
import androidx.compose.material3.Icon
69
import androidx.compose.material3.MaterialTheme.colorScheme
710
import androidx.compose.material3.MaterialTheme.shapes
@@ -23,28 +26,38 @@ import nsh07.composeapp.generated.resources.star
2326
import org.jetbrains.compose.resources.painterResource
2427
import org.nsh07.nsh07.network.Repo
2528

29+
@OptIn(ExperimentalMaterial3ExpressiveApi::class)
2630
@Composable
2731
fun ProjectCard(
2832
project: Repo,
2933
cardPadding: Dp,
30-
projectImageUri: String,
3134
modifier: Modifier = Modifier,
32-
projectDescription: String? = null
35+
imageUri: String? = null,
36+
description: String? = null,
3337
) {
3438
val colorScheme = colorScheme
3539
val uriHandler = LocalUriHandler.current
3640

3741
Box(
3842
modifier
39-
.clip(shapes.large)
43+
.clip(shapes.largeIncreased)
4044
.clickable { uriHandler.openUri(project.htmlUrl) }
4145
) {
4246
Row(Modifier.fillMaxWidth().padding(cardPadding)) {
4347
SubcomposeAsyncImage(
44-
model = projectImageUri,
48+
model = imageUri
49+
?: "https://raw.githubusercontent.com/${project.fullName}/refs/heads/main/fastlane/metadata/android/en-US/images/featureGraphic.png",
4550
contentDescription = null,
4651
contentScale = ContentScale.Crop,
47-
modifier = Modifier.padding(end = 16.dp).weight(1f)
52+
modifier = Modifier.padding(top = 4.dp, end = 16.dp).weight(1f).clip(shapes.large),
53+
loading = {
54+
Box(Modifier.fillMaxWidth().aspectRatio(2f)) {
55+
CircularWavyProgressIndicator(Modifier.align(Alignment.Center))
56+
}
57+
},
58+
error = {
59+
Box(Modifier.fillMaxWidth().aspectRatio(2f).border(1.dp, colorScheme.outline, shapes.large))
60+
}
4861
)
4962
Column(Modifier.weight(3f)) {
5063
FlowRow(itemVerticalAlignment = Alignment.CenterVertically) {
@@ -56,7 +69,7 @@ fun ProjectCard(
5669
)
5770
}
5871
Text(
59-
projectDescription ?: project.description,
72+
description ?: project.description,
6073
style = typography.bodyMedium,
6174
color = colorScheme.onSurfaceVariant,
6275
modifier = Modifier.padding(top = 8.dp)

0 commit comments

Comments
 (0)