This PR was created by [GitStart](https://gitstart.com/) to address the requirements from this ticket: [TWNTY-7529](https://clients.gitstart.com/twenty/5449/tickets/TWNTY-7529). --- ### Description - Migrated all button components to `twenty-ui` \ \ `Button`\ `ButtonGroup`\ `ColorPickerButton`\ `FloatingButton`\ `FloatingButtonGroup`\ `FloatingIconButton`\ `FloatingIconButtonGroup`\ `IconButton`\ `IconButtonGroup`\ `LightButton`\ `LightIconButton`\ `LightIconButtonGroup`\ `MainButton`\ \ Fixes twentyhq/private-issues#89 Co-authored-by: gitstart-twenty <gitstart-twenty@users.noreply.github.com> Co-authored-by: Charles Bochet <charles@twenty.com>
46 lines
1.0 KiB
TypeScript
46 lines
1.0 KiB
TypeScript
import { TAB_LIST_COMPONENT_ID } from '@/ui/layout/show-page/components/ShowPageSubContainer';
|
|
import { useTabList } from '@/ui/layout/tab/hooks/useTabList';
|
|
import { useSetRecoilState } from 'recoil';
|
|
import {
|
|
Button,
|
|
ButtonGroup,
|
|
IconCheckbox,
|
|
IconNotes,
|
|
IconPaperclip,
|
|
} from 'twenty-ui';
|
|
|
|
export const TimelineCreateButtonGroup = ({
|
|
isInRightDrawer = false,
|
|
}: {
|
|
isInRightDrawer?: boolean;
|
|
}) => {
|
|
const { activeTabIdState } = useTabList(
|
|
`${TAB_LIST_COMPONENT_ID}-${isInRightDrawer}`,
|
|
);
|
|
const setActiveTabId = useSetRecoilState(activeTabIdState);
|
|
|
|
return (
|
|
<ButtonGroup variant={'secondary'}>
|
|
<Button
|
|
Icon={IconNotes}
|
|
title="Note"
|
|
onClick={() => {
|
|
setActiveTabId('notes');
|
|
}}
|
|
/>
|
|
<Button
|
|
Icon={IconCheckbox}
|
|
title="Task"
|
|
onClick={() => {
|
|
setActiveTabId('tasks');
|
|
}}
|
|
/>
|
|
<Button
|
|
Icon={IconPaperclip}
|
|
title="File"
|
|
onClick={() => setActiveTabId('files')}
|
|
/>
|
|
</ButtonGroup>
|
|
);
|
|
};
|