Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
348 changes: 336 additions & 12 deletions .idea/caches/deviceStreaming.xml

Large diffs are not rendered by default.

178 changes: 170 additions & 8 deletions app/src/main/java/com/hsLink/hslink/presentation/home/HomeScreen.kt
Original file line number Diff line number Diff line change
@@ -1,12 +1,38 @@
package com.hsLink.hslink.presentation.home

import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.Text
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.material3.HorizontalDivider
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.hsLink.hslink.R
import com.hsLink.hslink.core.designsystem.component.HsLinkTopBar
import com.hsLink.hslink.core.designsystem.theme.HsLinkTheme
import com.hsLink.hslink.presentation.home.component.HomeBottomContent
import com.hsLink.hslink.presentation.home.component.HomeCardItem
import com.hsLink.hslink.presentation.home.component.HomeCarousel
import com.hsLink.hslink.presentation.home.component.HomeContentField
import com.hsLink.hslink.presentation.home.component.HomePost
import com.hsLink.hslink.presentation.home.component.HomePostContainer

@Preview(showBackground = true)
@Composable
private fun HomeScreenPreview() {
HsLinkTheme {
HomeScreen(paddingValues = PaddingValues())
}
}

@Composable
fun HomeRoute(
Expand All @@ -22,11 +48,147 @@ fun HomeScreen(
paddingValues: PaddingValues,
modifier: Modifier = Modifier,
) {
Text(
text = "Home Screen",
style = HsLinkTheme.typography.body_16Normal,
color = HsLinkTheme.colors.SkyBlue100,
LazyColumn(
modifier = modifier
.padding(paddingValues)
)
}
.fillMaxSize()
.background(color = HsLinkTheme.colors.Common)
.padding(paddingValues),
) {
item {
HsLinkTopBar(
modifier = Modifier,
title = {
Image(
painter = painterResource(id = R.drawable.img_home_logo),
contentDescription = null,
modifier = Modifier
.height(48.dp)
.width(92.dp),
contentScale = ContentScale.FillBounds,
)
},
rightIconFirst = null,
rightIconSecond = null,
leftIcon = null
)
}

item {
HomeCarousel(
pagerImages = listOf(
"https://cdn.edujin.co.kr/news/photo/202209/39788_81397_67.png",
"image2",
"image3"
),
)
}
Comment on lines +76 to +84
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Replace invalid carousel items or add image placeholders

The entries "image2" and "image3" are not valid URIs and will fail image loading. Either supply valid URLs or ensure HomeCarousel’s AsyncImage has placeholder/error.

Run to confirm placeholder/error handling in HomeCarousel:

Expected: AsyncImage configured with placeholder() and error() or a fallback painter.


🏁 Script executed:

#!/bin/bash
rg -n -C2 'AsyncImage\(' app/src/main/java/com/hsLink/hslink/presentation/home/component/HomeCarousel.kt

Length of output: 191


Running verification to see the complete AsyncImage configuration:


---

🏁 Script executed:

```shell
#!/bin/bash
rg -n -C5 'AsyncImage\(' app/src/main/java/com/hsLink/hslink/presentation/home/component/HomeCarousel.kt

Length of output: 385


Add placeholder/error handling or replace invalid carousel URLs

The AsyncImage in HomeCarousel lacks placeholder/error parameters. Invalid URIs ("image2", "image3") will fail to load with no visual fallback. Either supply valid URLs or add placeholder() and error() parameters to AsyncImage (lines 54-58 of HomeCarousel.kt).

🤖 Prompt for AI Agents
In app/src/main/java/com/hsLink/hslink/presentation/home/HomeScreen.kt around
lines 76-84, HomeCarousel is being given invalid image URIs ("image2", "image3")
and the AsyncImage used inside HomeCarousel (see HomeCarousel.kt lines ~54-58)
has no placeholder/error handling; update either the passed pagerImages to valid
URLs or, preferably, modify the AsyncImage call to include placeholder() and
error() parameters (using a local drawable/painter or default composable) and
optionally a fallback() for nulls so users see a sensible visual when loading
fails; ensure the placeholder and error painters are imported and used
consistently and that any test images are replaced or guarded before being
passed in.


item {
Spacer(modifier = Modifier.height(32.dp))

HomeContentField(
mainText = "멘토링 신청",
subText = "한성선배님께 멘토링을\n신청해보세요!",
)
}

item {
Spacer(modifier = Modifier.height(16.dp))

HomeCardItem(
userName = "송효재",
userMajor = "회계재무경영",
userInfo = "구직중,졸업",
modifier = Modifier.padding(horizontal = 16.dp, vertical = 8.dp)
)
}

item {
Spacer(modifier = Modifier.height(40.dp))

HomeContentField(
mainText = "인기 게시글",
subText = "실시간 인기 게시글을\n확인해보세요!",
)
}

item {
Spacer(modifier = Modifier.height(16.dp))

HomePostContainer(
posts = listOf(
HomePost(
id = "1",
title = "2026 카카오 신입 공채",
route = "route1"
),
HomePost(
id = "2",
title = "선배가 알려주는 이력서 꿀팁",
route = "route2"
),
HomePost(
id = "3",
title = "선배가 알려주는 이력서 꿀팁",
route = "route3"
),
HomePost(
id = "4",
title = "선배가 알려주는 이력서 꿀팁",
route = "route4"
),
HomePost(
id = "5",
title = "선배가 알려주는 이력서 꿀팁",
route = "route5"
)

),
onPostClick = {},
modifier = Modifier.padding(horizontal = 16.dp, vertical = 8.dp)
)
}

item {
Spacer(modifier = Modifier.height(40.dp))

HomeContentField(
mainText = "최신 홍보 게시글",
subText = "실시간 홍보 게시물을\n확인해보세요!",
)
}

item {
HomeCardItem(
userName = "한성대학생이 카카오에 취직하는 가장 확실한 방법을 알려드립니다.",
userMajor = "한성대학교에 다니는 후배들이 취업고민이 많을 것 같은디,테스트용입니다",
userInfo = "08학번 성규현",
modifier = Modifier.padding(horizontal = 16.dp, vertical = 8.dp)
)
}

item {
Spacer(modifier = Modifier.height(36.dp))

HorizontalDivider(
thickness = 1.dp,
color = HsLinkTheme.colors.Grey100
)
}

item {
HomeBottomContent(
onClick = { },
)
}

item {
HorizontalDivider(
thickness = 1.dp,
color = HsLinkTheme.colors.Grey100
)
}

}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
package com.hsLink.hslink.presentation.home.component

import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.width
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.hsLink.hslink.R
import com.hsLink.hslink.core.designsystem.theme.HsLinkTheme
import com.hsLink.hslink.core.util.noRippleClickable

@Preview(showBackground = true)
@Composable
private fun HomeBottomContentPreview() {
HsLinkTheme {
HomeBottomContent(
onClick = {},
)
}
}

@Composable
fun HomeBottomContent(
onClick: () -> Unit,
modifier: Modifier = Modifier,
) {
Column(
modifier = modifier
.fillMaxWidth()
.padding(horizontal = 24.dp, vertical = 32.dp),
horizontalAlignment = Alignment.Start,
verticalArrangement = Arrangement.spacedBy(4.dp)
) {
Image(
painter = painterResource(id = R.drawable.img_home_logo),
contentDescription = null,
modifier = Modifier
.height(48.dp)
.width(92.dp),
)
Spacer(modifier = Modifier.height(8.dp))

Text(
text = "이용약관 및 개인정보 취급방침",
color = HsLinkTheme.colors.Grey400,
style = HsLinkTheme.typography.btm_M,
modifier = Modifier.noRippleClickable(onClick = onClick)
)
Text(
text = "리뷰운영정책",
color = HsLinkTheme.colors.Grey400,
style = HsLinkTheme.typography.btm_M,
modifier = Modifier.noRippleClickable(onClick = onClick)
)

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
package com.hsLink.hslink.presentation.home.component

import androidx.compose.foundation.border
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.Icon
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.res.vectorResource
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.hsLink.hslink.R
import com.hsLink.hslink.core.designsystem.theme.HsLinkTheme

@Preview(showBackground = true)
@Composable
private fun PreviewHomeCardItem() {
HsLinkTheme {
HomeCardItem(
userName = "John Doe",
userMajor = "Computer Science",
userInfo = "Senior at XYZ University",
modifier = Modifier
)
}
}

@Composable
fun HomeCardItem(
userName: String,
userMajor: String,
userInfo: String,
modifier: Modifier = Modifier,
) {
Row(
modifier = modifier
.fillMaxWidth()
.border(
width = 1.dp,
color = HsLinkTheme.colors.Grey100,
shape = RoundedCornerShape(8.dp)
)
.padding(16.dp),
verticalAlignment = Alignment.CenterVertically,
) {
Column(
modifier = Modifier.weight(1f),
verticalArrangement = Arrangement.spacedBy(4.dp)
) {
Text(
text = userName,
color = HsLinkTheme.colors.Grey700,
style = HsLinkTheme.typography.title_16Strong,
maxLines = 1,
overflow = TextOverflow.Ellipsis
)

Text(
text = userMajor,
color = HsLinkTheme.colors.Grey700,
style = HsLinkTheme.typography.body_14Normal,
maxLines = 1,
overflow = TextOverflow.Ellipsis
)

Text(
text = userInfo,
color = HsLinkTheme.colors.Grey400,
style = HsLinkTheme.typography.caption_12Normal, maxLines = 1,
overflow = TextOverflow.Ellipsis
)
}

Spacer(modifier = Modifier.weight(1f))

Icon(
imageVector = ImageVector.vectorResource(id = R.drawable.ic_home_arrow_right),
contentDescription = null,
tint = HsLinkTheme.colors.Grey200
)
}
}
Loading