Improve jump to unread button
Signed-off-by: Ajay Bura <ajbura@gmail.com>
This commit is contained in:
parent
f5720bde14
commit
9c716b1eeb
2 changed files with 21 additions and 24 deletions
|
@ -5,11 +5,13 @@ import './RoomViewFloating.scss';
|
||||||
|
|
||||||
import initMatrix from '../../../client/initMatrix';
|
import initMatrix from '../../../client/initMatrix';
|
||||||
import cons from '../../../client/state/cons';
|
import cons from '../../../client/state/cons';
|
||||||
|
import { isInSameDay } from '../../../util/common';
|
||||||
|
|
||||||
import Text from '../../atoms/text/Text';
|
import Text from '../../atoms/text/Text';
|
||||||
import Button from '../../atoms/button/Button';
|
import Button from '../../atoms/button/Button';
|
||||||
import IconButton from '../../atoms/button/IconButton';
|
import IconButton from '../../atoms/button/IconButton';
|
||||||
|
|
||||||
|
import ChevronTopIC from '../../../../public/res/ic/outlined/chevron-top.svg';
|
||||||
import ChevronBottomIC from '../../../../public/res/ic/outlined/chevron-bottom.svg';
|
import ChevronBottomIC from '../../../../public/res/ic/outlined/chevron-bottom.svg';
|
||||||
import TickMarkIC from '../../../../public/res/ic/outlined/tick-mark.svg';
|
import TickMarkIC from '../../../../public/res/ic/outlined/tick-mark.svg';
|
||||||
|
|
||||||
|
@ -96,17 +98,12 @@ function RoomViewFloating({
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className={`room-view__unread ${isJumpToEvent ? 'room-view__unread--open' : ''}`}>
|
<div className={`room-view__unread ${isJumpToEvent ? 'room-view__unread--open' : ''}`}>
|
||||||
<Button onClick={jumpToEvent} variant="primary">
|
<Button iconSrc={ChevronTopIC} onClick={jumpToEvent} variant="primary">
|
||||||
<Text variant="b2">Jump to unread</Text>
|
<Text variant="b3" weight="medium">Jump to unread messages</Text>
|
||||||
|
</Button>
|
||||||
|
<Button iconSrc={TickMarkIC} onClick={cancelJumpToEvent} variant="primary">
|
||||||
|
<Text variant="b3" weight="bold">Mark as read</Text>
|
||||||
</Button>
|
</Button>
|
||||||
<IconButton
|
|
||||||
onClick={cancelJumpToEvent}
|
|
||||||
variant="primary"
|
|
||||||
size="extra-small"
|
|
||||||
src={TickMarkIC}
|
|
||||||
tooltipPlacement="bottom"
|
|
||||||
tooltip="Mark as read"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
<div className={`room-view__typing${typingMembers.size > 0 ? ' room-view__typing--open' : ''}`}>
|
<div className={`room-view__typing${typingMembers.size > 0 ? ' room-view__typing--open' : ''}`}>
|
||||||
<div className="bouncing-loader"><div /></div>
|
<div className="bouncing-loader"><div /></div>
|
||||||
|
|
|
@ -90,33 +90,33 @@
|
||||||
|
|
||||||
&__unread {
|
&__unread {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: var(--sp-extra-tight);
|
top: 0;
|
||||||
@include dir.prop(right, var(--sp-extra-tight), unset);
|
@include dir.prop(left, var(--sp-normal), unset);
|
||||||
@include dir.prop(left, unset, var(--sp-extra-tight));
|
@include dir.prop(right, unset, var(--sp-normal));
|
||||||
z-index: 999;
|
z-index: 999;
|
||||||
|
|
||||||
display: none;
|
display: none;
|
||||||
|
width: calc(100% - var(--sp-extra-loose));
|
||||||
background-color: var(--bg-surface);
|
background-color: var(--bg-surface);
|
||||||
border-radius: var(--bo-radius);
|
border-radius: 0 0 var(--bo-radius) var(--bo-radius);
|
||||||
box-shadow: var(--bs-primary-border);
|
box-shadow: var(--bs-primary-border);
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
||||||
&--open {
|
&--open {
|
||||||
display: flex;
|
display: flex;
|
||||||
}
|
}
|
||||||
|
|
||||||
& .ic-btn {
|
|
||||||
padding: 6px var(--sp-extra-tight);
|
|
||||||
border-radius: 0;
|
|
||||||
}
|
|
||||||
& .btn-primary {
|
& .btn-primary {
|
||||||
@extend .cp-fx__item-one;
|
justify-content: flex-start;
|
||||||
@include dir.side(margin, 0, 1px);
|
|
||||||
border-radius: 0;
|
border-radius: 0;
|
||||||
padding: 0 var(--sp-tight);
|
padding: 2px var(--sp-tight);
|
||||||
&:focus {
|
& .ic-raw {
|
||||||
background-color: var(--bg-primary-hover);
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
& .btn-primary:first-child {
|
||||||
|
@extend .cp-fx__item-one;
|
||||||
|
padding: var(--sp-ultra-tight) var(--sp-extra-tight);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue