Files
kolaytercih/src/components/ui/scroll-button.tsx
bilalgursen 209d203fe8
All checks were successful
Deploy / deploy (push) Successful in 9m29s
Update Next.js configuration and package dependencies
- Modified redirects in next.config.ts to change the destination for "/sohbet" to "/listem".
- Added new dependencies in package.json: marked, motion, react-markdown, remark-breaks, remark-gfm, shiki, and use-stick-to-bottom.
- Updated pnpm-lock.yaml to reflect the new package versions and dependencies.
- Removed obsolete stack files for Flutter, Nuxt, Nuxt.js, React Native, and Svelte from the UI/UX Pro Max skill data.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-26 04:26:52 +03:00

43 lines
1.1 KiB
TypeScript

"use client"
import { Button, buttonVariants } from "@/components/ui/button"
import { cn } from "@/lib/utils"
import { type VariantProps } from "class-variance-authority"
import { ChevronDown } from "lucide-react"
import { useStickToBottomContext } from "use-stick-to-bottom"
export type ScrollButtonProps = {
className?: string
variant?: VariantProps<typeof buttonVariants>["variant"]
size?: VariantProps<typeof buttonVariants>["size"]
} & React.ButtonHTMLAttributes<HTMLButtonElement>
function ScrollButton({
className,
variant = "outline",
size = "sm",
...props
}: ScrollButtonProps) {
const { isAtBottom, scrollToBottom } = useStickToBottomContext()
return (
<Button
variant={variant}
size={size}
className={cn(
"h-10 w-10 rounded-full transition-all duration-150 ease-out",
!isAtBottom
? "translate-y-0 scale-100 opacity-100"
: "pointer-events-none translate-y-4 scale-95 opacity-0",
className
)}
onClick={() => scrollToBottom()}
{...props}
>
<ChevronDown className="h-5 w-5" />
</Button>
)
}
export { ScrollButton }