mirror of
https://github.com/toeverything/AFFiNE.git
synced 2024-12-21 05:01:34 +03:00
feat(mobile): move journal date picker into page header (#8968)
This commit is contained in:
parent
1c9bd204cd
commit
372dbf5ec8
@ -44,6 +44,15 @@ export interface PageHeaderProps
|
||||
prefixStyle?: React.CSSProperties;
|
||||
suffixClassName?: string;
|
||||
suffixStyle?: React.CSSProperties;
|
||||
|
||||
/**
|
||||
* Custom bottom content
|
||||
*/
|
||||
bottom?: ReactNode;
|
||||
/**
|
||||
* Bottom Spacer height
|
||||
*/
|
||||
bottomSpacer?: number;
|
||||
}
|
||||
export const PageHeader = forwardRef<HTMLDivElement, PageHeaderProps>(
|
||||
function PageHeader(
|
||||
@ -59,6 +68,8 @@ export const PageHeader = forwardRef<HTMLDivElement, PageHeaderProps>(
|
||||
prefixStyle,
|
||||
suffixClassName,
|
||||
suffixStyle,
|
||||
bottom,
|
||||
bottomSpacer,
|
||||
...attrs
|
||||
},
|
||||
ref
|
||||
@ -120,11 +131,13 @@ export const PageHeader = forwardRef<HTMLDivElement, PageHeaderProps>(
|
||||
{suffix}
|
||||
</section>
|
||||
</header>
|
||||
{bottom}
|
||||
</SafeArea>
|
||||
|
||||
{/* Spacer */}
|
||||
<SafeArea top>
|
||||
<div className={styles.headerSpacer} />
|
||||
{bottom ? <div style={{ height: bottomSpacer ?? 0 }} /> : null}
|
||||
</SafeArea>
|
||||
</>
|
||||
);
|
||||
|
@ -94,14 +94,6 @@ export const journalIconButton = style({
|
||||
display: 'flex',
|
||||
});
|
||||
|
||||
export const journalDatePickerSticky = style({
|
||||
export const journalDatePicker = style({
|
||||
background: cssVarV2('layer/background/primary'),
|
||||
position: 'sticky',
|
||||
zIndex: 1,
|
||||
top: 56,
|
||||
selectors: {
|
||||
'&[data-standalone]': {
|
||||
top: 'calc(44px + env(safe-area-inset-top, 12px))',
|
||||
},
|
||||
},
|
||||
});
|
||||
|
@ -253,6 +253,17 @@ const MobileDetailPage = ({
|
||||
<PageHeaderMenuButton />
|
||||
</>
|
||||
}
|
||||
bottom={
|
||||
date ? (
|
||||
<JournalDatePicker
|
||||
date={date}
|
||||
onChange={handleDateChange}
|
||||
withDotDates={allJournalDates}
|
||||
className={styles.journalDatePicker}
|
||||
/>
|
||||
) : null
|
||||
}
|
||||
bottomSpacer={94}
|
||||
>
|
||||
{date ? (
|
||||
<span className={bodyEmphasized}>
|
||||
@ -260,19 +271,6 @@ const MobileDetailPage = ({
|
||||
</span>
|
||||
) : null}
|
||||
</PageHeader>
|
||||
{date ? (
|
||||
<JournalDatePicker
|
||||
date={date}
|
||||
onChange={handleDateChange}
|
||||
withDotDates={allJournalDates}
|
||||
className={styles.journalDatePickerSticky}
|
||||
data-standalone={
|
||||
environment.isPwa || BUILD_CONFIG.isAndroid || BUILD_CONFIG.isIOS
|
||||
? ''
|
||||
: undefined
|
||||
}
|
||||
/>
|
||||
) : null}
|
||||
<DetailPageImpl />
|
||||
{date ? (
|
||||
<AppTabs background={cssVarV2('layer/background/primary')} />
|
||||
|
Loading…
Reference in New Issue
Block a user