Browse Source

refactor: replace zIndex with display for page stacking

imwald
codytseng 1 year ago
parent
commit
73e109c7c6
  1. 11
      src/PageManager.tsx

11
src/PageManager.tsx

@ -114,7 +114,9 @@ export function PageManager({
<div <div
key={item.index} key={item.index}
className="absolute top-0 left-0 w-full h-full bg-background" className="absolute top-0 left-0 w-full h-full bg-background"
style={{ zIndex: index + 1 }} style={{
display: index === secondaryStack.length - 1 ? 'block' : 'none'
}}
> >
{item.component} {item.component}
</div> </div>
@ -122,7 +124,7 @@ export function PageManager({
<div <div
key={primaryPageKey} key={primaryPageKey}
className="absolute top-0 left-0 w-full h-full bg-background" className="absolute top-0 left-0 w-full h-full bg-background"
style={{ zIndex: 0 }} style={{ display: !secondaryStack.length ? 'block' : 'none' }}
> >
{children} {children}
</div> </div>
@ -150,7 +152,10 @@ export function PageManager({
<div <div
key={item.index} key={item.index}
className="absolute top-0 left-0 w-full h-full bg-background" className="absolute top-0 left-0 w-full h-full bg-background"
style={{ zIndex: index + 1 }} style={{
zIndex: index + 1,
display: index === secondaryStack.length - 1 ? 'block' : 'none'
}}
> >
{item.component} {item.component}
</div> </div>

Loading…
Cancel
Save