mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-16 01:26:37 +08:00
feat(core): mobile renderer for explorer (#7942)
This commit is contained in:
@@ -64,3 +64,30 @@ export const collapseIcon = style({
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
// ------------- mobile -------------
|
||||
export const mobileRoot = style([
|
||||
root,
|
||||
{
|
||||
height: 25,
|
||||
padding: '0 16px',
|
||||
selectors: {
|
||||
'&[data-collapsible="true"]:hover': {
|
||||
backgroundColor: 'transparent',
|
||||
},
|
||||
'&[data-collapsible="true"]:active': {
|
||||
backgroundColor: cssVarV2('layer/background/hoverOverlay'),
|
||||
},
|
||||
},
|
||||
},
|
||||
]);
|
||||
export const mobileLabel = style([
|
||||
label,
|
||||
{
|
||||
color: cssVarV2('text/primary'),
|
||||
fontSize: 20,
|
||||
lineHeight: '25px',
|
||||
letterSpacing: -0.45,
|
||||
fontWeight: 400,
|
||||
},
|
||||
]);
|
||||
|
||||
@@ -9,6 +9,7 @@ export type CategoryDividerProps = PropsWithChildren<
|
||||
label: string;
|
||||
className?: string;
|
||||
collapsed?: boolean;
|
||||
mobile?: boolean;
|
||||
setCollapsed?: (collapsed: boolean) => void;
|
||||
} & {
|
||||
[key: `data-${string}`]: unknown;
|
||||
@@ -22,6 +23,7 @@ export const CategoryDivider = forwardRef(
|
||||
children,
|
||||
className,
|
||||
collapsed,
|
||||
mobile,
|
||||
setCollapsed,
|
||||
...otherProps
|
||||
}: CategoryDividerProps,
|
||||
@@ -31,14 +33,15 @@ export const CategoryDivider = forwardRef(
|
||||
|
||||
return (
|
||||
<div
|
||||
className={clsx([styles.root, className])}
|
||||
className={clsx(mobile ? styles.mobileRoot : styles.root, className)}
|
||||
ref={ref}
|
||||
onClick={() => setCollapsed?.(!collapsed)}
|
||||
data-mobile={mobile}
|
||||
data-collapsed={collapsed}
|
||||
data-collapsible={collapsible}
|
||||
{...otherProps}
|
||||
>
|
||||
<div className={styles.label}>
|
||||
<div className={mobile ? styles.mobileLabel : styles.label}>
|
||||
{label}
|
||||
{collapsible ? (
|
||||
<ToggleCollapseIcon
|
||||
|
||||
Reference in New Issue
Block a user