-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDoMaInputID.kt
More file actions
70 lines (65 loc) · 2.27 KB
/
Copy pathDoMaInputID.kt
File metadata and controls
70 lines (65 loc) · 2.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
package view.signin.component
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.OutlinedTextField
import androidx.compose.material.Text
import androidx.compose.material.TextFieldDefaults
import androidx.compose.runtime.*
import androidx.compose.ui.Modifier
import androidx.compose.ui.text.input.TextFieldValue
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import view.theme.DoMaAndroidTheme
import view.theme.DoMaTypography
@Composable
fun DoMaInputID(
modifier: Modifier = Modifier,
idValue: TextFieldValue,
onIdValueChange: (TextFieldValue) -> Unit
) {
DoMaAndroidTheme { colors, typography ->
Column(
modifier = modifier
) {
Text(
text = "아이디",
style = DoMaTypography.bodyMedium.copy(color = colors.WHITE)
)
Spacer(
modifier = Modifier.height(4.dp)
)
OutlinedTextField(
modifier = Modifier.fillMaxWidth(),
value = idValue,
onValueChange = onIdValueChange,
textStyle = DoMaTypography.labelLarge.copy(color = colors.WHITE),
shape = RoundedCornerShape(12.dp),
singleLine = true,
placeholder = {
Text(
text = "아이디를 입력해주세요.",
style = DoMaTypography.labelLarge.copy(color = colors.silver)
)
},
colors = TextFieldDefaults.outlinedTextFieldColors(
backgroundColor = colors.BACKGROUND,
cursorColor = colors.WHITE,
focusedBorderColor = colors.GRAY,
unfocusedBorderColor = colors.GRAY
)
)
}
}
}
@Preview
@Composable
fun PreviewDoMaInputID() {
val idState = remember { mutableStateOf(TextFieldValue("")) }
DoMaInputID(
idValue = idState.value,
onIdValueChange = { idState.value = it }
)
}