From a2da3a5f09e75ee9c966bd269611f384e6c27f6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Malfait?= Date: Mon, 10 Jul 2023 14:06:35 +0200 Subject: [PATCH] Add ButtonGroup concept + Soon pill on button + implement in timeline (#551) * Add ButtonGroup concept * Add soon pill * Fix incorrect wrapping behavior * Implement button group in timeline --- .../CommentThreadCreateButton.tsx | 40 +++ .../comments/components/timeline/Timeline.tsx | 11 +- .../ui/components/accessories/SoonPill.tsx | 22 ++ .../modules/ui/components/buttons/Button.tsx | 42 ++- .../ui/components/buttons/ButtonGroup.tsx | 43 +++ .../ui/components/buttons/MainButton.tsx | 1 + .../buttons/__stories__/Button.stories.tsx | 267 +++++++++--------- .../TableActionBarButtonOpenComments.tsx | 2 +- front/src/modules/ui/icons/index.ts | 2 + .../src/modules/ui/layout/navbar/NavItem.tsx | 8 +- .../companies/__stories__/Company.stories.tsx | 2 +- 11 files changed, 292 insertions(+), 148 deletions(-) create mode 100644 front/src/modules/comments/components/comment-thread/CommentThreadCreateButton.tsx create mode 100644 front/src/modules/ui/components/accessories/SoonPill.tsx create mode 100644 front/src/modules/ui/components/buttons/ButtonGroup.tsx diff --git a/front/src/modules/comments/components/comment-thread/CommentThreadCreateButton.tsx b/front/src/modules/comments/components/comment-thread/CommentThreadCreateButton.tsx new file mode 100644 index 0000000000..8d13759685 --- /dev/null +++ b/front/src/modules/comments/components/comment-thread/CommentThreadCreateButton.tsx @@ -0,0 +1,40 @@ +import { useTheme } from '@emotion/react'; + +import { Button } from '@/ui/components/buttons/Button'; +import { ButtonGroup } from '@/ui/components/buttons/ButtonGroup'; +import { IconCheckbox, IconNotes, IconTimelineEvent } from '@/ui/icons/index'; + +type CommentThreadCreateButtonProps = { + onNoteClick?: () => void; + onTaskClick?: () => void; + onActivityClick?: () => void; +}; + +export function CommentThreadCreateButton({ + onNoteClick, + onTaskClick, + onActivityClick, +}: CommentThreadCreateButtonProps) { + const theme = useTheme(); + return ( + +