feat: 💨
This commit is contained in:
parent
695f2fe017
commit
ed843f637a
8 changed files with 198 additions and 197 deletions
|
|
@ -4,6 +4,7 @@ import { ScrollArea } from '@/components/ui/scroll-area'
|
|||
import { usePrimaryPage } from '@/PageManager'
|
||||
import { DeepBrowsingProvider } from '@/providers/DeepBrowsingProvider'
|
||||
import { useNostr } from '@/providers/NostrProvider'
|
||||
import { PageActiveContext } from '@/providers/PageActiveProvider'
|
||||
import { useUserPreferences } from '@/providers/UserPreferencesProvider'
|
||||
import { TPrimaryPageName } from '@/routes/primary'
|
||||
import { forwardRef, useEffect, useImperativeHandle, useRef } from 'react'
|
||||
|
|
@ -76,38 +77,45 @@ const PrimaryPageLayout = forwardRef(
|
|||
|
||||
if (enableSingleColumnLayout) {
|
||||
return (
|
||||
<DeepBrowsingProvider active={current === pageName && display}>
|
||||
<div
|
||||
ref={smallScreenScrollAreaRef}
|
||||
style={{
|
||||
paddingBottom: 'calc(env(safe-area-inset-bottom) + 3rem)'
|
||||
}}
|
||||
<PageActiveContext.Provider value={current === pageName && display}>
|
||||
<DeepBrowsingProvider active={current === pageName && display}>
|
||||
<div
|
||||
ref={smallScreenScrollAreaRef}
|
||||
style={{
|
||||
paddingBottom: 'calc(env(safe-area-inset-bottom) + 3rem)'
|
||||
}}
|
||||
>
|
||||
<PrimaryPageTitlebar hideBottomBorder={hideTitlebarBottomBorder}>
|
||||
{titlebar}
|
||||
</PrimaryPageTitlebar>
|
||||
{children}
|
||||
</div>
|
||||
{displayScrollToTopButton && <ScrollToTopButton />}
|
||||
</DeepBrowsingProvider>
|
||||
</PageActiveContext.Provider>
|
||||
)
|
||||
}
|
||||
|
||||
return (
|
||||
<PageActiveContext.Provider value={current === pageName && display}>
|
||||
<DeepBrowsingProvider
|
||||
active={current === pageName && display}
|
||||
scrollAreaRef={scrollAreaRef}
|
||||
>
|
||||
<ScrollArea
|
||||
className="h-full overflow-auto"
|
||||
scrollBarClassName="z-30 pt-12"
|
||||
ref={scrollAreaRef}
|
||||
>
|
||||
<PrimaryPageTitlebar hideBottomBorder={hideTitlebarBottomBorder}>
|
||||
{titlebar}
|
||||
</PrimaryPageTitlebar>
|
||||
{children}
|
||||
</div>
|
||||
{displayScrollToTopButton && <ScrollToTopButton />}
|
||||
<div className="h-4" />
|
||||
</ScrollArea>
|
||||
{displayScrollToTopButton && <ScrollToTopButton scrollAreaRef={scrollAreaRef} />}
|
||||
</DeepBrowsingProvider>
|
||||
)
|
||||
}
|
||||
|
||||
return (
|
||||
<DeepBrowsingProvider active={current === pageName && display} scrollAreaRef={scrollAreaRef}>
|
||||
<ScrollArea
|
||||
className="h-full overflow-auto"
|
||||
scrollBarClassName="z-30 pt-12"
|
||||
ref={scrollAreaRef}
|
||||
>
|
||||
<PrimaryPageTitlebar hideBottomBorder={hideTitlebarBottomBorder}>
|
||||
{titlebar}
|
||||
</PrimaryPageTitlebar>
|
||||
{children}
|
||||
<div className="h-4" />
|
||||
</ScrollArea>
|
||||
{displayScrollToTopButton && <ScrollToTopButton scrollAreaRef={scrollAreaRef} />}
|
||||
</DeepBrowsingProvider>
|
||||
</PageActiveContext.Provider>
|
||||
)
|
||||
}
|
||||
)
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import { Button } from '@/components/ui/button'
|
|||
import { ScrollArea } from '@/components/ui/scroll-area'
|
||||
import { useSecondaryPage } from '@/PageManager'
|
||||
import { DeepBrowsingProvider } from '@/providers/DeepBrowsingProvider'
|
||||
import { PageActiveContext } from '@/providers/PageActiveProvider'
|
||||
import { useUserPreferences } from '@/providers/UserPreferencesProvider'
|
||||
import { ChevronLeft } from 'lucide-react'
|
||||
import { forwardRef, useEffect, useImperativeHandle, useRef } from 'react'
|
||||
|
|
@ -60,11 +61,35 @@ const SecondaryPageLayout = forwardRef(
|
|||
|
||||
if (enableSingleColumnLayout) {
|
||||
return (
|
||||
<DeepBrowsingProvider active={currentIndex === index}>
|
||||
<div
|
||||
style={{
|
||||
paddingBottom: 'calc(env(safe-area-inset-bottom) + 3rem)'
|
||||
}}
|
||||
<PageActiveContext.Provider value={currentIndex === index}>
|
||||
<DeepBrowsingProvider active={currentIndex === index}>
|
||||
<div
|
||||
style={{
|
||||
paddingBottom: 'calc(env(safe-area-inset-bottom) + 3rem)'
|
||||
}}
|
||||
>
|
||||
<SecondaryPageTitlebar
|
||||
title={title}
|
||||
controls={controls}
|
||||
hideBackButton={hideBackButton}
|
||||
hideBottomBorder={hideTitlebarBottomBorder}
|
||||
titlebar={titlebar}
|
||||
/>
|
||||
{children}
|
||||
</div>
|
||||
{displayScrollToTopButton && <ScrollToTopButton />}
|
||||
</DeepBrowsingProvider>
|
||||
</PageActiveContext.Provider>
|
||||
)
|
||||
}
|
||||
|
||||
return (
|
||||
<PageActiveContext.Provider value={currentIndex === index}>
|
||||
<DeepBrowsingProvider active={currentIndex === index} scrollAreaRef={scrollAreaRef}>
|
||||
<ScrollArea
|
||||
className="h-full overflow-auto"
|
||||
scrollBarClassName="z-30 pt-12"
|
||||
ref={scrollAreaRef}
|
||||
>
|
||||
<SecondaryPageTitlebar
|
||||
title={title}
|
||||
|
|
@ -74,31 +99,11 @@ const SecondaryPageLayout = forwardRef(
|
|||
titlebar={titlebar}
|
||||
/>
|
||||
{children}
|
||||
</div>
|
||||
{displayScrollToTopButton && <ScrollToTopButton />}
|
||||
<div className="h-4" />
|
||||
</ScrollArea>
|
||||
{displayScrollToTopButton && <ScrollToTopButton scrollAreaRef={scrollAreaRef} />}
|
||||
</DeepBrowsingProvider>
|
||||
)
|
||||
}
|
||||
|
||||
return (
|
||||
<DeepBrowsingProvider active={currentIndex === index} scrollAreaRef={scrollAreaRef}>
|
||||
<ScrollArea
|
||||
className="h-full overflow-auto"
|
||||
scrollBarClassName="z-30 pt-12"
|
||||
ref={scrollAreaRef}
|
||||
>
|
||||
<SecondaryPageTitlebar
|
||||
title={title}
|
||||
controls={controls}
|
||||
hideBackButton={hideBackButton}
|
||||
hideBottomBorder={hideTitlebarBottomBorder}
|
||||
titlebar={titlebar}
|
||||
/>
|
||||
{children}
|
||||
<div className="h-4" />
|
||||
</ScrollArea>
|
||||
{displayScrollToTopButton && <ScrollToTopButton scrollAreaRef={scrollAreaRef} />}
|
||||
</DeepBrowsingProvider>
|
||||
</PageActiveContext.Provider>
|
||||
)
|
||||
}
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue