mirror of
https://github.com/antebudimir/feishin.git
synced 2026-01-01 02:13:33 +00:00
Support dynamic page headers
This commit is contained in:
parent
3d8ba2e808
commit
65465d6cae
3 changed files with 97 additions and 13 deletions
|
|
@ -0,0 +1,56 @@
|
|||
import { ReactNode } from 'react';
|
||||
import { Group } from '@mantine/core';
|
||||
import { TextTitle } from '/@/renderer/components';
|
||||
import { PlayButton as PlayBtn } from '/@/renderer/features/shared/components/play-button';
|
||||
|
||||
interface LibraryHeaderBarProps {
|
||||
children: ReactNode;
|
||||
}
|
||||
|
||||
export const LibraryHeaderBar = ({ children }: LibraryHeaderBarProps) => {
|
||||
return (
|
||||
<Group
|
||||
noWrap
|
||||
align="center"
|
||||
h="100%"
|
||||
px="1rem"
|
||||
spacing="xl"
|
||||
>
|
||||
{children}
|
||||
</Group>
|
||||
);
|
||||
};
|
||||
|
||||
interface TitleProps {
|
||||
children: ReactNode;
|
||||
}
|
||||
|
||||
const Title = ({ children }: TitleProps) => {
|
||||
return (
|
||||
<TextTitle
|
||||
fw="bold"
|
||||
order={2}
|
||||
overflow="hidden"
|
||||
>
|
||||
{children}
|
||||
</TextTitle>
|
||||
);
|
||||
};
|
||||
|
||||
interface PlayButtonProps {
|
||||
onClick: () => void;
|
||||
size?: number;
|
||||
}
|
||||
|
||||
const PlayButton = ({ size, onClick }: PlayButtonProps) => {
|
||||
return (
|
||||
<PlayBtn
|
||||
h={size || 45}
|
||||
w={size || 45}
|
||||
onClick={onClick}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
LibraryHeaderBar.Title = Title;
|
||||
LibraryHeaderBar.PlayButton = PlayButton;
|
||||
|
|
@ -3,3 +3,4 @@ export * from './queries/music-folders-query';
|
|||
export * from './components/play-button';
|
||||
export * from './utils';
|
||||
export * from './components/library-header';
|
||||
export * from './components/library-header-bar';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue