feat(direct-tabs): spread DM/Channels/Bots tabs edge-to-edge and underline active segment with purple bar on the header's grey rule
This commit is contained in:
parent
785b679b61
commit
f38cb42344
1 changed files with 20 additions and 3 deletions
|
|
@ -24,7 +24,7 @@ const Segment = forwardRef<HTMLButtonElement, SegmentProps>(
|
||||||
style={{
|
style={{
|
||||||
appearance: 'none',
|
appearance: 'none',
|
||||||
border: 'none',
|
border: 'none',
|
||||||
background: active ? color.Background.ContainerActive : 'transparent',
|
background: 'transparent',
|
||||||
color: color.Background.OnContainer,
|
color: color.Background.OnContainer,
|
||||||
opacity: disabled ? 0.45 : 1,
|
opacity: disabled ? 0.45 : 1,
|
||||||
cursor: disabled ? 'default' : 'pointer',
|
cursor: disabled ? 'default' : 'pointer',
|
||||||
|
|
@ -34,9 +34,26 @@ const Segment = forwardRef<HTMLButtonElement, SegmentProps>(
|
||||||
fontWeight: active ? 600 : 500,
|
fontWeight: active ? 600 : 500,
|
||||||
fontSize: toRem(13),
|
fontSize: toRem(13),
|
||||||
lineHeight: 1.2,
|
lineHeight: 1.2,
|
||||||
|
flex: 1,
|
||||||
|
position: 'relative',
|
||||||
|
display: 'flex',
|
||||||
|
alignItems: 'center',
|
||||||
|
justifyContent: 'center',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{label}
|
{label}
|
||||||
|
{active && (
|
||||||
|
<span
|
||||||
|
style={{
|
||||||
|
position: 'absolute',
|
||||||
|
left: 0,
|
||||||
|
right: 0,
|
||||||
|
bottom: `-${toRem(1)}`,
|
||||||
|
height: toRem(2),
|
||||||
|
backgroundColor: color.Primary.Main,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
</button>
|
</button>
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
@ -54,8 +71,8 @@ export function DirectStreamHeader() {
|
||||||
const navOpts = { replace: isNativePlatform() };
|
const navOpts = { replace: isNativePlatform() };
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<PageNavHeader>
|
<PageNavHeader style={{ padding: 0 }}>
|
||||||
<Box alignItems="Center" grow="Yes" gap="100">
|
<Box alignItems="Stretch" grow="Yes" style={{ alignSelf: 'stretch' }}>
|
||||||
<Segment
|
<Segment
|
||||||
active={!!directMatch}
|
active={!!directMatch}
|
||||||
label={t('Direct.segment_dm')}
|
label={t('Direct.segment_dm')}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue