Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.

Commit

Permalink
refactor(app): create ui EmailField
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreaBrighi committed May 14, 2023
1 parent 2c179ab commit e4b64cc
Showing 1 changed file with 37 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package com.intelligentbackpack.app.ui.common

import androidx.compose.foundation.text.KeyboardActions
import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.OutlinedTextField
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.text.input.ImeAction
import androidx.compose.ui.text.input.KeyboardType
import androidx.compose.ui.text.input.TextFieldValue

@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun EmailField(
value: String,
onValueChange: (String) -> Unit,
modifier: Modifier = Modifier,
imeAction: ImeAction,
keyboardActions: KeyboardActions
) {
OutlinedTextField(
value = value,
onValueChange = onValueChange,
placeholder = { TextFieldValue("Email") },
label = { Text(text = "Email") },
singleLine = true,
keyboardOptions =
KeyboardOptions(
keyboardType = KeyboardType.Email,
imeAction = imeAction
),
keyboardActions = keyboardActions,
modifier = modifier
)
}

0 comments on commit e4b64cc

Please sign in to comment.