Make sidebar photo count animation consistent
This commit is contained in:
parent
2286b0f35b
commit
eae78d2194
@ -1,6 +1,6 @@
|
||||
'use client';
|
||||
|
||||
import { useRef } from 'react';
|
||||
import { ReactNode, useRef } from 'react';
|
||||
import { Variant, motion } from 'framer-motion';
|
||||
import { useAppState } from '@/state';
|
||||
|
||||
@ -17,7 +17,7 @@ export interface AnimationConfig {
|
||||
interface Props extends AnimationConfig {
|
||||
className?: string
|
||||
classNameItem?: string
|
||||
items: JSX.Element[]
|
||||
items: ReactNode[]
|
||||
animateFromAppState?: boolean
|
||||
animateOnFirstLoadOnly?: boolean
|
||||
staggerOnFirstLoadOnly?: boolean
|
||||
|
||||
@ -1,33 +1,37 @@
|
||||
import { cc } from '@/utility/css';
|
||||
import AnimateItems from './AnimateItems';
|
||||
import { ReactNode } from 'react';
|
||||
|
||||
export default function HeaderList({
|
||||
title,
|
||||
icon,
|
||||
items,
|
||||
}: {
|
||||
title: string,
|
||||
title?: string,
|
||||
icon?: JSX.Element,
|
||||
items: JSX.Element[]
|
||||
items: ReactNode[]
|
||||
}) {
|
||||
return (
|
||||
<AnimateItems
|
||||
scaleOffset={0.95}
|
||||
duration={0.5}
|
||||
staggerDelay={0.05}
|
||||
items={[
|
||||
<div key="header" className={cc(
|
||||
'text-gray-900',
|
||||
'dark:text-gray-100',
|
||||
'flex items-center mb-0.5',
|
||||
'uppercase',
|
||||
)}>
|
||||
{icon}
|
||||
{icon && <> </>}
|
||||
{title}
|
||||
</div>,
|
||||
].concat(items)}
|
||||
classNameItem="text-dim"
|
||||
items={(title || icon
|
||||
? [
|
||||
<div key="header" className={cc(
|
||||
'text-gray-900',
|
||||
'dark:text-gray-100',
|
||||
'flex items-center mb-0.5',
|
||||
'uppercase',
|
||||
)}>
|
||||
{icon}
|
||||
{icon && title && <> </>}
|
||||
{title}
|
||||
</div>,
|
||||
]
|
||||
:[] as ReactNode[]
|
||||
).concat(items)}
|
||||
classNameItem="text-dim uppercase"
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
@ -38,10 +38,9 @@ export default function PhotoGridSidebar({
|
||||
hideApple
|
||||
/>)}
|
||||
/>}
|
||||
{photosCount > 0 &&
|
||||
<div className="text-dim uppercase">
|
||||
{photoQuantityText(photosCount, false)}
|
||||
</div>}
|
||||
{photosCount > 0 && <HeaderList
|
||||
items={[photoQuantityText(photosCount, false)]}
|
||||
/>}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user