Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

커뮤니티 페이지 게시글 댓글 ui 변경 #83

Merged
merged 5 commits into from
Aug 15, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ data class PostResponse(
@SerializedName("date") val date: String,
@SerializedName("colorMode") val colorMode: Long,
@SerializedName("historyContent") val historyContent: String,
@SerializedName("commentCount") val commentCount: Long,
) {
fun toPostPreview(): PostPreview {
val destructedHistoryContent = historyContent.split('_')
Expand All @@ -33,6 +34,7 @@ data class PostResponse(
timeText = destructedHistoryContent[3],
paceText = destructedHistoryContent[4],
address = destructedHistoryContent[1],
commentCount = commentCount,
)
}

Expand All @@ -52,6 +54,7 @@ data class PostResponse(
timeText = destructedHistoryContent[3],
paceText = destructedHistoryContent[4],
address = destructedHistoryContent[1],
commentCount = commentCount,
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ data class Post(
val timeText: String = "",
val paceText: String = "",
val address: String = "",
val commentCount: Long = 0,
) : Serializable {
companion object {
val DUMMY =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ data class PostPreview(
val timeText: String = "",
val paceText: String = "",
val address: String = "",
val commentCount: Long = 0,
) {
companion object {
val DUMMY_LIST = listOf(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,13 @@ fun PostContentItem(

Icon(
modifier = Modifier
.graphicsLayer(scaleX = -1f)
.size(28.dp)
.clip(CircleShape)
.clickable {
onCommentClicked(post)
}
.padding(3.dp),
painter = painterResource(id = R.drawable.ic_comment_outlined_button),
painter = painterResource(id = R.drawable.ic_comment_button),
contentDescription = "댓글 버튼",
tint = WalkieColor.GrayBorder
)
Expand All @@ -94,7 +93,7 @@ fun PostContentItem(

Text(
modifier = Modifier.align(Alignment.CenterVertically),
text = "?", // todo replace real count
text = post.commentCount.toString(),
style = WalkieTypography.Body1_Normal,
color = WalkieColor.GrayBorder
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ fun CommunityScreen(navController: NavController) {
modifier =
Modifier
.clickable {
navController.navigate(Screen.AddPostScreen.route)
},
imageVector = Icons.Filled.Add,
contentDescription = "추가 버튼",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ import androidx.compose.foundation.layout.width
import androidx.compose.foundation.layout.wrapContentHeight
import androidx.compose.foundation.pager.HorizontalPager
import androidx.compose.foundation.pager.rememberPagerState
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.foundation.verticalScroll
import androidx.compose.material.Scaffold
import androidx.compose.material.Tab
import androidx.compose.material.TabRow
Expand Down Expand Up @@ -375,17 +377,25 @@ fun UserPageContent(
verticalAlignment = Alignment.Top,
) { pagerNum ->
when (pagerNum) {
0 -> state.userPostPreviewsState.getDataOrNull()?.let { postPreviews ->
PostPage(
nickname == null,
postPreviews,
onPostPreviewClicked,
onPostCreateClicked,
)
0 -> {
Column(
modifier = Modifier.verticalScroll(rememberScrollState())
) {
state.userPostPreviewsState.getDataOrNull()?.let { postPreviews ->
PostPage(
nickname == null,
postPreviews,
onPostPreviewClicked,
onPostCreateClicked,
)
}
}
}

1 -> {
Column {
Column(
modifier = Modifier.verticalScroll(rememberScrollState())
) {
HistoryPage(onDayClicked = onDateClicked)
state.calendarPreviewsState.getDataOrNull()
?.let { postPreviews ->
Expand All @@ -405,12 +415,16 @@ fun UserPageContent(
2 -> {
val itemList = state.challengingPreviewsState.getDataOrNull()
if (itemList != null) {
ChallengePage(
itemList,
onChallengePreviewClicked,
goChallengeMainScreen,
nickname == null
)
Column(
modifier = Modifier.verticalScroll(rememberScrollState())
) {
ChallengePage(
itemList,
onChallengePreviewClicked,
goChallengeMainScreen,
nickname == null
)
}
} else {
Box(Modifier.fillMaxSize()) {
CircularProgressIndicator(Modifier.align(Alignment.Center))
Expand Down
11 changes: 11 additions & 0 deletions presentation/src/main/res/drawable/ic_comment_button.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="20dp"
android:height="18dp"
android:viewportWidth="20"
android:viewportHeight="18">
<path
android:pathData="M12.823,16.362L13.204,16.234L13.575,16.388C15.627,17.239 17.01,16.928 17.855,16.506C17.957,16.454 18.053,16.401 18.143,16.346C18.102,16.313 18.061,16.279 18.021,16.244C17.493,15.796 16.765,14.984 16.765,13.951V13.505L17.082,13.19C17.886,12.391 18.386,11.196 18.386,8.97C18.386,4.689 14.574,1.073 9.73,1.073C4.885,1.073 1.073,4.689 1.073,8.97C1.073,13.251 4.885,16.867 9.73,16.867C10.816,16.867 11.859,16.685 12.823,16.362Z"
android:strokeWidth="2.14639"
android:fillColor="#00000000"
android:strokeColor="#E4E4E4"/>
</vector>

This file was deleted.

Loading