🖱️ feat: Switch Scroll Button setting (#5332)

This commit is contained in:
Marco Beretta 2025-01-31 13:52:52 +01:00 committed by GitHub
parent 8a0c7d92bd
commit 1c459ed3af
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 46 additions and 2 deletions

View file

@ -17,6 +17,7 @@ export default function MessagesView({
Header?: ReactNode;
}) {
const localize = useLocalize();
const scrollButtonPreference = useRecoilValue(store.showScrollButton);
const fontSize = useRecoilValue(store.fontSize);
const { screenshotTargetRef } = useScreenshot();
const [currentEditId, setCurrentEditId] = useState<number | string | null>(-1);
@ -83,7 +84,10 @@ export default function MessagesView({
unmountOnExit={false}
// appear
>
{() => showScrollButton && <ScrollToBottom scrollHandler={handleSmoothToRef} />}
{() =>
showScrollButton &&
scrollButtonPreference && <ScrollToBottom scrollHandler={handleSmoothToRef} />
}
</CSSTransition>
</div>
</div>