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

textfield 단위 추가 #24

Merged
merged 3 commits into from
Jun 17, 2024
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 @@ -34,13 +34,15 @@ import com.jusiCool.jds_component.typography.JDSTypography
fun JDSTextField(
modifier: Modifier = Modifier,
label: String,
textFieldInfo: String,
placeHolder: String,
textState: String,
textFieldOutlineColor: Color,
stockUnitText:String = "",
isEnabled: Boolean = true,
isError: Boolean = false,
supportText: String = "",
supportTextClick: Boolean = false,
sellStock: Boolean = false,
visualTransformation: VisualTransformation = VisualTransformation.None,
onTextChange: (String) -> Unit,
onClickSupportText: () -> Unit = {}
Expand Down Expand Up @@ -95,9 +97,16 @@ fun JDSTextField(
) {
if (textState.isEmpty()) {
Text(
text = textFieldInfo,
text = placeHolder,
color = if (textState.isEmpty()) JDSColor.GRAY2 else JDSColor.Black,
style = JDSTypography.bodySmall
)
} else if(sellStock) {
Text(
text = stockUnitText,
color = JDSColor.GRAY300,
style = JDSTypography.bodySmall,
modifier = Modifier.align(Alignment.End)
)
}
}
Expand Down Expand Up @@ -128,7 +137,7 @@ fun JDSTextFieldPreview() {
JDSTextField(
modifier = Modifier.width(312.dp),
label = "아이디",
textFieldInfo = "아이디를 입력해주세요",
placeHolder = "아이디를 입력해주세요",
textFieldOutlineColor = JDSColor.GRAY100,
textState = textState,
onTextChange = onTextChange
Expand All @@ -137,7 +146,7 @@ fun JDSTextFieldPreview() {
JDSTextField(
modifier = Modifier.width(312.dp),
label = "아이디",
textFieldInfo = "아이디를 입력해주세요",
placeHolder = "아이디를 입력해주세요",
textFieldOutlineColor = JDSColor.MAIN,
textState = textState,
onTextChange = onTextChange
Expand All @@ -146,7 +155,7 @@ fun JDSTextFieldPreview() {
JDSTextField(
modifier = Modifier.width(312.dp),
label = "아이디",
textFieldInfo = "아이디를 입력해주세요",
placeHolder = "아이디를 입력해주세요",
textFieldOutlineColor = JDSColor.GRAY200,
isEnabled = false,
textState = textState,
Expand All @@ -156,7 +165,7 @@ fun JDSTextFieldPreview() {
JDSTextField(
modifier = Modifier.width(312.dp),
label = "아이디",
textFieldInfo = "아이디를 입력해주세요",
placeHolder = "아이디를 입력해주세요",
textFieldOutlineColor = JDSColor.ERROR,
supportText = "Error",
isError = true,
Expand All @@ -167,7 +176,7 @@ fun JDSTextFieldPreview() {
JDSTextField(
modifier = Modifier.width(312.dp),
label = "아이디",
textFieldInfo = "아이디를 입력해주세요",
placeHolder = "아이디를 입력해주세요",
textFieldOutlineColor = JDSColor.GRAY100,
textState = textState,
onTextChange = onTextChange,
Expand All @@ -177,7 +186,7 @@ fun JDSTextFieldPreview() {
JDSTextField(
modifier = Modifier.width(312.dp),
label = "아이디",
textFieldInfo = "아이디를 입력해주세요",
placeHolder = "아이디를 입력해주세요",
textFieldOutlineColor = JDSColor.ERROR,
supportText = "영문, 숫자, 특수문자 중 2개 이상의 조합으로 8글자 이상",
textState = textState,
Expand All @@ -187,13 +196,25 @@ fun JDSTextFieldPreview() {
JDSTextField(
modifier = Modifier.width(312.dp),
label = "아이디",
textFieldInfo = "아이디를 입력해주세요",
placeHolder = "아이디를 입력해주세요",
textFieldOutlineColor = JDSColor.ERROR,
supportText = "이메일 수정하기",
textState = textState,
onTextChange = onTextChange,
supportTextClick = true,
onClickSupportText = {}
)

JDSTextField(
modifier = Modifier.width(312.dp),
label = "아이디",
placeHolder = "아이디를 입력해주세요",
textFieldOutlineColor = JDSColor.GRAY100,
supportText = "이메일 수정하기",
textState = textState,
onTextChange = onTextChange,
sellStock = true,
stockUnitText = "주"
)
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.jusiCool.jds_component.typography

import androidx.compose.material3.Typography
import androidx.compose.runtime.Stable
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.font.Font
Expand Down
Loading