Skip to content

Commit

Permalink
Merge pull request #123 from tarkalabs/mahi/topBarFix
Browse files Browse the repository at this point in the history
Proper background color set for TUITopBar to looks fine in both light  & dark themes.
  • Loading branch information
rajajawahar authored Sep 22, 2023
2 parents e7137f1 + 0cb23d0 commit a78ca02
Showing 1 changed file with 24 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.tarkalabs.uicomponents.components

import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
Expand All @@ -23,6 +24,7 @@ import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.tarkalabs.tarkaicons.ChevronLeft24
import com.tarkalabs.tarkaicons.ChevronRight20
import com.tarkalabs.tarkaicons.Search16
import com.tarkalabs.tarkaicons.TarkaIcon
import com.tarkalabs.tarkaicons.TarkaIcons
import com.tarkalabs.uicomponents.components.base.IconButtonSize.XL
Expand Down Expand Up @@ -101,6 +103,7 @@ scrollBehavior = TopAppBarScrollBehavior.ScrollOnAppBarScroll, // Optional: Spec

Column(
modifier = modifier
.background(color = TUITheme.colors.surface)
.fillMaxWidth()
.wrapContentSize(),
horizontalAlignment = Alignment.CenterHorizontally
Expand Down Expand Up @@ -211,11 +214,25 @@ data class TUITopBarTags(

@OptIn(ExperimentalMaterial3Api::class) @Preview @Composable fun EamNormalTopBar(
) {
TUITopBar(
title = "Lorem Ipsum",
navigationIcon = TarkaIcons.Regular.ChevronRight20,
menuItemIconOne = TarkaIcons.Regular.ChevronRight20,
menuItemIconTwo = TarkaIcons.Regular.ChevronRight20,
menuItemIconThree = TarkaIcons.Regular.ChevronRight20
)

TUITheme {
Column {

TUITopBar(
title = "Lorem Ipsum",
navigationIcon = TarkaIcons.Regular.ChevronRight20,
menuItemIconOne = TarkaIcons.Regular.ChevronRight20,
menuItemIconTwo = TarkaIcons.Regular.ChevronRight20,
menuItemIconThree = TarkaIcons.Regular.ChevronRight20
)

VerticalSpacer(space = 5)

TUITopBar(
title = "Lorem Ipsum",
navigationIcon = TarkaIcons.Regular.ChevronRight20,
searchIcon = TarkaIcons.Regular.Search16
)
}
}
}

0 comments on commit a78ca02

Please sign in to comment.