Skip to content

Commit

Permalink
feat: background and speed of entries loading indicator
Browse files Browse the repository at this point in the history
  • Loading branch information
DIYgod committed Jul 29, 2024
1 parent 355a36c commit fb63d7d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
13 changes: 7 additions & 6 deletions src/renderer/src/components/ui/auto-resize-height.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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)
Expand All @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/modules/entry-column/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit fb63d7d

Please sign in to comment.