feat: add icons and btn nav
This commit is contained in:
Binary file not shown.
@@ -17,6 +17,8 @@ import androidx.compose.foundation.layout.width
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.filled.Build
|
||||
import androidx.compose.material.icons.filled.LocalPharmacy
|
||||
import androidx.compose.material.icons.filled.Science
|
||||
import androidx.compose.material.icons.filled.Search
|
||||
import androidx.compose.material.icons.rounded.Refresh
|
||||
import androidx.compose.material3.Icon
|
||||
@@ -42,9 +44,9 @@ import androidx.navigation.compose.currentBackStackEntryAsState
|
||||
fun BottomBar(navController: NavHostController) {
|
||||
|
||||
val items = listOf(
|
||||
Triple("home", "دارو", Icons.Default.Search),
|
||||
Triple("search", "سرچ", Icons.Rounded.Refresh),
|
||||
Triple("lab", "آزمایش", Icons.Default.Build)
|
||||
Triple("home", "عمومی", Icons.Filled.LocalPharmacy),
|
||||
Triple("search", "جستجو",Icons.Filled.Search),
|
||||
Triple("lab", "آزمایش", Icons.Filled.Science)
|
||||
)
|
||||
|
||||
val navBackStackEntry by navController.currentBackStackEntryAsState()
|
||||
|
||||
@@ -47,7 +47,7 @@ fun CustomTextFilled(
|
||||
showClearButton: Boolean = true,
|
||||
showSearchButton: Boolean = true,
|
||||
autoSearch: Boolean = false,
|
||||
searchDelay: Long = 500L,
|
||||
searchDelay: Long = 1200L,
|
||||
keyboardOptions: KeyboardOptions = KeyboardOptions(
|
||||
imeAction = ImeAction.Search
|
||||
),
|
||||
|
||||
@@ -140,32 +140,32 @@ fun HomeContent(
|
||||
Column (
|
||||
verticalArrangement = Arrangement.Center
|
||||
){
|
||||
CustomTextFilled(
|
||||
value = searchText,
|
||||
onValueChange = { searchText = it },
|
||||
onSearch = { query ->
|
||||
if (query.isNotBlank()) {
|
||||
onSearch(query)
|
||||
}
|
||||
},
|
||||
placeholder = "جستجوی دارو",
|
||||
showClearButton = true,
|
||||
showSearchButton = true,
|
||||
autoSearch = false, // Set to true if you want search while typing
|
||||
height = 45
|
||||
)
|
||||
Spacer(modifier = Modifier.height(MaterialTheme.dime.xs))
|
||||
PrimaryButton(
|
||||
text = "جستجو",
|
||||
height = 40,
|
||||
isLoading = state.drugSearchState.isLoading,
|
||||
onClick = {
|
||||
if (searchText.isNotBlank()) {
|
||||
onSearch(searchText)
|
||||
}
|
||||
}
|
||||
)
|
||||
Spacer(modifier = Modifier.height(MaterialTheme.dime.xs))
|
||||
// CustomTextFilled(
|
||||
// value = searchText,
|
||||
// onValueChange = { searchText = it },
|
||||
// onSearch = { query ->
|
||||
// if (query.isNotBlank()) {
|
||||
// onSearch(query)
|
||||
// }
|
||||
// },
|
||||
// placeholder = "جستجوی دارو",
|
||||
// showClearButton = true,
|
||||
// showSearchButton = true,
|
||||
// autoSearch = false, // Set to true if you want search while typing
|
||||
// height = 45
|
||||
// )
|
||||
// Spacer(modifier = Modifier.height(MaterialTheme.dime.xs))
|
||||
// PrimaryButton(
|
||||
// text = "جستجو",
|
||||
// height = 40,
|
||||
// isLoading = state.drugSearchState.isLoading,
|
||||
// onClick = {
|
||||
// if (searchText.isNotBlank()) {
|
||||
// onSearch(searchText)
|
||||
// }
|
||||
// }
|
||||
// )
|
||||
// Spacer(modifier = Modifier.height(MaterialTheme.dime.xs))
|
||||
Box(modifier = Modifier.fillMaxSize()) {
|
||||
|
||||
// Always draw the data if available
|
||||
|
||||
@@ -110,7 +110,7 @@ fun SearchScreen(
|
||||
placeholder = "جستجوی دارو",
|
||||
showClearButton = true,
|
||||
showSearchButton = true,
|
||||
autoSearch = false,
|
||||
autoSearch = true,
|
||||
height = 45
|
||||
)
|
||||
Spacer(modifier = Modifier.height(MaterialTheme.dime.xs))
|
||||
|
||||
Reference in New Issue
Block a user