Skip to content

Commit

Permalink
feat: 댓글 뷰 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
rhkrwngud445 committed Jan 5, 2025
1 parent 7b18480 commit ab70175
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.withpeace.withpeace.core.ui.comment

import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.Icon
Expand All @@ -14,11 +15,14 @@ import com.withpeace.withpeace.core.ui.R

@Composable
fun CommentSize(
modifier: Modifier = Modifier,
commentSize: Int,
horizontalArrangement: Arrangement.Horizontal = Arrangement.Start
) {
Row(
modifier = Modifier.padding(horizontal = WithpeaceTheme.padding.BasicHorizontalPadding),
modifier = modifier.padding(horizontal = WithpeaceTheme.padding.BasicHorizontalPadding),
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = horizontalArrangement
) {
Icon(
painter = painterResource(id = R.drawable.ic_chat),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.offset
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.HorizontalDivider
Expand All @@ -31,6 +32,12 @@ import androidx.compose.ui.unit.dp
import androidx.hilt.navigation.compose.hiltViewModel
import com.withpeace.withpeace.core.designsystem.theme.WithpeaceTheme
import com.withpeace.withpeace.core.designsystem.ui.WithPeaceBackButtonTopAppBar
import com.withpeace.withpeace.core.ui.DateUiModel
import com.withpeace.withpeace.core.ui.comment.CommentSection
import com.withpeace.withpeace.core.ui.comment.CommentSize
import com.withpeace.withpeace.core.ui.post.CommentUiModel
import com.withpeace.withpeace.core.ui.post.CommentUserUiModel
import java.time.LocalDateTime

@Composable
fun BalanceGameRoute(
Expand Down Expand Up @@ -240,6 +247,7 @@ fun BalanceGameScreen(
}
Spacer(modifier = modifier.height(12.dp))
Row(
verticalAlignment = Alignment.CenterVertically,
modifier = modifier
.fillMaxWidth()
.padding(horizontal = 24.dp),
Expand All @@ -256,6 +264,27 @@ fun BalanceGameScreen(
color = WithpeaceTheme.colors.SystemGray2,
)
}
Spacer(modifier = modifier.height(8.dp))
CommentSize(modifier.fillMaxWidth(), commentSize = 5)
Spacer(modifier = modifier.height(8.dp))
LazyColumn {
CommentSection(
comments = List(5) {
CommentUiModel(
id = it.toLong(),
content = "가나다",
createDate = DateUiModel(LocalDateTime.now()),
commentUser = CommentUserUiModel(
id = it.toLong(),
nickname = "청하다",
profileImageUrl = ""
),
isMyComment = false
)
},
onReportComment = { _, _ -> },
)
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
package com.withpeace.withpeace.feature.balancegame

import androidx.lifecycle.ViewModel
import dagger.hilt.android.lifecycle.HiltViewModel
import javax.inject.Inject

@HiltViewModel
class BalanceGameViewModel @Inject constructor(
) : ViewModel() {
init {
}

fun onClickBeforeDay() {

}

fun onClickAfterDay() {

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -652,3 +652,4 @@ private fun PostDetailScreenPreview() {
)
}
}
//TODO 하단 댓글창 및 댓글 창 밸런스 게임 선택

0 comments on commit ab70175

Please sign in to comment.