Skip to content

Commit

Permalink
fix: Small grey rect appears on the bottom of other user profile scre…
Browse files Browse the repository at this point in the history
…en (WPB-10453) (#3320)
  • Loading branch information
ohassine authored Aug 14, 2024
1 parent 5bd3261 commit e55f1b0
Showing 1 changed file with 48 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,24 @@ fun OtherUserProfileScreen(
resultNavigator.setResult(it)
resultNavigator.navigateBack()
},
onOpenConversation = { navigator.navigate(NavigationCommand(ConversationScreenDestination(it), BackStackMode.UPDATE_EXISTED)) },
onOpenDeviceDetails = { navigator.navigate(NavigationCommand(DeviceDetailsScreenDestination(navArgs.userId, it.clientId))) },
onOpenConversation = {
navigator.navigate(
NavigationCommand(
ConversationScreenDestination(it),
BackStackMode.UPDATE_EXISTED
)
)
},
onOpenDeviceDetails = {
navigator.navigate(
NavigationCommand(
DeviceDetailsScreenDestination(
navArgs.userId,
it.clientId
)
)
)
},
onSearchConversationMessagesClick = onSearchConversationMessagesClick,
navigateBack = navigator::navigateBack,
navigationIconType = NavigationIconType.Close,
Expand All @@ -199,7 +215,10 @@ fun OtherUserProfileScreen(
}

VisibilityState(legalHoldSubjectDialogState) {
LegalHoldSubjectProfileDialog(viewModel.state.userName, legalHoldSubjectDialogState::dismiss)
LegalHoldSubjectProfileDialog(
viewModel.state.userName,
legalHoldSubjectDialogState::dismiss
)
}
}

Expand Down Expand Up @@ -274,7 +293,9 @@ fun OtherProfileScreenContent(
}
val maxBarElevation = MaterialTheme.wireDimensions.topBarShadowElevation
val tabBarElevationState by remember(tabItems, lazyListStates, currentTabState) {
derivedStateOf { lazyListStates[tabItems[currentTabState]]?.topBarElevation(maxBarElevation) ?: 0.dp }
derivedStateOf {
lazyListStates[tabItems[currentTabState]]?.topBarElevation(maxBarElevation) ?: 0.dp
}
}

if (!requestInProgress) {
Expand Down Expand Up @@ -303,7 +324,16 @@ fun OtherProfileScreenContent(
onLegalHoldLearnMoreClick = onLegalHoldLearnMoreClick,
)
},
topBarFooter = { TopBarFooter(state, pagerState, tabBarElevationState, tabItems, currentTabState, scope) },
topBarFooter = {
TopBarFooter(
state = state,
pagerState = pagerState,
tabBarElevation = tabBarElevationState,
tabItems = tabItems,
currentTab = currentTabState,
scope = scope
)
},
content = {
Content(
state = state,
Expand All @@ -325,7 +355,7 @@ fun OtherProfileScreenContent(
onOpenConversation
)
},
isSwipeable = state.connectionState == ConnectionState.ACCEPTED
isSwipeable = state.connectionState != ConnectionState.BLOCKED
)

WireModalSheetLayout(
Expand Down Expand Up @@ -502,7 +532,11 @@ private fun Content(
) { pageIndex ->
when (val tabItem = tabItems[pageIndex]) {
OtherUserProfileTabItem.DETAILS ->
OtherUserProfileDetails(state, otherUserProfileScreenState, lazyListStates[tabItem]!!)
OtherUserProfileDetails(
state,
otherUserProfileScreenState,
lazyListStates[tabItem]!!
)

OtherUserProfileTabItem.GROUP ->
OtherUserProfileGroup(
Expand Down Expand Up @@ -554,13 +588,13 @@ fun ContentFooter(
enter = fadeIn(),
exit = fadeOut(),
) {
Surface(
shadowElevation = maxBarElevation,
color = MaterialTheme.wireColorScheme.background
) {
Box(modifier = Modifier.padding(all = dimensions().spacing16x)) {
// TODO show open conversation button for service bots after AR-2135
if (!state.isMetadataEmpty() && state.membership != Membership.Service && !state.isTemporaryUser()) {
// TODO show open conversation button for service bots after AR-2135
if (!state.isMetadataEmpty() && state.membership != Membership.Service && !state.isTemporaryUser()) {
Surface(
shadowElevation = maxBarElevation,
color = MaterialTheme.wireColorScheme.background
) {
Box(modifier = Modifier.padding(all = dimensions().spacing16x)) {
ConnectionActionButton(
state.userId,
state.userName,
Expand Down

0 comments on commit e55f1b0

Please sign in to comment.