-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5ecb8f2
commit 1708499
Showing
32 changed files
with
841 additions
and
299 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import * as React from 'react'; | ||
import { PageSection, Text, TextContent, Title } from '@patternfly/react-core'; | ||
import { ExampleLink } from './ExampleLink'; | ||
|
||
export const AsyncDataListGraphQLHeader: React.FunctionComponent = () => ( | ||
<PageSection variant={'light'}> | ||
<TextContent> | ||
<Title size={'3xl'} headingLevel={'h1'}> | ||
Async Data List (GraphQL) | ||
</Title> | ||
<Text> | ||
A common pattern is to query a GraphQL endpoint, wait for its results and show | ||
the data in a data list. In this example we use <a href={'https://swapi.graph.cool'}>SWApi GraphQL</a> as a sample backend service | ||
to show the list of characters in the Star Wars universe. | ||
</Text> | ||
<Text> | ||
<ExampleLink filename={'AsyncDataListGraphQLPage.tsx'}> | ||
Source for this example | ||
</ExampleLink> | ||
. | ||
</Text> | ||
</TextContent> | ||
</PageSection> | ||
); |
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 @@ | ||
import * as React from 'react'; | ||
import { PageSection, Text, TextContent, Title } from '@patternfly/react-core'; | ||
import { ExampleLink } from './ExampleLink'; | ||
|
||
export const AsyncDataListRestHeader: React.FunctionComponent = () => ( | ||
<PageSection variant={'light'}> | ||
<TextContent> | ||
<Title size={'3xl'} headingLevel={'h1'}> | ||
Async Data List (REST) | ||
</Title> | ||
<Text> | ||
A common pattern is to call a REST API, wait for its results and show | ||
the data in a data list. In this example we use {' '} | ||
<a href={'https://swapi.co'}>SWApi</a> as a sample backend service | ||
to show the list of characters in the Star Wars universe. | ||
</Text> | ||
<Text> | ||
<ExampleLink filename={'AsyncDataListRestPage.tsx'}> | ||
Source for this example | ||
</ExampleLink> | ||
. | ||
</Text> | ||
</TextContent> | ||
</PageSection> | ||
); |
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 |
---|---|---|
@@ -1,8 +1,16 @@ | ||
import * as React from 'react'; | ||
|
||
export interface IExampleLinkProps extends React.HTMLAttributes<HTMLAnchorElement> { | ||
export interface IExampleLinkProps | ||
extends React.HTMLAttributes<HTMLAnchorElement> { | ||
filename: string; | ||
} | ||
|
||
export const ExampleLink: React.FunctionComponent<IExampleLinkProps> = ({ filename, ...props }) => | ||
<a href={`https://github.com/riccardo-forina/use-patternfly/tree/master/example/pages/${filename}`} {...props} /> | ||
export const ExampleLink: React.FunctionComponent<IExampleLinkProps> = ({ | ||
filename, | ||
...props | ||
}) => ( | ||
<a | ||
href={`https://github.com/riccardo-forina/use-patternfly/tree/master/example/pages/${filename}`} | ||
{...props} | ||
/> | ||
); |
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
Oops, something went wrong.