Skip to content

Commit 5c42e4b

Browse files
authored
layout fixes (keybase#25416)
* left margin like old on mobile * right side desktop dont ever push. dont center ... on tall items * too tall orange on no username
1 parent 88233dc commit 5c42e4b

3 files changed

Lines changed: 33 additions & 9 deletions

File tree

‎shared/chat/conversation/messages/separator.tsx‎

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ const Separator = React.memo(function Separator(p: SProps) {
225225
return (
226226
<Kb.Box2
227227
direction="horizontal"
228-
style={styles.container}
228+
style={showUsername ? styles.container : styles.containerNoName}
229229
fullWidth={true}
230230
className="WrapperMessage-hoverColor"
231231
>
@@ -273,7 +273,7 @@ const styles = Styles.styleSheetCreate(
273273
common: {
274274
alignItems: 'flex-start',
275275
alignSelf: 'flex-start',
276-
marginLeft: 55,
276+
marginLeft: Styles.isMobile ? 48 : 56,
277277
},
278278
isElectron: {
279279
marginBottom: 0,
@@ -308,6 +308,15 @@ const styles = Styles.styleSheetCreate(
308308
paddingTop: 5,
309309
},
310310
}),
311+
containerNoName: Styles.platformStyles({
312+
common: {
313+
position: 'relative',
314+
},
315+
isElectron: {
316+
marginBottom: 0,
317+
paddingTop: 5,
318+
},
319+
}),
311320
orangeLine: {
312321
backgroundColor: Styles.globalColors.orange,
313322
flexShrink: 0,

‎shared/chat/conversation/messages/wrapper/wrapper.tsx‎

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -416,26 +416,33 @@ const RightSide = React.memo(function RightSide(p: RProps) {
416416
</Kb.WithTooltip>
417417
) : null
418418

419+
const hasVisibleItems = sendIndicator || explodingCountdown || revokedIcon || coinsIcon || bot
420+
421+
// On mobile there is no ... menu
422+
// On Desktop we float the menu on top, if there are no items
423+
// if there are items we show them, and also keep space for the ... on float with opacity
424+
419425
const menu = Container.isMobile ? null : (
420426
<Kb.WithTooltip
421427
tooltip="More actions..."
422428
toastStyle={styles.moreActionsTooltip}
423-
className="hover-visible"
429+
className={hasVisibleItems ? 'hover-opacity-full' : 'hover-visible'}
424430
>
425431
<Kb.Box style={styles.ellipsis}>
426432
<Kb.Icon type="iconfont-ellipsis" onClick={toggleShowingPopup} />
427433
</Kb.Box>
428434
</Kb.WithTooltip>
429435
)
430436

431-
const hasVisibleItems = sendIndicator || explodingCountdown || revokedIcon || coinsIcon || bot
437+
const className = !hasVisibleItems && menu ? 'hover-visible' : undefined
432438

433439
return hasVisibleItems || menu ? (
434440
<Kb.Box2
435441
direction="horizontal"
442+
alignSelf="flex-start"
436443
style={hasVisibleItems ? styles.rightSideItems : styles.rightSide}
437444
gap="tiny"
438-
className={!hasVisibleItems && menu ? 'hover-visible' : undefined}
445+
className={className}
439446
>
440447
{sendIndicator}
441448
{explodingCountdown}
@@ -576,7 +583,7 @@ const styles = Styles.styleSheetCreate(
576583
alignItems: 'stretch',
577584
flexGrow: 1,
578585
flexShrink: 1,
579-
paddingLeft: 56,
586+
paddingLeft: Styles.isMobile ? 48 : 56,
580587
paddingRight: 4,
581588
position: 'relative',
582589
},

‎shared/desktop/renderer/style.css‎

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,13 @@ body {
355355
opacity: 1;
356356
}
357357

358+
.hover-container .hover-opacity-full {
359+
opacity: 0;
360+
}
361+
.hover-container:hover .hover-opacity-full {
362+
opacity: 1;
363+
}
364+
358365
.hover-container .hover-visible {
359366
display: none;
360367
}
@@ -396,7 +403,7 @@ body {
396403
}
397404

398405
.fade-background-color {
399-
transition: background-color 0.2s ease-in-out;
406+
transition: background-color 0.2s ease-in-out;
400407
}
401408

402409
.emoji {
@@ -411,7 +418,8 @@ body {
411418
}
412419

413420
.emoji-native {
414-
font-family: "Segoe UI Emoji", "Segoe UI Symbol", "Segoe UI", "Apple Color Emoji", "Twemoji Mozilla", "Noto Color Emoji", "Android Emoji";
421+
font-family: 'Segoe UI Emoji', 'Segoe UI Symbol', 'Segoe UI', 'Apple Color Emoji', 'Twemoji Mozilla',
422+
'Noto Color Emoji', 'Android Emoji';
415423
}
416424

417425
.emoji .emoji-native {
@@ -427,7 +435,7 @@ body {
427435
}
428436

429437
.center-emojis .emoji > span {
430-
vertical-align: middle;
438+
vertical-align: middle;
431439
}
432440

433441
.growFadeInSmall {

0 commit comments

Comments
 (0)