Skip to content

Commit

Permalink
Fix modal shadow (#1746)
Browse files Browse the repository at this point in the history
Co-authored-by: jonathancaley <[email protected]>
  • Loading branch information
jonnycaley and jonathancaley authored Oct 2, 2023
1 parent 0b44459 commit e6fc975
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import androidx.compose.ui.graphics.Color
import androidx.compose.ui.semantics.Role
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp
import androidx.compose.ui.zIndex
import net.skyscanner.backpack.compose.icon.BpkIcon
import net.skyscanner.backpack.compose.icon.BpkIconSize
import net.skyscanner.backpack.compose.navigationbar.Action
Expand Down Expand Up @@ -83,6 +84,11 @@ internal fun BpkTopNavBarImpl(
else -> 0.dp
}

val zIndex = when {
fraction <= 0f -> 1f
else -> 0f
}

TwoRowsTopAppBar(
backgroundColor = backgroundColor,
contentColor = contentColor,
Expand All @@ -103,7 +109,8 @@ internal fun BpkTopNavBarImpl(
overflow = TextOverflow.Ellipsis,
)
},
modifier = modifier,
modifier = modifier
.zIndex(zIndex),
navigationIcon = {
if (navIcon != null) {
IconAction(action = navIcon)
Expand Down

0 comments on commit e6fc975

Please sign in to comment.