revamp template
This commit is contained in:
11
src/partials/toolbar/Toolbar.tsx
Normal file
11
src/partials/toolbar/Toolbar.tsx
Normal file
@ -0,0 +1,11 @@
|
||||
import { IToolbarProps } from './types';
|
||||
|
||||
const Toolbar = ({ children }: IToolbarProps) => {
|
||||
return (
|
||||
<div className="flex flex-wrap items-center lg:items-end justify-between gap-5 pb-7.5">
|
||||
{children}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export { Toolbar };
|
||||
7
src/partials/toolbar/ToolbarActions.tsx
Normal file
7
src/partials/toolbar/ToolbarActions.tsx
Normal file
@ -0,0 +1,7 @@
|
||||
import { IToolbarActionsProps } from './types';
|
||||
|
||||
const ToolbarActions = ({ children }: IToolbarActionsProps) => {
|
||||
return <div className="flex items-center gap-2.5">{children}</div>;
|
||||
};
|
||||
|
||||
export { ToolbarActions };
|
||||
9
src/partials/toolbar/ToolbarDescription.tsx
Normal file
9
src/partials/toolbar/ToolbarDescription.tsx
Normal file
@ -0,0 +1,9 @@
|
||||
import { IToolbarDescriptionProps } from './types';
|
||||
|
||||
const ToolbarDescription = ({ children }: IToolbarDescriptionProps) => {
|
||||
return (
|
||||
<div className="flex items-center gap-2 text-sm font-normal text-gray-700">{children}</div>
|
||||
);
|
||||
};
|
||||
|
||||
export { ToolbarDescription };
|
||||
7
src/partials/toolbar/ToolbarHeading.tsx
Normal file
7
src/partials/toolbar/ToolbarHeading.tsx
Normal file
@ -0,0 +1,7 @@
|
||||
import { IToolbarHeadingProps } from './types';
|
||||
|
||||
const ToolbarHeading = ({ children }: IToolbarHeadingProps) => {
|
||||
return <div className="flex flex-col justify-center gap-2">{children}</div>;
|
||||
};
|
||||
|
||||
export { ToolbarHeading };
|
||||
19
src/partials/toolbar/ToolbarPageTitle.tsx
Normal file
19
src/partials/toolbar/ToolbarPageTitle.tsx
Normal file
@ -0,0 +1,19 @@
|
||||
import { useLocation } from 'react-router';
|
||||
|
||||
import { useMenuCurrentItem } from '@/components/menu';
|
||||
import { useMenus } from '@/providers';
|
||||
|
||||
import { IToolbarPageTitleProps } from './types';
|
||||
|
||||
const ToolbarPageTitle = ({ text }: IToolbarPageTitleProps) => {
|
||||
const { pathname } = useLocation();
|
||||
const { getMenuConfig } = useMenus();
|
||||
const menuConfig = getMenuConfig('primary');
|
||||
const menuItem = useMenuCurrentItem(pathname, menuConfig);
|
||||
|
||||
return (
|
||||
<h1 className="text-xl font-medium leading-none text-gray-900">{text ?? menuItem?.title}</h1>
|
||||
);
|
||||
};
|
||||
|
||||
export { ToolbarPageTitle };
|
||||
5
src/partials/toolbar/index.ts
Normal file
5
src/partials/toolbar/index.ts
Normal file
@ -0,0 +1,5 @@
|
||||
export * from './Toolbar';
|
||||
export * from './ToolbarActions';
|
||||
export * from './ToolbarDescription';
|
||||
export * from './ToolbarHeading';
|
||||
export * from './ToolbarPageTitle';
|
||||
21
src/partials/toolbar/types.ts
Normal file
21
src/partials/toolbar/types.ts
Normal file
@ -0,0 +1,21 @@
|
||||
import { ReactNode } from 'react';
|
||||
|
||||
export interface IToolbarProps {
|
||||
children: ReactNode;
|
||||
}
|
||||
|
||||
export interface IToolbarActionsProps {
|
||||
children: ReactNode;
|
||||
}
|
||||
|
||||
export interface IToolbarHeadingProps {
|
||||
children: ReactNode;
|
||||
}
|
||||
|
||||
export interface IToolbarDescriptionProps {
|
||||
children: ReactNode;
|
||||
}
|
||||
|
||||
export interface IToolbarPageTitleProps {
|
||||
text?: string;
|
||||
}
|
||||
Reference in New Issue
Block a user