-
Notifications
You must be signed in to change notification settings - Fork 138
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: custom name display for nav sections
- Loading branch information
1 parent
9af363f
commit 27b94d8
Showing
8 changed files
with
114 additions
and
20 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
8 changes: 8 additions & 0 deletions
8
src/components/molecules/SectionRenderer/useSectionCustomization.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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import {useMemo} from 'react'; | ||
import {SectionCustomization} from '@models/navigator'; | ||
|
||
export function useSectionCustomization(customization: SectionCustomization = {}) { | ||
const NameDisplay = useMemo(() => ({Component: customization.nameDisplay?.component}), [customization.nameDisplay]); | ||
|
||
return {NameDisplay}; | ||
} |
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
50 changes: 50 additions & 0 deletions
50
src/navsections/ClusterDiffSectionBlueprint/ResourceDiffSectionNameDisplay.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,50 @@ | ||
import React from 'react'; | ||
import styled from 'styled-components'; | ||
import {Tag} from 'antd'; | ||
|
||
const NameDisplayContainer = styled.div` | ||
margin-left: 16px; | ||
padding-top: 8px; | ||
padding-bottom: 8px; | ||
`; | ||
|
||
const TagsContainer = styled.div` | ||
width: 800px; | ||
display: flex; | ||
justify-content: space-between; | ||
margin-left: 24px; | ||
font-size: 16px; | ||
`; | ||
|
||
const TagWrapper = styled.div` | ||
width: 300px; | ||
`; | ||
|
||
const Spacing = styled.div` | ||
width: 60px; | ||
`; | ||
|
||
const Title = styled.h1` | ||
display: block; | ||
width: 100%; | ||
flex: 0 0 100%; | ||
`; | ||
|
||
function ResourceDiffSectionNameDisplay() { | ||
return ( | ||
<NameDisplayContainer> | ||
<Title>K8s Resource Diff</Title> | ||
<TagsContainer> | ||
<TagWrapper> | ||
<Tag>Local</Tag> | ||
</TagWrapper> | ||
<Spacing /> | ||
<TagWrapper> | ||
<Tag>Cluster</Tag> | ||
</TagWrapper> | ||
</TagsContainer> | ||
</NameDisplayContainer> | ||
); | ||
} | ||
|
||
export default ResourceDiffSectionNameDisplay; |
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