-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feat/record-group-add-new
- Loading branch information
Showing
54 changed files
with
605 additions
and
194 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
packages/twenty-front/src/modules/action-menu/components/RecordIndexActionMenuButtons.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { actionMenuEntriesComponentSelector } from '@/action-menu/states/actionMenuEntriesComponentSelector'; | ||
import { contextStoreNumberOfSelectedRecordsComponentState } from '@/context-store/states/contextStoreNumberOfSelectedRecordsComponentState'; | ||
import { useRecoilComponentValueV2 } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValueV2'; | ||
import { Button } from 'twenty-ui'; | ||
|
||
export const RecordIndexActionMenuButtons = () => { | ||
const contextStoreNumberOfSelectedRecords = useRecoilComponentValueV2( | ||
contextStoreNumberOfSelectedRecordsComponentState, | ||
); | ||
|
||
const actionMenuEntries = useRecoilComponentValueV2( | ||
actionMenuEntriesComponentSelector, | ||
); | ||
|
||
const pinnedEntries = actionMenuEntries.filter((entry) => entry.isPinned); | ||
|
||
if (contextStoreNumberOfSelectedRecords === 0) { | ||
return null; | ||
} | ||
|
||
return ( | ||
<> | ||
{pinnedEntries.map((entry, index) => ( | ||
<Button | ||
key={index} | ||
Icon={entry.Icon} | ||
size="small" | ||
variant="secondary" | ||
accent="default" | ||
title={entry.label} | ||
onClick={() => entry.onClick?.()} | ||
ariaLabel={entry.label} | ||
/> | ||
))} | ||
</> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
packages/twenty-front/src/modules/action-menu/components/RecordShowActionMenuButtons.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { actionMenuEntriesComponentSelector } from '@/action-menu/states/actionMenuEntriesComponentSelector'; | ||
import { PageHeaderOpenCommandMenuButton } from '@/ui/layout/page-header/components/PageHeaderOpenCommandMenuButton'; | ||
import { useRecoilComponentValueV2 } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValueV2'; | ||
import { Button, useIsMobile } from 'twenty-ui'; | ||
|
||
export const RecordShowActionMenuButtons = () => { | ||
const actionMenuEntries = useRecoilComponentValueV2( | ||
actionMenuEntriesComponentSelector, | ||
); | ||
|
||
const pinnedEntries = actionMenuEntries.filter((entry) => entry.isPinned); | ||
|
||
const isMobile = useIsMobile(); | ||
|
||
return ( | ||
<> | ||
{!isMobile && | ||
pinnedEntries.map((entry, index) => ( | ||
<Button | ||
key={index} | ||
Icon={entry.Icon} | ||
size="small" | ||
variant="secondary" | ||
accent="default" | ||
title={entry.label} | ||
onClick={() => entry.onClick?.()} | ||
ariaLabel={entry.label} | ||
/> | ||
))} | ||
<PageHeaderOpenCommandMenuButton key="more" /> | ||
</> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.