| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| import * as React from 'react'; | ||
| import { | ||
| Table, | ||
| TableHeader, | ||
| TableBody, | ||
| TableProps, | ||
| textCenter, | ||
| IRow, | ||
| ICell, | ||
| } from '@patternfly/react-table'; | ||
| import { | ||
| EmptyState, | ||
| EmptyStateBody, | ||
| EmptyStateIcon, | ||
| EmptyStateSecondaryActions, | ||
| EmptyStateVariant, | ||
| Title, | ||
| Button | ||
| } from '@patternfly/react-core'; | ||
| import { CubesIcon } from '@patternfly/react-icons'; | ||
| class EmptyStateTable extends React.Component<TableProps, { columns: (ICell | string)[]; rows: IRow[] }> { | ||
| constructor(props: TableProps) { | ||
| super(props); | ||
| this.state = { | ||
| columns: [ | ||
| { title: 'Repositories' }, | ||
| 'Branches', | ||
| { title: 'Pull requests' }, | ||
| 'Workspaces', | ||
| { title: 'Last Commit' } | ||
| ], | ||
| rows: [ | ||
| { | ||
| heightAuto: true, | ||
| props: { colSpan: '8' }, | ||
| title: ( | ||
| <EmptyState variant={EmptyStateVariant.small}> | ||
| <EmptyStateIcon icon={CubesIcon} /> | ||
| <Title headingLevel="h5" size="lg"> | ||
| Empty State | ||
| </Title> | ||
| <EmptyStateBody> | ||
| This represents an the empty state pattern in Patternfly 4. Hopefully it's simple enough to use but | ||
| flexible enough to meet a variety of needs. | ||
| </EmptyStateBody> | ||
| <Button variant="primary">Primary Action</Button> | ||
| <EmptyStateSecondaryActions> | ||
| <Button variant="link">Multiple</Button> | ||
| <Button variant="link">Action Buttons</Button> | ||
| <Button variant="link">Can</Button> | ||
| <Button variant="link">Go here</Button> | ||
| <Button variant="link">In the secondary</Button> | ||
| <Button variant="link">Action area</Button> | ||
| </EmptyStateSecondaryActions> | ||
| </EmptyState> | ||
| ) | ||
| } | ||
| ] | ||
| }; | ||
| } | ||
| render() { | ||
| const { columns, rows } = this.state; | ||
| return ( | ||
| <Table caption="Empty State Table" cells={columns} rows={rows}> | ||
| <TableHeader /> | ||
| <TableBody /> | ||
| </Table> | ||
| ); | ||
| } | ||
| } |
| Back | FazBrowse Home | New Git URL |
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.
Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality@priley86 what do you think about introducing row decorators? Similiar to how cell formatters work. This can be potentially problem in future when we'll update API and we will have to keep it intact.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.