-
Notifications
You must be signed in to change notification settings - Fork 1
[feat/#14] Community UI #15
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
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
ac5e753
feat/#14: Navigation 수정
vvan2 f56cbb6
feat/#14: asset,패키징
vvan2 d6f7346
feat/#14: 공통 컴포넌트 수정
vvan2 88fd6bb
feat/#14: community component
vvan2 16e97b7
feat/#14: community/post component
vvan2 39902ed
feat/#14: community/write component
vvan2 0674e78
feat/#14: community navigation
vvan2 ae6a5a2
feat/#14: community screen
vvan2 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Empty file.
110 changes: 110 additions & 0 deletions
110
app/src/main/java/com/hsLink/hslink/core/designsystem/component/HsLinkDialog.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,110 @@ | ||
| package com.hsLink.hslink.core.designsystem.component | ||
|
|
||
| import androidx.compose.foundation.background | ||
| import androidx.compose.foundation.layout.Arrangement | ||
| 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.width | ||
| import androidx.compose.foundation.shape.RoundedCornerShape | ||
| import androidx.compose.material3.Text | ||
| import androidx.compose.runtime.Composable | ||
| import androidx.compose.ui.Modifier | ||
| import androidx.compose.ui.tooling.preview.Preview | ||
| import androidx.compose.ui.unit.dp | ||
| import androidx.compose.ui.window.Dialog | ||
| import com.hsLink.hslink.core.designsystem.theme.HsLinkTheme | ||
| import com.hsLink.hslink.core.util.noRippleClickable | ||
|
|
||
| @Composable | ||
| fun HsLinkDialog( | ||
| title: String, | ||
| message: String, | ||
| confirmText: String, | ||
| dismissText: String, | ||
| onConfirm: () -> Unit, | ||
| onDismiss: () -> Unit, | ||
| modifier: Modifier = Modifier, | ||
| ) { | ||
| Dialog(onDismissRequest = onDismiss) { | ||
| Column( | ||
| modifier = modifier | ||
| .fillMaxWidth() | ||
| .background( | ||
| color = HsLinkTheme.colors.Common, | ||
| shape = RoundedCornerShape(12.dp) | ||
| ) | ||
| .padding(24.dp), | ||
| verticalArrangement = Arrangement.spacedBy(16.dp) | ||
| ) { | ||
| Text( | ||
| text = title, | ||
| color = HsLinkTheme.colors.Grey700, | ||
| style = HsLinkTheme.typography.title_20Strong | ||
| ) | ||
|
|
||
| Text( | ||
| text = message, | ||
| color = HsLinkTheme.colors.Grey500, | ||
| style = HsLinkTheme.typography.body_14Normal | ||
| ) | ||
|
|
||
| Row( | ||
| modifier = Modifier.fillMaxWidth(), | ||
| horizontalArrangement = Arrangement.Center | ||
| ) { | ||
| Box( | ||
| modifier = Modifier | ||
| .background( | ||
| color = HsLinkTheme.colors.Grey100, | ||
| shape = RoundedCornerShape(8.dp) | ||
| ) | ||
| .noRippleClickable(onClick = onDismiss) | ||
| .padding(vertical = 12.dp, horizontal = 40.dp) | ||
| ) { | ||
| Text( | ||
| text = dismissText, | ||
| color = HsLinkTheme.colors.Grey500, | ||
| style = HsLinkTheme.typography.btm_M, | ||
| ) | ||
| } | ||
|
|
||
| Spacer(modifier = Modifier.width(8.dp)) | ||
|
|
||
| Box( | ||
| modifier = Modifier | ||
| .background( | ||
| color = HsLinkTheme.colors.DeepBlue500, | ||
| shape = RoundedCornerShape(8.dp) | ||
| ) | ||
| .noRippleClickable(onClick = onConfirm) | ||
| .padding(vertical = 12.dp, horizontal = 40.dp) | ||
| ) { | ||
| Text( | ||
| text = confirmText, | ||
| color = HsLinkTheme.colors.Common, | ||
| style = HsLinkTheme.typography.btm_M, | ||
| ) | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
| @Preview(showBackground = true) | ||
| @Composable | ||
| private fun HsLinkDialogPreview() { | ||
| HsLinkTheme { | ||
| HsLinkDialog( | ||
| title = "글쓰기를 종료하시겠습니까?", | ||
| message = "작성 중인 내용이 저장되지 않습니다.", | ||
| confirmText = "나가기", | ||
| dismissText = "취소하기", | ||
| onConfirm = {}, | ||
| onDismiss = {} | ||
| ) | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
app/src/main/java/com/hsLink/hslink/data/local/PostDetail.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| package com.hsLink.hslink.data.local | ||
|
|
||
| data class PostDetail( | ||
| val id: String, | ||
| val authorName: String, | ||
| val authorMajor: String, | ||
| val boardType: String, | ||
| val timeAgo: String, | ||
| val title: String, | ||
| val content: String, | ||
| val isMyPost: Boolean, | ||
| val comments: List<Comment> | ||
| ) | ||
|
|
||
| data class Comment( | ||
| val id: String, | ||
| val authorName: String, | ||
| val timeAgo: String, | ||
| val content: String, | ||
| val isMyComment: Boolean | ||
| ) |
27 changes: 0 additions & 27 deletions
27
app/src/main/java/com/hsLink/hslink/presentation/community/CommunityScreen.kt
This file was deleted.
Oops, something went wrong.
93 changes: 93 additions & 0 deletions
93
app/src/main/java/com/hsLink/hslink/presentation/community/component/main/CommentItem.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,93 @@ | ||
| package com.hsLink.hslink.presentation.community.component | ||
|
|
||
| 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.layout.size | ||
| 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.Color | ||
| import androidx.compose.ui.graphics.vector.ImageVector | ||
| import androidx.compose.ui.res.vectorResource | ||
| 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 | ||
|
|
||
| @Composable | ||
| fun CommentItem( | ||
| authorName: String, | ||
| timeAgo: String, | ||
| content: String, | ||
| isMyComment: Boolean, | ||
| onDeleteClick: () -> Unit, | ||
| modifier: Modifier = Modifier | ||
| ) { | ||
| Row( | ||
| modifier = modifier | ||
| .fillMaxWidth() | ||
| .padding(horizontal = 16.dp, vertical = 12.dp), | ||
| horizontalArrangement = Arrangement.SpaceBetween, | ||
| verticalAlignment = Alignment.Top | ||
| ) { | ||
| Column( | ||
| modifier = Modifier.weight(1f), | ||
| verticalArrangement = Arrangement.spacedBy(4.dp) | ||
| ) { | ||
| Row( | ||
| horizontalArrangement = Arrangement.spacedBy(8.dp), | ||
| verticalAlignment = Alignment.CenterVertically | ||
| ) { | ||
| Text( | ||
| text = authorName, | ||
| color = HsLinkTheme.colors.Grey700, | ||
| style = HsLinkTheme.typography.title_14Strong | ||
| ) | ||
|
|
||
| Text( | ||
| text = timeAgo, | ||
| color = HsLinkTheme.colors.Grey400, | ||
| style = HsLinkTheme.typography.caption_12Normal | ||
| ) | ||
| } | ||
|
|
||
| Text( | ||
| text = content, | ||
| color = HsLinkTheme.colors.Grey600, | ||
| style = HsLinkTheme.typography.body_14Normal | ||
| ) | ||
| } | ||
|
|
||
| if (isMyComment) { | ||
| Icon( | ||
| imageVector = ImageVector.vectorResource(id = R.drawable.ic_community_kebab), | ||
| contentDescription = "댓글 삭제", | ||
| tint = Color.Unspecified, | ||
| modifier = Modifier | ||
| .size(24.dp) | ||
| .noRippleClickable(onClick = onDeleteClick) | ||
| ) | ||
| } | ||
| } | ||
| } | ||
|
|
||
| @Preview(showBackground = true) | ||
| @Composable | ||
| private fun CommentItemPreview() { | ||
| HsLinkTheme { | ||
| CommentItem( | ||
| authorName = "송효재", | ||
| timeAgo = "21학번", | ||
| content = "자소서 어떻게 작성하셨나요? 주로 보는 인재상이 있는지 궁금합니다.", | ||
| isMyComment = true, | ||
| onDeleteClick = {} | ||
| ) | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion | 🟠 Major
🧩 Analysis chain
Verify touch target sizes meet accessibility guidelines.
The action buttons use 12.dp vertical padding. Depending on the
btm_Mtypography's line height, the total touch target might fall short of the recommended 48dp minimum for accessibility.Additionally, consider adding semantic properties to improve accessibility support, such as content descriptions or button roles.
Run the following script to check the
btm_Mtypography definition and verify the touch target will be sufficient:Alternatively, consider using Material3
ButtonorTextButtoncomponents, which provide built-in accessibility features and proper touch target sizing.🏁 Script executed:
Length of output: 0
🏁 Script executed:
Length of output: 26
🏁 Script executed:
Length of output: 26
🏁 Script executed:
Length of output: 925
🏁 Script executed:
Length of output: 3809
🏁 Script executed:
Length of output: 170
🏁 Script executed:
Length of output: 1108
🏁 Script executed:
Length of output: 229
Action buttons fall short of accessibility touch target minimum.
The button height is approximately 46.dp (22.sp lineHeight from
btm_M+ 24.dp vertical padding), which is 2.dp below the recommended 48.dp minimum touch target size per Material Design accessibility guidelines.Consider either increasing vertical padding to 13.dp (making total height ~48.dp) or switching to Material3
ButtonorTextButtoncomponents, which provide built-in accessibility features and proper touch target sizing.🤖 Prompt for AI Agents