-
Notifications
You must be signed in to change notification settings - Fork 352
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
Chore(Skeleton): Adding demo to match core #10050
Open
gabipodolnikova
wants to merge
1
commit into
patternfly:v5
Choose a base branch
from
gabipodolnikova:skeleton-demos
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.
+64
−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
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,12 @@ | ||
--- | ||
id: Skeleton | ||
section: components | ||
--- | ||
|
||
## Demos | ||
|
||
### Skeleton card | ||
|
||
```ts file='./examples/Skeleton/SkeletonCard.tsx' isFullscreen | ||
|
||
``` |
52 changes: 52 additions & 0 deletions
52
packages/react-core/src/demos/examples/Skeleton/SkeletonCard.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,52 @@ | ||
import React from 'react'; | ||
import { | ||
Gallery, | ||
Flex, | ||
PageSection, | ||
PageSectionVariants, | ||
TextContent, | ||
Text, | ||
Card, | ||
CardBody, | ||
Skeleton | ||
} from '@patternfly/react-core'; | ||
import { DashboardWrapper } from '@patternfly/react-core/src/demos/DashboardWrapper'; | ||
|
||
export const SkeletonCard: React.FunctionComponent = () => { | ||
const card = (index: number) => ( | ||
<Card key={index} isCompact> | ||
<CardBody> | ||
<Flex direction={{ default: 'column' }} spacer={{ default: 'spacerMd' }}> | ||
<Skeleton /> | ||
<Skeleton width="66%" screenreaderText="Loaded 66% of content" /> | ||
<Skeleton width="25%" screenreaderText="Loaded 25% of content" /> | ||
<Skeleton width="50%" screenreaderText="Loaded 50% of content" /> | ||
</Flex> | ||
</CardBody> | ||
<CardBody> | ||
<Skeleton shape="square" width="75%" screenreaderText="Loading medium square contents" /> | ||
</CardBody> | ||
<CardBody> | ||
<Flex direction={{ default: 'column' }} spacer={{ default: 'spacerMd' }}> | ||
<Skeleton /> | ||
<Skeleton width="25%" screenreaderText="Loaded 25% of content" /> | ||
<Skeleton width="75%" screenreaderText="Loaded 75% of content" /> | ||
<Skeleton width="50%" screenreaderText="Loaded 50% of content" /> | ||
</Flex> | ||
</CardBody> | ||
</Card> | ||
); | ||
return ( | ||
<DashboardWrapper> | ||
<PageSection variant={PageSectionVariants.light}> | ||
<TextContent> | ||
<Text component="h1">Main title</Text> | ||
<Text component="p">This is a full page demo.</Text> | ||
</TextContent> | ||
</PageSection> | ||
<PageSection> | ||
<Gallery hasGutter>{Array.from({ length: 7 }).map((_value, index) => card(index))}</Gallery> | ||
</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.
I believe you'll want to add the
import { DashboardWrapper } from '@patternfly/react-core/src/demos/DashboardWrapper';
import statement to the top of this markdown file and that should fix the docs build