Skip to content

Commit cd1ec38

Browse files
bpierreo-az
authored andcommitted
fix(explorer): use css breadcrumb transition
1 parent 3199f27 commit cd1ec38

1 file changed

Lines changed: 4 additions & 15 deletions

File tree

apps/explorer/src/comps/Breadcrumbs.tsx

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -180,27 +180,16 @@ export function Breadcrumbs(props: Breadcrumbs.Props) {
180180

181181
const isEmpty =
182182
(resolvedPathname === '/' && !hasPendingCrumb) || displayCrumbs.length === 0
183-
const [isVisible, setIsVisible] = React.useState(false)
184-
185-
React.useEffect(() => {
186-
if (isEmpty) {
187-
setIsVisible(false)
188-
return
189-
}
190-
191-
const frame = requestAnimationFrame(() => setIsVisible(true))
192-
return () => cancelAnimationFrame(frame)
193-
}, [isEmpty])
194183

195184
return (
196185
<nav
197186
aria-label="Breadcrumb"
198187
aria-hidden={isEmpty}
199188
className={cx(
200-
'flex items-center gap-1 text-[12px] text-secondary overflow-x-auto overflow-y-hidden scrollbar-none h-5 pl-0.5 origin-left transition-[opacity,scale] duration-[80ms]',
201-
isVisible
202-
? 'opacity-100 scale-100'
203-
: 'opacity-0 scale-[0.97] pointer-events-none',
189+
'flex items-center gap-1 text-[12px] text-secondary overflow-x-auto overflow-y-hidden scrollbar-none h-5 pl-0.5 origin-left transition-[opacity,scale] duration-[80ms] starting:opacity-0 starting:scale-[0.97]',
190+
isEmpty
191+
? 'opacity-0 scale-[0.97] pointer-events-none'
192+
: 'opacity-100 scale-100',
204193
className,
205194
)}
206195
>

0 commit comments

Comments
 (0)