Skip to content

feat/week2#15

Open
ymina25 wants to merge 1 commit intoApptiveDev:인민에이from
ymina25:feat/week2
Open

feat/week2#15
ymina25 wants to merge 1 commit intoApptiveDev:인민에이from
ymina25:feat/week2

Conversation

@ymina25
Copy link
Copy Markdown

@ymina25 ymina25 commented Apr 29, 2026

week2 과제 - SNS feed

Copy link
Copy Markdown
Collaborator

@yeochaeeon yeochaeeon left a comment

Choose a reason for hiding this comment

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

과제한다고 수고하셨어요~
오늘 스터디 때 뵐게요!!

.fillMaxWidth()
.padding(vertical = 12.dp, horizontal = 8.dp)
) {
stories.forEach { story ->
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

현재 StoriesBar에서 Row 내부에 forEach를 사용하셨는데, 스토리가 20~30개로 늘어나면 화면 밖의 아이템까지 한꺼번에 그려 성능이 저하될 수 있습니다.

LazyRow를 사용하면 화면에 보이는 부분만 그리기 때문에 훨씬 효율적입니다! LazyRow에 대해 한 번 알아보면 좋을 것 같습니다!

)

@Composable
fun SnsFeedScreen() {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

현재 SnsFeedScreen 함수 안에 하나의 피드를 그리는 UI가 직접 포함되어 있습니다.
만약 피드가 10개 이상으로 늘어난다면, 동일한 UI를 반복해서 구성해야 하기 때문에 코드가 길어지고 관리가 어려워질 수 있습니다.

피드 하나를 그리는 부분을 별도의 @composable 함수(예: PostCard)로 분리하고,
그 안에서도 헤더, 이미지, 액션 버튼 등 화면 구성 요소를 작은 단위의 컴포저블로 나누어 구성하고 상위의 SnsFeedScreen에서는 해당 컴포저블 함수들을 호출하는 구조로 사용하면
코드의 가독성과 재사용성이 훨씬 좋아질 것 같습니다.

이런 구조로 변경했을 때 어떤 점이 더 좋아지는지도 함께 고민해보면 좋겠습니다

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants