Skip to content

Commit c706b67

Browse files
authored
fix: mobile header layout overlap (#1066)
* fix: prevent header icon row from overlapping channel name on mobile * fix: prevent header icon row from overlapping channel name on mobile - Add flex-wrap to header for natural content wrapping - Set min-width on channel description to prevent over-shrinking - Add responsive styles for icon row at narrow widths (≤380px) --------- Co-authored-by: dodaa08 <dodaa08@users.noreply.github.com>
1 parent 1fb4274 commit c706b67

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

packages/react/src/views/ChatHeader/ChatHeader.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,9 @@ const ChatHeader = ({
399399
<div
400400
css={css`
401401
font-size: ${fullScreen ? '1.3rem' : '1.25rem'};
402+
overflow: hidden;
403+
text-overflow: ellipsis;
404+
white-space: nowrap;
402405
`}
403406
>
404407
{channelInfo.name || channelName || 'channelName'}

packages/react/src/views/ChatHeader/ChatHeader.styles.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ const getChatHeaderStyles = ({ theme, mode }) => {
1818
padding: 0 0.75rem;
1919
justify-content: space-between;
2020
width: 100%;
21+
flex-wrap: wrap;
22+
gap: 0.5rem;
2123
`,
2224

2325
chatHeaderParent: css`
@@ -42,20 +44,30 @@ const getChatHeaderStyles = ({ theme, mode }) => {
4244
channelDescription: css`
4345
${rowCentreAlign}
4446
flex: 1;
45-
min-width: 0;
47+
min-width: 120px;
4648
gap: 0.5rem;
49+
overflow: hidden;
4750
`,
4851

4952
chatHeaderIconRow: css`
5053
${rowCentreAlign}
51-
position:relative;
54+
position: relative;
5255
gap: 0.5rem;
56+
flex-shrink: 0;
57+
@media (max-width: 380px) {
58+
gap: 0.25rem;
59+
flex-wrap: wrap;
60+
justify-content: flex-end;
61+
}
5362
`,
5463
channelName: css`
5564
display: flex;
5665
align-items: center;
5766
gap: 0.1rem;
5867
cursor: pointer;
68+
overflow: hidden;
69+
text-overflow: ellipsis;
70+
white-space: nowrap;
5971
`,
6072
channelTopic: css`
6173
opacity: 0.8rem;

0 commit comments

Comments
 (0)