-
Notifications
You must be signed in to change notification settings - Fork 7.4k
feat(settings): move settings chrome into a single rounded card #21131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 7 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
cd15d10
feat(settings): move settings chrome into a single rounded card
FelixMalfait abf0a4e
feat(settings): move Security into a tab of the General page
FelixMalfait f408a59
refactor(settings): align settings IA — General naming + foldered pages
FelixMalfait c189cc9
fix(settings): point seeded command-menu items at consolidated settin…
FelixMalfait 49a3475
fix(settings): keep header/step-bar title centered; wizard Finish in …
FelixMalfait 6cd8c60
fix(settings): sit the active tab underline on the secondary bar's bo…
FelixMalfait fa5f79f
feat(settings): rename Updates page to Community with partner + Disco…
FelixMalfait 36bf99c
refactor(settings): drop dead layout props and collapse community lin…
FelixMalfait 78fa82e
fix(settings): make the Emails/Calendar tabs the connected accounts
FelixMalfait 50273f0
chore(settings): trim PR comments to the essential
FelixMalfait fb31b72
fix(settings): align the page header with the side panel top bar
FelixMalfait aa6a3db
fix(settings): address PR review — tab resolution, security redirect,…
FelixMalfait d2a0f17
refactor(settings): make SettingsTabBar presentational, drop the eage…
FelixMalfait 5781298
fix(settings): put the body scrollbar at the card edge, not the conte…
FelixMalfait 99036ef
fix(settings): prefer URL hash in tab resolver, memoize account channels
FelixMalfait b3c9ae5
fix(settings): drop the self-referencing Workspace breadcrumb link on…
FelixMalfait 6b5a516
fix(settings): use the tab resolver on the remaining tabbed pages
FelixMalfait File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
86 changes: 86 additions & 0 deletions
86
packages/twenty-front/src/modules/settings/components/layout/SettingsPageHeader.tsx
This file contains hidden or 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,86 @@ | ||
| import { useNavigationDrawerExpanded } from '@/navigation/hooks/useNavigationDrawerExpanded'; | ||
| import { | ||
| Breadcrumb, | ||
| type BreadcrumbProps, | ||
| } from '@/ui/navigation/bread-crumb/components/Breadcrumb'; | ||
| import { NavigationDrawerCollapseButton } from '@/ui/navigation/navigation-drawer/components/NavigationDrawerCollapseButton'; | ||
| import { useIsMobile } from '@/ui/utilities/responsive/hooks/useIsMobile'; | ||
| import { styled } from '@linaria/react'; | ||
| import { type ReactNode } from 'react'; | ||
| import { isDefined } from 'twenty-shared/utils'; | ||
| import { themeCssVariables } from 'twenty-ui/theme-constants'; | ||
|
|
||
| type SettingsPageHeaderProps = { | ||
| links: BreadcrumbProps['links']; | ||
| title?: ReactNode; | ||
| tag?: ReactNode; | ||
| actionButton?: ReactNode; | ||
| }; | ||
|
|
||
| // Header row inside the settings card. The side cells fill equal minmax(0, 1fr) | ||
| // tracks and clip overflow, so the centered title stays on the same vertical axis | ||
| // as the tabs and body even when the breadcrumb is long — the breadcrumb truncates | ||
| // instead of pushing or overlapping the title. Plain `1fr` (= minmax(auto, 1fr)) | ||
| // would let a long breadcrumb grow its track and shove the title off-center. | ||
| const StyledHeader = styled.div` | ||
| align-items: center; | ||
| box-sizing: border-box; | ||
| display: grid; | ||
| gap: ${themeCssVariables.spacing[2]}; | ||
| grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); | ||
| padding: ${themeCssVariables.spacing[3]}; | ||
| width: 100%; | ||
| `; | ||
|
|
||
| const StyledLeft = styled.div` | ||
| align-items: center; | ||
| display: flex; | ||
| gap: ${themeCssVariables.spacing[1]}; | ||
| min-width: 0; | ||
| overflow: hidden; | ||
| `; | ||
|
|
||
| const StyledTitle = styled.div` | ||
| align-items: center; | ||
| color: ${themeCssVariables.font.color.primary}; | ||
| display: flex; | ||
| font-size: ${themeCssVariables.font.size.md}; | ||
| font-weight: ${themeCssVariables.font.weight.semiBold}; | ||
| gap: ${themeCssVariables.spacing[2]}; | ||
| min-width: 0; | ||
| text-align: center; | ||
| `; | ||
|
|
||
| const StyledRight = styled.div` | ||
| align-items: center; | ||
| display: flex; | ||
| gap: ${themeCssVariables.spacing[2]}; | ||
| justify-content: flex-end; | ||
| min-width: 0; | ||
| `; | ||
|
|
||
| export const SettingsPageHeader = ({ | ||
| links, | ||
| title, | ||
| tag, | ||
| actionButton, | ||
| }: SettingsPageHeaderProps) => { | ||
| const isMobile = useIsMobile(); | ||
| const isNavigationDrawerExpanded = useNavigationDrawerExpanded(); | ||
|
|
||
| return ( | ||
| <StyledHeader> | ||
| <StyledLeft> | ||
| {!isNavigationDrawerExpanded && ( | ||
| <NavigationDrawerCollapseButton direction="right" /> | ||
| )} | ||
| <Breadcrumb links={links} /> | ||
| </StyledLeft> | ||
| <StyledTitle> | ||
| {!isMobile && isDefined(title) && title} | ||
| {!isMobile && tag} | ||
| </StyledTitle> | ||
| <StyledRight>{actionButton}</StyledRight> | ||
| </StyledHeader> | ||
| ); | ||
| }; | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.