update nav category component

This commit is contained in:
Ajay Bura 2024-04-05 14:34:47 +05:30
parent bd0b38b37a
commit 255f00cfda
3 changed files with 18 additions and 15 deletions

View file

@ -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} />
));

View file

@ -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}
/>
)
);

View file

@ -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,
});