mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-16 08:20:14 +01:00
* 🎨 style: adjust padding and class names in UI components * 🎨 style: update ExportModal export button, update Export button hover style, refactor ChatForm style and fixed isRTL styles, update AttachFile position * 🎨 style: remove redundant border classes in SettingsTabs components for cleaner UI * 🎨 style: refactor Account component, extract DisplayUsernameMessages, and remove redundant border classes for cleaner layout * 🎨 style: conditionally render Dropdown in ForkSettings component for improved UI responsiveness * 🎨 style: replace DropdownNoState with Dropdown in voice selection components for consistency * 🎨 style: update Settings component layout for better responsivenes on large screens * 🎨 style: remove redundant margin-top classes for cleaner layout in various components
34 lines
915 B
TypeScript
34 lines
915 B
TypeScript
import { useRecoilState } from 'recoil';
|
|
import { Switch } from '~/components/ui';
|
|
import { useLocalize } from '~/hooks';
|
|
import store from '~/store';
|
|
|
|
export default function AutoScrollSwitch({
|
|
onCheckedChange,
|
|
}: {
|
|
onCheckedChange?: (value: boolean) => void;
|
|
}) {
|
|
const [autoScroll, setAutoScroll] = useRecoilState<boolean>(store.autoScroll);
|
|
const localize = useLocalize();
|
|
|
|
const handleCheckedChange = (value: boolean) => {
|
|
setAutoScroll(value);
|
|
if (onCheckedChange) {
|
|
onCheckedChange(value);
|
|
}
|
|
};
|
|
|
|
return (
|
|
<div className="flex items-center justify-between">
|
|
<div> {localize('com_nav_auto_scroll')} </div>
|
|
<Switch
|
|
id="autoScroll"
|
|
checked={autoScroll}
|
|
aria-label="Auto-Scroll to latest message on chat open"
|
|
onCheckedChange={handleCheckedChange}
|
|
className="ml-4"
|
|
data-testid="autoScroll"
|
|
/>
|
|
</div>
|
|
);
|
|
}
|