feat: background and speed of entries loading indicator
This commit is contained in:
parent
355a36c152
commit
fb63d7d259
|
|
@ -4,10 +4,7 @@ import { m } from "framer-motion"
|
|||
import { useEffect, useRef, useState } from "react"
|
||||
|
||||
const softSpringPreset: Spring = {
|
||||
duration: 0.35,
|
||||
type: "spring",
|
||||
stiffness: 120,
|
||||
damping: 20,
|
||||
}
|
||||
|
||||
interface AnimateChangeInHeightProps {
|
||||
|
|
@ -21,7 +18,7 @@ interface AnimateChangeInHeightProps {
|
|||
export const AutoResizeHeight: React.FC<AnimateChangeInHeightProps> = ({
|
||||
children,
|
||||
className,
|
||||
duration = 0.6,
|
||||
duration = 0.35,
|
||||
spring = false,
|
||||
}) => {
|
||||
const containerRef = useRef<HTMLDivElement | null>(null)
|
||||
|
|
@ -47,10 +44,14 @@ export const AutoResizeHeight: React.FC<AnimateChangeInHeightProps> = ({
|
|||
return (
|
||||
<m.div
|
||||
className={cn("overflow-hidden", className)}
|
||||
style={{ height }}
|
||||
initial={false}
|
||||
animate={{ height }}
|
||||
transition={spring ? softSpringPreset : { duration }}
|
||||
transition={spring ? {
|
||||
...softSpringPreset,
|
||||
duration,
|
||||
} : {
|
||||
duration,
|
||||
}}
|
||||
>
|
||||
<div ref={containerRef}>{children}</div>
|
||||
</m.div>
|
||||
|
|
|
|||
|
|
@ -164,7 +164,7 @@ export function EntryColumn() {
|
|||
/>
|
||||
<AutoResizeHeight spring>
|
||||
{isRefreshing && (
|
||||
<div className="center h-7 gap-2 bg-theme-accent text-xs text-white">
|
||||
<div className="center h-7 gap-2 text-xs">
|
||||
<LoadingCircle size="small" />
|
||||
Refreshing new entries...
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in New Issue