-
Notifications
You must be signed in to change notification settings - Fork 355
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
Descriptionlist complex content demo #10237
Open
ajaypratap003
wants to merge
1
commit into
patternfly:v5
Choose a base branch
from
ajaypratap003:descriptionlist-complext-content
base: v5
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+154
−0
Open
Changes from all commits
Commits
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
25 changes: 25 additions & 0 deletions
25
packages/react-core/src/demos/DescriptionList/DescriptionList.md
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,25 @@ | ||
--- | ||
id: Description list | ||
section: components | ||
--- | ||
|
||
import BarsIcon from '@patternfly/react-icons/dist/esm/icons/bars-icon'; | ||
import EllipsisVIcon from '@patternfly/react-icons/dist/esm/icons/ellipsis-v-icon'; | ||
import BellIcon from '@patternfly/react-icons/dist/esm/icons/bell-icon'; | ||
import CogIcon from '@patternfly/react-icons/dist/esm/icons/cog-icon'; | ||
import HelpIcon from '@patternfly/react-icons/dist/esm/icons/help-icon'; | ||
import ThIcon from '@patternfly/react-icons/dist/esm/icons/th-icon'; | ||
import QuestionCircleIcon from '@patternfly/react-icons/dist/esm/icons/question-circle-icon'; | ||
import imgAvatar from '@patternfly/react-core/src/components/assets/avatarImg.svg'; | ||
import pfIcon from '../assets/pf-logo-small.svg'; | ||
import pfLogo from '../assets/pf-logo.svg'; | ||
import PlusCircleIcon from '@patternfly/react-icons/dist/esm/icons/plus-circle-icon'; | ||
import { Link } from '@reach/router'; | ||
import { DashboardWrapper } from '@patternfly/react-core/dist/js/demos/DashboardWrapper'; | ||
|
||
## Demos | ||
|
||
### Complex content | ||
|
||
```js file='./examples/DescriptionListComplexContent.tsx' isFullscreen | ||
``` |
129 changes: 129 additions & 0 deletions
129
packages/react-core/src/demos/DescriptionList/examples/DescriptionListComplexContent.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,129 @@ | ||
import React from 'react'; | ||
import { | ||
DescriptionList, | ||
DescriptionListTerm, | ||
DescriptionListGroup, | ||
DescriptionListDescription, | ||
PageSection, | ||
PageSectionVariants, | ||
TextContent, | ||
Text, | ||
Grid, | ||
GridItem, | ||
Divider, | ||
Title | ||
} from '@patternfly/react-core'; | ||
import { Table, Thead, Tr, Th, Tbody, Td } from '@patternfly/react-table'; | ||
import { DashboardWrapper } from '@patternfly/react-core/dist/js/demos/DashboardWrapper'; | ||
|
||
export const DescriptionListComplexContent: React.FunctionComponent = () => ( | ||
<DashboardWrapper> | ||
<PageSection variant={PageSectionVariants.light}> | ||
<TextContent> | ||
<Text component="h1">Main title</Text> | ||
<Text component="p">This is a full page demo.</Text> | ||
</TextContent> | ||
</PageSection> | ||
<Divider component="div" /> | ||
<PageSection variant={PageSectionVariants.light}> | ||
<Grid hasGutter> | ||
<GridItem span={4}> | ||
<Grid hasGutter> | ||
<GridItem> | ||
<Title headingLevel="h2">Service overview</Title> | ||
</GridItem> | ||
<GridItem> | ||
<DescriptionList columnModifier={{ default: '2Col', lg: '2Col' }}> | ||
<DescriptionListGroup> | ||
<DescriptionListTerm>Name</DescriptionListTerm> | ||
<DescriptionListDescription>Example</DescriptionListDescription> | ||
</DescriptionListGroup> | ||
<DescriptionListGroup> | ||
<DescriptionListTerm>Label</DescriptionListTerm> | ||
<DescriptionListDescription>No label</DescriptionListDescription> | ||
</DescriptionListGroup> | ||
<DescriptionListGroup> | ||
<DescriptionListTerm>Annotations</DescriptionListTerm> | ||
<DescriptionListDescription>2 Annotations</DescriptionListDescription> | ||
</DescriptionListGroup> | ||
<DescriptionListGroup> | ||
<DescriptionListTerm>Created at:</DescriptionListTerm> | ||
<DescriptionListDescription>3 minutes ago</DescriptionListDescription> | ||
</DescriptionListGroup> | ||
<DescriptionListGroup> | ||
<DescriptionListTerm>Namespace</DescriptionListTerm> | ||
<DescriptionListDescription>ajay-test</DescriptionListDescription> | ||
</DescriptionListGroup> | ||
<DescriptionListGroup> | ||
<DescriptionListTerm>Pod selector</DescriptionListTerm> | ||
<DescriptionListDescription>app=MyApp</DescriptionListDescription> | ||
</DescriptionListGroup> | ||
<DescriptionListGroup> | ||
<DescriptionListTerm>Session affi nity</DescriptionListTerm> | ||
<DescriptionListDescription>None</DescriptionListDescription> | ||
</DescriptionListGroup> | ||
</DescriptionList> | ||
</GridItem> | ||
</Grid> | ||
</GridItem> | ||
<GridItem span={8}> | ||
<Grid hasGutter> | ||
<GridItem> | ||
<Title headingLevel="h2">Service routing</Title> | ||
</GridItem> | ||
<GridItem> | ||
<DescriptionList isFillColumns columnModifier={{ default: '2Col', lg: '2Col' }}> | ||
<DescriptionListGroup> | ||
<DescriptionListTerm>Service address</DescriptionListTerm> | ||
<DescriptionListDescription> | ||
<Table> | ||
<Thead> | ||
<Tr> | ||
<Th key={0}>Type</Th> | ||
<Th key={1}>Location</Th> | ||
</Tr> | ||
</Thead> | ||
<Tbody> | ||
<Tr key={0}> | ||
<Td>Cluster IP</Td> | ||
<Td>172.30.126.106</Td> | ||
</Tr> | ||
<Tr key={1}> | ||
<Td>Accessible within the cluster only</Td> | ||
<Td>n/a</Td> | ||
</Tr> | ||
</Tbody> | ||
</Table> | ||
</DescriptionListDescription> | ||
</DescriptionListGroup> | ||
<DescriptionListGroup> | ||
<DescriptionListTerm>Service port mapping</DescriptionListTerm> | ||
<DescriptionListDescription> | ||
<Table> | ||
<Thead> | ||
<Tr key={0}> | ||
<Th key={0}>Name</Th> | ||
<Th key={1}>Port</Th> | ||
<Th key={2}>Protocol</Th> | ||
<Th key={3}>Pod port or ...</Th> | ||
</Tr> | ||
</Thead> | ||
<Tbody> | ||
<Tr key={1}> | ||
<Td>test</Td> | ||
<Td>80</Td> | ||
<Td>TCP</Td> | ||
<Td>80</Td> | ||
</Tr> | ||
</Tbody> | ||
</Table> | ||
</DescriptionListDescription> | ||
</DescriptionListGroup> | ||
</DescriptionList> | ||
</GridItem> | ||
</Grid> | ||
</GridItem> | ||
</Grid> | ||
</PageSection> | ||
</DashboardWrapper> | ||
); |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The imports here just need to be cleaned up to remove things that aren't actually being used in this demo.