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

🔀 :: (#196) Feature/159 cut write schedule screen #197

Merged
merged 2 commits into from
Jun 28, 2023
Merged
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 @@ -90,47 +90,50 @@ fun WriteScheduleContent(
) {
var name by remember { mutableStateOf(schedulesData?.name ?: "") }
var date by remember { mutableStateOf(schedulesData?.date?:"") }
val title by remember { mutableStateOf(if (schedulesData == null) "일정 작성" else "일정 수정") }
val btnText by remember { mutableStateOf(if (schedulesData == null) "등록" else "수정") }
var timerModalState by remember { mutableStateOf(false) }
val btnEnabled = name.length > 1 && date.isNotEmpty()

Header(
painter = painterResource(id = R.drawable.ic_back),
title = "일정 작성",
btnText = "등록",
btnEnabled = btnEnabled,
onIconClick = onIconClick,
onBtnClick = { onBtnClick(name, date) }
)
Column(
modifier = Modifier
.padding(horizontal = 16.dp)
.fillMaxSize()
.padding(top = DevicePaddings.statusBarHeightDp.dp)
) {
Spacer(modifier = Modifier.height(32.dp))
HighlightedText(text = "일정제목")
Spacer(modifier = Modifier.height(8.dp))
TextField(
text = name,
onTextChange = { name = it },
placeholder = "최소 2자 이상"
Column(modifier = Modifier.padding(top = DevicePaddings.statusBarHeightDp.dp)) {
Header(
painter = painterResource(id = R.drawable.ic_back),
title = title,
btnText = btnText,
btnEnabled = btnEnabled,
onIconClick = onIconClick,
onBtnClick = { onBtnClick(name, date) }
)
Spacer(modifier = Modifier.height(20.dp))
HighlightedText(text = "날짜 선택")
Spacer(modifier = Modifier.height(8.dp))
TextFieldBtn(text = date, placeholder = "날짜를 선택해주세요") {
timerModalState = true
}
if (timerModalState) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
DatePickerModal(
defaultDate = date,
onCancel = { timerModalState = false },
onConfirm = {
date = it
timerModalState = false
}
)
Column(
modifier = Modifier
.fillMaxSize()
.padding(horizontal = 16.dp)
) {
Spacer(modifier = Modifier.height(32.dp))
HighlightedText(text = "일정제목")
Spacer(modifier = Modifier.height(8.dp))
TextField(
text = name,
onTextChange = { name = it },
placeholder = "최소 2자 이상"
)
Spacer(modifier = Modifier.height(20.dp))
HighlightedText(text = "날짜 선택")
Spacer(modifier = Modifier.height(8.dp))
TextFieldBtn(text = date, placeholder = "날짜를 선택해주세요") {
timerModalState = true
}
if (timerModalState) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
DatePickerModal(
defaultDate = date,
onCancel = { timerModalState = false },
onConfirm = {
date = it
timerModalState = false
}
)
}
}
}
}
Expand Down