Skip to content

Commit 970c515

Browse files
authored
fix(chat): put the muted chip under a person's profile actions (#1611)
1 parent 1bd31b0 commit 970c515

1 file changed

Lines changed: 22 additions & 12 deletions

File tree

  • apps/flipcash/features/messenger/src/main/kotlin/com/flipcash/app/messenger/internal/screens/profile

‎apps/flipcash/features/messenger/src/main/kotlin/com/flipcash/app/messenger/internal/screens/profile/ChatProfileScreen.kt‎

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -300,22 +300,32 @@ internal fun ProfileHeader(
300300
color = CodeTheme.colors.textSecondary,
301301
)
302302
}
303-
// Last, because it is the only line here that is the viewer's setting rather than a fact
304-
// about the person, and the only one that can stop being true while the screen is open.
305-
ChatMuteStatusChip(
306-
viewerState = viewerState,
307-
modifier = Modifier.padding(top = CodeTheme.dimens.grid.x2),
308-
// With the shortcuts below, an empty held line would double the gap above them. This
309-
// screen only shows them for a group member, where there's no mute row to change it.
310-
reserveSpace = shortcuts == null,
311-
)
312303
// Below everything that describes the person: these act on them, like the rows under the
313-
// header, but they're the routine ones, so they sit closest to the name. 15dp here plus
314-
// the mute line's 10dp is 25dp, the same as the first row's inset below them.
304+
// header, but they're the routine ones, so they sit closest to the name. 25dp, the same as
305+
// the first row's inset below them, so they sit centered between the join date and the
306+
// list. Nothing between them and the join date, so they sit at one height on every
307+
// person's profile, muted or not.
315308
shortcuts?.let { content ->
316-
Box(modifier = Modifier.padding(top = CodeTheme.dimens.grid.x3)) {
309+
Box(modifier = Modifier.padding(top = CodeTheme.dimens.grid.x5)) {
317310
content()
318311
}
319312
}
313+
// Last, because it is the only line here that is the viewer's setting rather than a fact
314+
// about the person, and the only one that can stop being true while the screen is open.
315+
// Only where there is a mute to show, the DM's own person; there it holds its line so the
316+
// rows below don't move on mute or unmute. 16dp matches iOS, set by eye on device.
317+
viewerState?.let { state ->
318+
ChatMuteStatusChip(
319+
viewerState = state,
320+
modifier = Modifier.padding(
321+
top = if (shortcuts != null) {
322+
CodeTheme.dimens.staticGrid.x4
323+
} else {
324+
CodeTheme.dimens.grid.x2
325+
},
326+
),
327+
reserveSpace = true,
328+
)
329+
}
320330
}
321331
}

0 commit comments

Comments
 (0)