Fix "No results found" in record pickers (#12685)
This PR fixes small bugs around the "No results found" record picker. Before : https://github.com/user-attachments/assets/e2eee648-1cb1-40fb-ad3c-fe4724f7314e After : https://github.com/user-attachments/assets/714e6dea-3c65-4e04-9fef-ee718c94bbba Minor improvements : - Created a new component `RecordPickerNoRecordFoundMenuItem` to abstract this "No records found" menu item - Removed `not-allowed` cursor from MenuItem in disabled state. Fixes https://github.com/twentyhq/twenty/issues/12666
This commit is contained in:
@ -36,7 +36,7 @@ export const MenuItemDraggable = ({
|
||||
|
||||
const cursorType = showGrip
|
||||
? isDragDisabled
|
||||
? 'not-allowed'
|
||||
? 'default'
|
||||
: 'drag'
|
||||
: 'default';
|
||||
|
||||
|
||||
@ -131,7 +131,7 @@ export const StyledDraggableItem = styled.div`
|
||||
export const StyledHoverableMenuItemBase = styled(StyledMenuItemBase)<{
|
||||
disabled?: boolean;
|
||||
isIconDisplayedOnHoverOnly?: boolean;
|
||||
cursor?: 'drag' | 'default' | 'not-allowed';
|
||||
cursor?: 'drag' | 'default';
|
||||
}>`
|
||||
${({ isIconDisplayedOnHoverOnly, theme }) =>
|
||||
isIconDisplayedOnHoverOnly &&
|
||||
@ -156,14 +156,12 @@ export const StyledHoverableMenuItemBase = styled(StyledMenuItemBase)<{
|
||||
|
||||
cursor: ${({ cursor, disabled }) => {
|
||||
if (!isUndefined(disabled) && disabled !== false) {
|
||||
return 'not-allowed';
|
||||
return 'default';
|
||||
}
|
||||
|
||||
switch (cursor) {
|
||||
case 'drag':
|
||||
return 'grab';
|
||||
case 'not-allowed':
|
||||
return 'not-allowed';
|
||||
default:
|
||||
return 'pointer';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user