Skip to content

Commit 23b0e10

Browse files
committed
[UI]: 투표 생성 화면 완료 상태 추가 (#34)
1 parent 8b340b8 commit 23b0e10

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

app/src/main/java/com/texthip/thip/ui/group/note/screen/GroupVoteCreateScreen.kt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,18 @@ fun GroupVoteCreateScreen() {
4444

4545
var isEligible by rememberSaveable { mutableStateOf(false) } // TODO: 서버 데이터?
4646

47+
// 완료 버튼 활성화 조건
48+
val filledOptionsCount = options.count { it.isNotBlank() }
49+
val isRightButtonEnabled =
50+
(isGeneralReview || pageText.isNotBlank()) &&
51+
title.isNotBlank() &&
52+
filledOptionsCount >= 2
53+
4754
Box(modifier = Modifier.fillMaxSize()) {
4855
Column {
4956
InputTopAppBar(
5057
title = stringResource(R.string.create_vote),
51-
isRightButtonEnabled = false,
58+
isRightButtonEnabled = isRightButtonEnabled,
5259
onLeftClick = { /* 뒤로가기 동작 */ },
5360
onRightClick = { /* 완료 동작 */ }
5461
)

0 commit comments

Comments
 (0)