Skip to content

Commit

Permalink
Fix padding and font sizes on side menu texts (#3398)
Browse files Browse the repository at this point in the history
* configured side menu end text color and font size along with app version font size on the SIDE PANEL

* spotless ran

* fixed app version font size configuration

* fixed client register end color text null safety handled

* resolved conflicts

* SPOTLESS ran

* Fix horizontal padding on side menu item

Signed-off-by: Elly Kitoto <[email protected]>

---------

Signed-off-by: Elly Kitoto <[email protected]>
Co-authored-by: Elly Kitoto <[email protected]>
  • Loading branch information
aurangzaibumer and ellykits authored Aug 2, 2024
1 parent 2998a84 commit d043438
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,10 @@ val AppTitleColor = Color(0xFF929496)
val StatusTextColor = Color(0xFF6F7274)
val PersonalDataBackgroundColor = Color(0xFFF5F5F5)
val MenuActionButtonTextColor = Color(0xFF28B8F9)
val MenuItemColor = Color(0xFFBFBFBF)
val MenuItemColor = Color(0xFF929496)
val SearchHeaderColor = Color(0xFFF2F4F7)
private val PrimaryColor = Color(0xFF0077CC)
private val SecondaryColor = Color(0xFFF8DF4B)
private val SurfaceColor = Color(0xFFFFFFFF)
private val PrimaryVariantColor = Color(0xFF006BBA)

val LightColors =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,10 @@ fun AppDrawer(
Box(
modifier = modifier.padding(innerPadding).background(SideMenuDarkColor).fillMaxSize(),
) {
LazyColumn(modifier = modifier.padding(horizontal = 16.dp)) {
LazyColumn(modifier = modifier) {
item {
Column {
if (navigationConfiguration.clientRegisters.isNotEmpty()) {
Column(modifier = modifier.padding(horizontal = 16.dp)) {
if (navigationConfiguration.clientRegisters.size > 1) {
Text(
text = stringResource(id = R.string.registers).uppercase(),
fontSize = 14.sp,
Expand Down Expand Up @@ -183,7 +183,7 @@ fun AppDrawer(

item {
if (navigationConfiguration.bottomSheetRegisters?.registers?.isNotEmpty() == true) {
Column {
Column(modifier = modifier.padding(horizontal = 16.dp)) {
OtherPatientsItem(
navigationConfiguration = navigationConfiguration,
onSideMenuClick = onSideMenuClick,
Expand All @@ -195,6 +195,8 @@ fun AppDrawer(
}
}

item { Divider(color = DividerColor) }

// Display list of configurable static menu
items(navigationConfiguration.staticMenu, { it.id }) { navigationMenu ->
SideMenuItem(
Expand Down Expand Up @@ -300,11 +302,11 @@ private fun DefaultSyncStatus(
context: Context,
) {
Box(
modifier = Modifier.background(SideMenuBottomItemDarkColor).padding(16.dp),
modifier = Modifier.background(SideMenuBottomItemDarkColor).padding(vertical = 16.dp),
) {
SideMenuItem(
modifier = Modifier,
imageConfig = ImageConfig(type = ICON_TYPE_LOCAL, "ic_sync"),
imageConfig = ImageConfig(type = ICON_TYPE_LOCAL, reference = "ic_sync"),
title = stringResource(org.smartregister.fhircore.engine.R.string.sync),
endText = appUiState.lastSyncTime,
padding = 0,
Expand Down Expand Up @@ -439,7 +441,7 @@ private fun SideMenuItem(
title: String,
endText: String = "",
endTextColor: Color = Color.White,
padding: Int = 10,
padding: Int = 12,
showEndText: Boolean,
endImageVector: ImageVector? = null,
onSideMenuClick: () -> Unit,
Expand All @@ -451,7 +453,8 @@ private fun SideMenuItem(
.fillMaxWidth()
.padding(vertical = padding.dp)
.clickable { onSideMenuClick() }
.testTag(SIDE_MENU_ITEM_MAIN_ROW_TEST_TAG),
.testTag(SIDE_MENU_ITEM_MAIN_ROW_TEST_TAG)
.padding(horizontal = 16.dp),
verticalAlignment = Alignment.CenterVertically,
) {
Row(
Expand Down Expand Up @@ -516,9 +519,6 @@ fun AppDrawerPreview() {
clientRegisters =
listOf(
NavigationMenuConfig(id = "id0", visible = true, display = "Households"),
NavigationMenuConfig(id = "id2", visible = true, display = "PNC"),
NavigationMenuConfig(id = "id3", visible = true, display = "ANC"),
NavigationMenuConfig(id = "id4", visible = true, display = "Family Planning"),
),
menuActionButton =
NavigationMenuConfig(id = "id1", visible = true, display = "Register Household"),
Expand Down

0 comments on commit d043438

Please sign in to comment.