From 95e5120be3965c04bae1bb1210a4e23abeb565d2 Mon Sep 17 00:00:00 2001 From: ruh0n Date: Mon, 2 Dec 2024 17:16:56 +0900 Subject: [PATCH 1/6] =?UTF-8?q?fix:=20=EA=B8=B4=20=EB=8C=93=EA=B8=80=20?= =?UTF-8?q?=ED=99=95=EC=9D=B8=EC=9D=84=20=EC=9C=84=ED=95=9C=20preview=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../boostcamp/dreamteam/dreamdiary/community/model/CommentUi.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/feature/community/src/main/java/com/boostcamp/dreamteam/dreamdiary/community/model/CommentUi.kt b/feature/community/src/main/java/com/boostcamp/dreamteam/dreamdiary/community/model/CommentUi.kt index 0b89da9f..93076b1f 100644 --- a/feature/community/src/main/java/com/boostcamp/dreamteam/dreamdiary/community/model/CommentUi.kt +++ b/feature/community/src/main/java/com/boostcamp/dreamteam/dreamdiary/community/model/CommentUi.kt @@ -33,7 +33,7 @@ internal val commentUiPreview1 = CommentUi( internal val commentUiPreview2 = CommentUi( id = "2", author = userUiPreview2, - content = "댓글 내용", + content = "두얏나점은 검미달의 검꼬허어 윽남산습니다 으경인퉀은, 막악박느히다 단으타후 이난류에서. 브터롸어 훌셔다 아낙마식, 줍이까가는 곰븡앨똔긴흔은 횜지색도 니븧이도. 하둔칭대고라일깅밨 비아릐오다가 모요게갠 익혹게 잠느가 도냐자아야 우먹하덜군 레언어저다 매허가 켕올은. 러이할 가그아맀이라 븓너데데스딘 요돈난닌은 브벖링아느어야 안샜댑비다, 도비에 가즤겐은 격달호버를 연닐으로. 게고를 부흐뎌댸를 디가, 돘판으는 하논잔바자두가 퇭곤처럼, 살즈디디노길. 지다그어 양발구으 저징즌디긴꺈 세엤소긱이 델시 촐고으촹을 멧지를 긴느마 애히이엤안으라. 내샤민노아서 눅닐여러다 런노알 춘앨 딩혼 더슴을 반군퇀저후시를 시흥섰 매네다. 머바사를 사늰켱이 난혐셔에서 하저 이도 바팅므산 시오 호숸훕니다 냐디타닥 기니행.", isLiked = false, ) From df978913ee837f7277b29f6f9159815361baaef2 Mon Sep 17 00:00:00 2001 From: ruh0n Date: Mon, 2 Dec 2024 17:59:09 +0900 Subject: [PATCH 2/6] =?UTF-8?q?feat:=20=EB=8C=93=EA=B8=80=20=EB=AA=A8?= =?UTF-8?q?=EC=96=91=20=EB=B3=80=EA=B2=BD(=EC=9C=A0=ED=8A=9C=EB=B8=8C=20?= =?UTF-8?q?=EB=8C=93=EA=B8=80=20=EC=B0=B8=EA=B3=A0)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/CommunityDetailComment.kt | 79 +++++++++++++------ 1 file changed, 57 insertions(+), 22 deletions(-) diff --git a/feature/community/src/main/java/com/boostcamp/dreamteam/dreamdiary/community/detail/component/CommunityDetailComment.kt b/feature/community/src/main/java/com/boostcamp/dreamteam/dreamdiary/community/detail/component/CommunityDetailComment.kt index 8dcf12c3..8cd2f37b 100644 --- a/feature/community/src/main/java/com/boostcamp/dreamteam/dreamdiary/community/detail/component/CommunityDetailComment.kt +++ b/feature/community/src/main/java/com/boostcamp/dreamteam/dreamdiary/community/detail/component/CommunityDetailComment.kt @@ -1,15 +1,26 @@ package com.boostcamp.dreamteam.dreamdiary.community.detail.component +import androidx.compose.foundation.layout.Box +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.layout.size -import androidx.compose.material3.ListItem -import androidx.compose.material3.LocalContentColor +import androidx.compose.foundation.layout.width +import androidx.compose.material.icons.Icons +import androidx.compose.material.icons.filled.MoreVert +import androidx.compose.material3.Icon +import androidx.compose.material3.IconButton import androidx.compose.material3.LocalTextStyle import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.Surface import androidx.compose.material3.Text import androidx.compose.runtime.Composable -import androidx.compose.runtime.CompositionLocalProvider +import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip +import androidx.compose.ui.draw.scale import androidx.compose.ui.layout.ContentScale import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp @@ -24,32 +35,56 @@ internal fun CommunityDetailComment( comment: CommentUi, modifier: Modifier = Modifier, ) { - CompositionLocalProvider( - LocalContentColor provides MaterialTheme.colorScheme.surface, - LocalTextStyle provides LocalTextStyle.current.copy( - color = MaterialTheme.colorScheme.onSurface, - ), - ) { - ListItem( - headlineContent = { Text(text = comment.content) }, - modifier = modifier, - overlineContent = { - Text( - text = comment.author.username, - color = MaterialTheme.colorScheme.onSurfaceVariant, - ) - }, - leadingContent = { + Surface(modifier = modifier) { + Box { + Row( + modifier = Modifier + .fillMaxWidth() + .padding(horizontal = 16.dp, vertical = 8.dp) + ) { DdAsyncImage( model = comment.author.profileImageUrl, contentDescription = null, modifier = Modifier - .size(40.dp) + .size(24.dp) .clip(MaterialTheme.shapes.extraLarge), contentScale = ContentScale.Crop, ) - }, - ) + Spacer(modifier = Modifier.width(16.dp)) + + Column( + modifier = Modifier + .fillMaxWidth() + .weight(1f) + .padding(end = 12.dp), + ) { + Text( + text = comment.author.username, + style = MaterialTheme.typography.labelMedium.copy( + color = MaterialTheme.colorScheme.onSurfaceVariant.copy(alpha = 0.8f), + ), + maxLines = 1, + ) + Text( + text = comment.content, + style = MaterialTheme.typography.bodyMedium, + lineHeight = LocalTextStyle.current.fontSize * 1.5f, + ) + } + } + IconButton( + onClick = { }, + modifier = Modifier + .align(Alignment.TopEnd) + .scale(0.7f), + ) { + Icon( + imageVector = Icons.Default.MoreVert, + contentDescription = null, + tint = MaterialTheme.colorScheme.onSurfaceVariant.copy(alpha = 0.6f), + ) + } + } } } From 82a14a2d4592876863ed81e86d6a373779a4f725 Mon Sep 17 00:00:00 2001 From: ruh0n Date: Mon, 2 Dec 2024 18:17:13 +0900 Subject: [PATCH 3/6] =?UTF-8?q?feat:=20=EB=AF=B8=EA=B5=AC=ED=98=84=20?= =?UTF-8?q?=EA=B8=B0=EB=8A=A5=20toast=EB=A5=BC=20=ED=98=B8=EC=B6=9C?= =?UTF-8?q?=ED=95=B4=EC=A3=BC=EB=8A=94=20=ED=95=A8=EC=88=98=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dreamdiary/ui/util/NotImplementedFeature.kt | 9 +++++++++ core/ui/src/main/res/values/strings.xml | 1 + 2 files changed, 10 insertions(+) create mode 100644 core/ui/src/main/java/com/boostcamp/dreamteam/dreamdiary/ui/util/NotImplementedFeature.kt diff --git a/core/ui/src/main/java/com/boostcamp/dreamteam/dreamdiary/ui/util/NotImplementedFeature.kt b/core/ui/src/main/java/com/boostcamp/dreamteam/dreamdiary/ui/util/NotImplementedFeature.kt new file mode 100644 index 00000000..c7a99554 --- /dev/null +++ b/core/ui/src/main/java/com/boostcamp/dreamteam/dreamdiary/ui/util/NotImplementedFeature.kt @@ -0,0 +1,9 @@ +package com.boostcamp.dreamteam.dreamdiary.ui.util + +import android.content.Context +import android.widget.Toast +import com.boostcamp.dreamteam.dreamdiary.ui.R + +fun notImplementedFeature(context: Context) { + Toast.makeText(context, context.getString(R.string.not_implemented_feature), Toast.LENGTH_SHORT).show() +} diff --git a/core/ui/src/main/res/values/strings.xml b/core/ui/src/main/res/values/strings.xml index 557c3db2..9fb4e621 100644 --- a/core/ui/src/main/res/values/strings.xml +++ b/core/ui/src/main/res/values/strings.xml @@ -10,4 +10,5 @@ 이 기능을 사용하려면 로그인이 필요해요.\n로그인 할까요? 확인 취소 + 미구현 기능입니다. 다음 업데이트를 기대해주세요! :) From 7a86c7934092cc9126a304e86cb611fdb17c71aa Mon Sep 17 00:00:00 2001 From: ruh0n Date: Mon, 2 Dec 2024 18:17:30 +0900 Subject: [PATCH 4/6] =?UTF-8?q?feat:=20=EB=8C=93=EA=B8=80=EC=9D=98=20?= =?UTF-8?q?=EC=95=84=EC=9D=B4=EC=BD=98=20=EB=B2=84=ED=8A=BC=EC=9D=80=20?= =?UTF-8?q?=EB=AF=B8=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../community/detail/component/CommunityDetailComment.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/feature/community/src/main/java/com/boostcamp/dreamteam/dreamdiary/community/detail/component/CommunityDetailComment.kt b/feature/community/src/main/java/com/boostcamp/dreamteam/dreamdiary/community/detail/component/CommunityDetailComment.kt index 8cd2f37b..2cabc398 100644 --- a/feature/community/src/main/java/com/boostcamp/dreamteam/dreamdiary/community/detail/component/CommunityDetailComment.kt +++ b/feature/community/src/main/java/com/boostcamp/dreamteam/dreamdiary/community/detail/component/CommunityDetailComment.kt @@ -22,6 +22,7 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip import androidx.compose.ui.draw.scale import androidx.compose.ui.layout.ContentScale +import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import com.boostcamp.dreamteam.dreamdiary.community.model.CommentUi @@ -29,6 +30,7 @@ import com.boostcamp.dreamteam.dreamdiary.community.model.commentUiPreview1 import com.boostcamp.dreamteam.dreamdiary.community.model.commentUiPreview2 import com.boostcamp.dreamteam.dreamdiary.designsystem.component.DdAsyncImage import com.boostcamp.dreamteam.dreamdiary.designsystem.theme.DreamdiaryTheme +import com.boostcamp.dreamteam.dreamdiary.ui.util.notImplementedFeature @Composable internal fun CommunityDetailComment( @@ -72,8 +74,9 @@ internal fun CommunityDetailComment( ) } } + val context = LocalContext.current IconButton( - onClick = { }, + onClick = { notImplementedFeature(context) }, modifier = Modifier .align(Alignment.TopEnd) .scale(0.7f), From 29a11efcd6f9c88455af35638153c365b9bee374 Mon Sep 17 00:00:00 2001 From: ruh0n Date: Mon, 2 Dec 2024 18:29:28 +0900 Subject: [PATCH 5/6] =?UTF-8?q?style:=20trailing=20comma=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../community/detail/component/CommunityDetailComment.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/feature/community/src/main/java/com/boostcamp/dreamteam/dreamdiary/community/detail/component/CommunityDetailComment.kt b/feature/community/src/main/java/com/boostcamp/dreamteam/dreamdiary/community/detail/component/CommunityDetailComment.kt index 2cabc398..caec32de 100644 --- a/feature/community/src/main/java/com/boostcamp/dreamteam/dreamdiary/community/detail/component/CommunityDetailComment.kt +++ b/feature/community/src/main/java/com/boostcamp/dreamteam/dreamdiary/community/detail/component/CommunityDetailComment.kt @@ -42,7 +42,7 @@ internal fun CommunityDetailComment( Row( modifier = Modifier .fillMaxWidth() - .padding(horizontal = 16.dp, vertical = 8.dp) + .padding(horizontal = 16.dp, vertical = 8.dp), ) { DdAsyncImage( model = comment.author.profileImageUrl, From 3e1c145492566104de9ce2d22f637d31b49a756f Mon Sep 17 00:00:00 2001 From: ruh0n Date: Mon, 2 Dec 2024 18:32:03 +0900 Subject: [PATCH 6/6] =?UTF-8?q?fix:=20=ED=8C=8C=EC=9D=BC=EB=AA=85=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../{NotImplementedFeature.kt => NotImplementedFeatureUtil.kt} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename core/ui/src/main/java/com/boostcamp/dreamteam/dreamdiary/ui/util/{NotImplementedFeature.kt => NotImplementedFeatureUtil.kt} (100%) diff --git a/core/ui/src/main/java/com/boostcamp/dreamteam/dreamdiary/ui/util/NotImplementedFeature.kt b/core/ui/src/main/java/com/boostcamp/dreamteam/dreamdiary/ui/util/NotImplementedFeatureUtil.kt similarity index 100% rename from core/ui/src/main/java/com/boostcamp/dreamteam/dreamdiary/ui/util/NotImplementedFeature.kt rename to core/ui/src/main/java/com/boostcamp/dreamteam/dreamdiary/ui/util/NotImplementedFeatureUtil.kt