LibreChat/client/src/components/Messages/ScrollToBottom.tsx
Danny Avila 718572b7c8
🎨 style: Refine SidePanel and Textarea Styling (#2209)
* experimental: use TextareaAutosize wrapper with useLayoutEffect to hopefully fix random textarea jankiness

* fix(Textarea): force a resize when placeholder text changes

* style(ScrollToBottom): update styling for scroll button

* style: memoize values and improve side panel toggle states

* refactor(SidePanel): more control for toggle states, new hide panel button, and improve toggle state logic

* chore: hide resizable panel handle on smaller screens
2024-03-26 04:19:51 -04:00

30 lines
818 B
TypeScript

import React from 'react';
type Props = {
scrollHandler: React.MouseEventHandler<HTMLButtonElement>;
};
export default function ScrollToBottom({ scrollHandler }: Props) {
return (
<button
onClick={scrollHandler}
className="absolute bottom-5 right-1/2 cursor-pointer rounded-full border border-gray-200 bg-white bg-clip-padding text-gray-600 dark:border-white/10 dark:bg-gray-750/90 dark:text-gray-200"
>
<svg
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
className="m-1 text-black dark:text-white"
>
<path
d="M17 13L12 18L7 13M12 6L12 17"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
></path>
</svg>
</button>
);
}