Files
Ryan Miller 4ceb6b0a97 Merge branch 'dev' into feat/composition_box_rewrite
# Conflicts:
#	stylesheets/_modules.scss
#	ts/components/SessionWrapperModal2.tsx
#	ts/components/conversation/SessionQuotedMessageComposition.tsx
#	ts/components/conversation/SessionRecording.tsx
#	ts/components/conversation/composition/CompositionBox.tsx
#	ts/components/conversation/composition/CompositionButtons.tsx
#	ts/components/conversation/message/message-content/MessageText.tsx
#	ts/components/conversation/message/message-content/Quote.tsx
#	ts/components/dialog/network/sections/network/NetworkSection.tsx
#	ts/components/icon/Icons.tsx
#	ts/components/leftpane/MessageRequestsBanner.tsx
2025-07-07 16:05:26 +10:00

40 lines
1.4 KiB
TypeScript

import { useSelector } from 'react-redux';
import styled from 'styled-components';
import { getShowScrollButton } from '../state/selectors/conversations';
import { useSelectedUnreadCount } from '../state/selectors/selectedConversation';
import { SessionUnreadCount } from './icon/SessionNotificationCount';
import { SessionLucideIconButton } from './icon/SessionIconButton';
import { LUCIDE_ICONS_UNICODE } from './icon/lucide';
const SessionScrollButtonDiv = styled.div`
position: fixed;
right: 60px;
animation: fadein var(--default-duration);
`;
export const SessionScrollButton = (props: { onClickScrollBottom: () => void }) => {
const show = useSelector(getShowScrollButton);
const unreadCount = useSelectedUnreadCount();
return (
<SessionScrollButtonDiv>
{show ? (
<SessionLucideIconButton
unicode={LUCIDE_ICONS_UNICODE.CHEVRON_DOWN}
iconSize={'large'}
onClick={props.onClickScrollBottom}
dataTestId="scroll-to-bottom-button"
backgroundColor="var(--message-bubbles-received-background-color)"
padding="var(--margins-xs)"
style={{
boxShadow: 'var(--scroll-button-shadow)',
}}
>
{Boolean(unreadCount) && <SessionUnreadCount count={unreadCount} />}
</SessionLucideIconButton>
) : null}
</SessionScrollButtonDiv>
);
};