-
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.
- Loading branch information
Showing
5 changed files
with
71 additions
and
14 deletions.
There are no files selected for viewing
59 changes: 59 additions & 0 deletions
59
...rc/modules/settings/data-model/components/SettingsDataModelNewFieldBreadcrumbDropDown.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,59 @@ | ||
import { Dropdown } from '@/ui/layout/dropdown/components/Dropdown'; | ||
import { DropdownMenu } from '@/ui/layout/dropdown/components/DropdownMenu'; | ||
import { DropdownMenuItemsContainer } from '@/ui/layout/dropdown/components/DropdownMenuItemsContainer'; | ||
import { MenuItem } from '@/ui/navigation/menu-item/components/MenuItem'; | ||
import styled from '@emotion/styled'; | ||
|
||
type SettingsDataModelNewFieldBreadcrumbDropDownProps = { | ||
isConfigureStep: boolean; | ||
onBreadcrumbClick: (isConfigureStep: boolean) => void; | ||
}; | ||
|
||
const StyledSpan = styled.span` | ||
color: ${({ theme }) => theme.font.color.primary}; | ||
font-size: ${({ theme }) => theme.font.size.md}; | ||
cursor: pointer; | ||
`; | ||
|
||
const StyledMenuItem = styled(MenuItem)` | ||
cursor: pointer; | ||
`; | ||
|
||
export const SettingsDataModelNewFieldBreadcrumbDropDown = ({ | ||
isConfigureStep, | ||
onBreadcrumbClick, | ||
}: SettingsDataModelNewFieldBreadcrumbDropDownProps) => { | ||
const dropdownId = `settings-object-new-field-breadcrumb-dropdown`; | ||
|
||
const handleClick = (step: boolean) => { | ||
onBreadcrumbClick(step); | ||
}; | ||
return ( | ||
<Dropdown | ||
dropdownPlacement="bottom" | ||
dropdownId={dropdownId} | ||
clickableComponent={ | ||
isConfigureStep ? ( | ||
<StyledSpan>New Field - 2. Configure</StyledSpan> | ||
) : ( | ||
<StyledSpan>New Field - 1. Type</StyledSpan> | ||
) | ||
} | ||
dropdownComponents={ | ||
<DropdownMenu> | ||
<DropdownMenuItemsContainer> | ||
<StyledMenuItem text="1. Type" onClick={() => handleClick(false)} /> | ||
|
||
<StyledMenuItem | ||
text="2. Configure" | ||
onClick={() => handleClick(true)} | ||
/> | ||
</DropdownMenuItemsContainer> | ||
</DropdownMenu> | ||
} | ||
dropdownHotkeyScope={{ | ||
scope: dropdownId, | ||
}} | ||
/> | ||
); | ||
}; |
5 changes: 3 additions & 2 deletions
5
...-front/src/modules/settings/data-model/constants/SettingsFieldTypeCategoryDescriptions.ts
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 |
---|---|---|
@@ -1,10 +1,11 @@ | ||
import { SettingsFieldTypeCategoryType } from '@/settings/data-model/types/SettingsFieldTypeCategoryType'; | ||
import { SettingsFieldTypeCategoryType } from "@/settings/data-model/types/SettingsFieldTypeCategoryType"; | ||
|
||
|
||
export const SETTINGS_FIELD_TYPE_CATEGORY_DESCRIPTIONS: Record< | ||
SettingsFieldTypeCategoryType, | ||
string | ||
> = { | ||
Basic: 'All the basic field types you need to start', | ||
Advanced: 'More advanced fields for advanced projects', | ||
Relation: 'Custom relationships and predefined relationships', | ||
Relation: 'Create a relation with another object', | ||
}; |
4 changes: 2 additions & 2 deletions
4
packages/twenty-front/src/modules/ui/navigation/bread-crumb/components/Breadcrumb.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
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