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

[feat ::102] 신청 퍼블리싱 #103

Merged
merged 4 commits into from
Jan 18, 2025
Merged
Show file tree
Hide file tree
Changes from 2 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 @@ -215,10 +215,10 @@ private fun ButtonColor.underlineColors() = when (this) {
textColor = DmsTheme.colors.secondary,
),
pressed = ButtonTheme(
textColor = DmsTheme.colors.primaryContainer,
textColor = DmsTheme.colors.secondaryContainer,
),
disabled = ButtonTheme(
textColor = DmsTheme.colors.secondaryContainer,
textColor = DmsTheme.colors.primaryContainer,
),
)

Expand All @@ -227,10 +227,10 @@ private fun ButtonColor.underlineColors() = when (this) {
textColor = DmsTheme.colors.onTertiaryContainer,
),
pressed = ButtonTheme(
textColor = DmsTheme.colors.surfaceVariant,
textColor = DmsTheme.colors.surfaceBright,
),
disabled = ButtonTheme(
textColor = DmsTheme.colors.surfaceBright,
textColor = DmsTheme.colors.surfaceVariant,
),
)

Expand All @@ -239,10 +239,10 @@ private fun ButtonColor.underlineColors() = when (this) {
textColor = DmsTheme.colors.outline,
),
pressed = ButtonTheme(
textColor = DmsTheme.colors.onError,
textColor = DmsTheme.colors.errorContainer,
),
disabled = ButtonTheme(
textColor = DmsTheme.colors.errorContainer,
textColor = DmsTheme.colors.onError,
),
)

Expand All @@ -253,17 +253,17 @@ private fun ButtonColor.underlineColors() = when (this) {
private fun ButtonColor.roundedColors() = when (this) {
ButtonColor.Primary -> ButtonState(
enabled = ButtonTheme(
textColor = DmsTheme.colors.onPrimary,
backgroundColor = DmsTheme.colors.secondary,
textColor = DmsTheme.colors.secondary,
backgroundColor = DmsTheme.colors.onPrimary,
),
pressed = ButtonTheme(
textColor = DmsTheme.colors.primaryContainer,
backgroundColor = DmsTheme.colors.primary,
),
disabled = ButtonTheme(
textColor = DmsTheme.colors.secondaryContainer,
backgroundColor = DmsTheme.colors.inversePrimary,
),
disabled = ButtonTheme(
textColor = DmsTheme.colors.primaryContainer,
backgroundColor = DmsTheme.colors.primary,
),
)

ButtonColor.Gray -> ButtonState(
Expand All @@ -272,13 +272,13 @@ private fun ButtonColor.roundedColors() = when (this) {
backgroundColor = DmsTheme.colors.surfaceVariant,
),
pressed = ButtonTheme(
textColor = DmsTheme.colors.surfaceVariant,
backgroundColor = DmsTheme.colors.surface,
),
disabled = ButtonTheme(
textColor = DmsTheme.colors.surfaceBright,
backgroundColor = DmsTheme.colors.onTertiaryContainer,
),
disabled = ButtonTheme(
textColor = DmsTheme.colors.surfaceVariant,
backgroundColor = DmsTheme.colors.surface,
),
)

ButtonColor.Error -> ButtonState(
Expand All @@ -287,13 +287,13 @@ private fun ButtonColor.roundedColors() = when (this) {
backgroundColor = DmsTheme.colors.outline,
),
pressed = ButtonTheme(
textColor = DmsTheme.colors.error,
backgroundColor = DmsTheme.colors.onError,
),
disabled = ButtonTheme(
textColor = DmsTheme.colors.onError,
backgroundColor = DmsTheme.colors.errorContainer,
),
disabled = ButtonTheme(
textColor = DmsTheme.colors.error,
backgroundColor = DmsTheme.colors.onError,
),
)

ButtonColor.Refuse -> ButtonState(
Expand All @@ -302,13 +302,13 @@ private fun ButtonColor.roundedColors() = when (this) {
backgroundColor = DmsTheme.colors.onError,
),
pressed = ButtonTheme(
textColor = DmsTheme.colors.onError,
backgroundColor = DmsTheme.colors.error,
),
disabled = ButtonTheme(
textColor = DmsTheme.colors.errorContainer,
backgroundColor = DmsTheme.colors.onErrorContainer,
),
disabled = ButtonTheme(
textColor = DmsTheme.colors.onError,
backgroundColor = DmsTheme.colors.error,
),
)
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,27 @@
package team.aliens.dms.kmp.feature.application.ui

import androidx.compose.foundation.background
import androidx.compose.foundation.border
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.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.Text
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

사용하지 않는 import 제거 필요

androidx.compose.material3.Text는 코드에서 사용되지 않습니다. 이 import 문을 제거해 주세요.

-import androidx.compose.material3.Text
🧰 Tools
🪛 GitHub Actions: Kotlin Multiplatform CI

[error] 13-13: Unused import detected. This can be auto-corrected using 'ktlint --format'

import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import team.aliens.dms.kmp.core.designsystem.appbar.DmsTopAppBar
import team.aliens.dms.kmp.core.designsystem.button.ButtonColor
import team.aliens.dms.kmp.core.designsystem.button.ButtonType
import team.aliens.dms.kmp.core.designsystem.button.DmsButton
import team.aliens.dms.kmp.core.designsystem.foundation.DmsTheme
import team.aliens.dms.kmp.core.designsystem.foundation.DmsTypography
import team.aliens.dms.kmp.core.designsystem.text.DmsText

@Composable
internal fun Application() {
Expand All @@ -10,5 +30,107 @@ internal fun Application() {

@Composable
private fun ApplicationScreen() {
Text("신청")
Column(
modifier = Modifier
.fillMaxSize()
.background(DmsTheme.colors.background),
horizontalAlignment = Alignment.CenterHorizontally,
) {
DmsTopAppBar(title = "신청")
Column(
modifier = Modifier
.fillMaxSize()
.padding(
horizontal = 24.dp,
vertical = 28.dp,
),
verticalArrangement = Arrangement.spacedBy(24.dp),
) {
ApplicationCard(
title = "잔류",
description = "주말 기숙사 잔류 여부를 확인하고, 잔류 신청을 통해서 잔류 또는 귀가를 신청해 보세요.",
buttonText = "잔류 신청하기",
onButtonClick = { },
)
ApplicationCard(
title = "외출",
appliedTitle = "금요 귀가",
description = "기숙사 생활 중 밖으로 나갈 일이 있다면, 외출 신청을 통해서 외출해 보세요.",
buttonText = "와출 신청하기",
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

오타 수정 필요

"와출 신청하기"에 오타가 있습니다. "외출 신청하기"로 수정해 주세요.

-                buttonText = "와출 신청하기",
+                buttonText = "외출 신청하기",
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
buttonText = "와출 신청하기",
buttonText = "외출 신청하기",

onButtonClick = { },
)
}
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

상태 처리 개선 필요

ApplicationScreen에 다음과 같은 상태 처리를 추가하는 것을 고려해 주세요:

  1. 로딩 상태 표시
  2. 에러 상태 처리
  3. 빈 상태 처리


@Composable
private fun ApplicationCard(
modifier: Modifier = Modifier,
title: String,
appliedTitle: String? = null,
description: String,
buttonText: String,
onButtonClick: () -> Unit,
) {
Column(
modifier = modifier
.fillMaxWidth()
.border(
width = 1.dp,
color = DmsTheme.colors.surface,
shape = RoundedCornerShape(10.dp),
)
.background(
color = DmsTheme.colors.background,
shape = RoundedCornerShape(10.dp),
)
.padding(
horizontal = 20.dp,
vertical = 16.dp,
),
verticalArrangement = Arrangement.spacedBy(20.dp),
) {
Column(
verticalArrangement = Arrangement.spacedBy(12.dp),
) {
Row(
verticalAlignment = Alignment.CenterVertically,
) {
DmsText(
text = title,
style = DmsTypography.Header3,
color = DmsTheme.colors.onBackground,
)
Spacer(modifier = Modifier.weight(1f))
appliedTitle?.let { text ->
DmsText(
modifier = Modifier
.background(
color = DmsTheme.colors.primary,
shape = RoundedCornerShape(24.dp),
)
.padding(
horizontal = 16.dp,
vertical = 6.dp,
),
text = text,
style = DmsTypography.Caption,
color = DmsTheme.colors.inversePrimary,
)
}
}
DmsText(
text = description,
style = DmsTypography.Body3,
color = DmsTheme.colors.tertiaryContainer,
)
}
DmsButton(
modifier = Modifier.fillMaxWidth(),
text = buttonText,
buttonType = ButtonType.Contained,
buttonColor = ButtonColor.Primary,
onClick = onButtonClick,
)
}
}
Loading