mirror of
https://github.com/jeffvli/feishin.git
synced 2024-11-20 14:37:06 +01:00
Add order toggle button component
This commit is contained in:
parent
734b632c6c
commit
8129a3994b
@ -0,0 +1,33 @@
|
||||
import { ButtonProps } from '@mantine/core';
|
||||
import { RiSortAsc, RiSortDesc } from 'react-icons/ri';
|
||||
import { SortOrder } from '/@/renderer/api/types';
|
||||
import { Button, Tooltip } from '/@/renderer/components';
|
||||
|
||||
interface OrderToggleButtonProps {
|
||||
buttonProps?: Partial<ButtonProps>;
|
||||
onToggle: () => void;
|
||||
sortOrder: SortOrder;
|
||||
}
|
||||
|
||||
export const OrderToggleButton = ({ sortOrder, onToggle, buttonProps }: OrderToggleButtonProps) => {
|
||||
return (
|
||||
<Tooltip label={sortOrder}>
|
||||
<Button
|
||||
compact
|
||||
fw="600"
|
||||
size="md"
|
||||
variant="subtle"
|
||||
onClick={onToggle}
|
||||
{...buttonProps}
|
||||
>
|
||||
<>
|
||||
{sortOrder === SortOrder.ASC ? (
|
||||
<RiSortAsc size="1.3rem" />
|
||||
) : (
|
||||
<RiSortDesc size="1.3rem" />
|
||||
)}
|
||||
</>
|
||||
</Button>
|
||||
</Tooltip>
|
||||
);
|
||||
};
|
@ -1,11 +1,12 @@
|
||||
export * from './components/animated-page';
|
||||
export * from './queries/music-folders-query';
|
||||
export * from './components/play-button';
|
||||
export * from './utils';
|
||||
export * from './components/filter-bar';
|
||||
export * from './components/library-header';
|
||||
export * from './components/library-header-bar';
|
||||
export * from './components/order-toggle-button';
|
||||
export * from './components/play-button';
|
||||
export * from './components/resize-handle';
|
||||
export * from './mutations/create-favorite-mutation';
|
||||
export * from './mutations/delete-favorite-mutation';
|
||||
export * from './mutations/set-rating-mutation';
|
||||
export * from './components/filter-bar';
|
||||
export * from './components/resize-handle';
|
||||
export * from './queries/music-folders-query';
|
||||
export * from './utils';
|
||||
|
Loading…
Reference in New Issue
Block a user