mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-02-23 13:43:07 +01:00
update nav category component
This commit is contained in:
parent
bd0b38b37a
commit
255f00cfda
3 changed files with 18 additions and 15 deletions
|
@ -1,9 +1,11 @@
|
|||
import React, { ReactNode } from 'react';
|
||||
import { as } from 'folds';
|
||||
import classNames from 'classnames';
|
||||
import * as css from './styles.css';
|
||||
|
||||
type NavCategoryProps = {
|
||||
children: ReactNode;
|
||||
};
|
||||
export function NavCategory({ children }: NavCategoryProps) {
|
||||
return <div className={css.NavCategory}>{children}</div>;
|
||||
}
|
||||
export const NavCategory = as<'div', NavCategoryProps>(({ className, ...props }, ref) => (
|
||||
<div className={classNames(css.NavCategory, className)} {...props} ref={ref} />
|
||||
));
|
||||
|
|
|
@ -1,14 +1,19 @@
|
|||
import React, { ReactNode } from 'react';
|
||||
import { Header } from 'folds';
|
||||
import classNames from 'classnames';
|
||||
import { Header, as } from 'folds';
|
||||
import * as css from './styles.css';
|
||||
|
||||
export type NavCategoryHeaderProps = {
|
||||
children: ReactNode;
|
||||
};
|
||||
export function NavCategoryHeader({ children }: NavCategoryHeaderProps) {
|
||||
return (
|
||||
<Header className={css.NavCategoryHeader} variant="Background" size="300">
|
||||
{children}
|
||||
</Header>
|
||||
);
|
||||
}
|
||||
export const NavCategoryHeader = as<'div', NavCategoryHeaderProps>(
|
||||
({ className, ...props }, ref) => (
|
||||
<Header
|
||||
className={classNames(css.NavCategoryHeader, className)}
|
||||
variant="Background"
|
||||
size="300"
|
||||
{...props}
|
||||
ref={ref}
|
||||
/>
|
||||
)
|
||||
);
|
||||
|
|
|
@ -11,10 +11,6 @@ export const NavCategory = style([
|
|||
|
||||
export const NavCategoryHeader = style({
|
||||
paddingLeft: config.space.S200,
|
||||
position: 'sticky',
|
||||
top: 0,
|
||||
zIndex: 1,
|
||||
|
||||
gap: config.space.S100,
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue