-
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
05fddf1
commit 127af1f
Showing
7 changed files
with
101 additions
and
29 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { PageSection, TextContent, Title, Text, FlexItem, Flex, Button } from '@patternfly/react-core'; | ||
import * as React from 'react'; | ||
import { Link } from 'react-router-dom'; | ||
|
||
export const Overview: React.FunctionComponent<any> = ({ children, ...props }) => { | ||
return ( | ||
<PageSection variant={'light'} {...props}> | ||
<TextContent> | ||
<Title size={'3xl'}>Overview</Title> | ||
<Text> | ||
use-patternfly is an opinionated set of hooks and components useful when building a React app with PatternFly. | ||
</Text> | ||
<Text> | ||
This project aims to encourage code reuse between all projects using PatternFly and to showcase how to implement features like fetching from an API and showing the data in a DataList or Table component. | ||
</Text> | ||
|
||
<Title size={'2xl'} headingLevel={'h2'}>Motivation</Title> | ||
<Text> | ||
Since I (<a href={'https://twitter.com/riccardoforina'}>@riccardoforina</a>) started | ||
building apps using PatternFly, I found myself writing solutions to the same problem | ||
many times. But how many ways can there be to <Link to={'/api/useDocumentTitle'}>set the document title</Link> or <Link to={'/api/AppLayout'}>wrap an app in a PatternFly chrome</Link>? I felt the need | ||
to finalize these solutions in something reusable and well-tested, to finally | ||
be able to focus on the app needs instead of re-learning how to wire PatternFly's | ||
components once again. | ||
</Text> | ||
</TextContent> | ||
|
||
<Title size={'2xl'} headingLevel={'h2'}>Dependencies</Title> | ||
<Text>The only real dependency-other than PatternFly itself-is <a href={'https://github.com/ReactTraining/react-router'}>react-router</a>, | ||
although it's listed as a peer dependency to avoid clashing with whatever | ||
version you are running on your project. Other utilities might have extra | ||
dependencies, but if you don't plan on using that specific utility you | ||
don't need to install them. | ||
</Text> | ||
|
||
<TextContent> | ||
<Flex> | ||
<FlexItem breakpointMods={[{modifier: 'align-right', breakpoint: 'sm'}]}> | ||
<Link to={'/getting-started/installation'}><Button as={'div'}>Installation</Button></Link> | ||
</FlexItem> | ||
</Flex> | ||
</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,4 +1,5 @@ | ||
export * from './Support'; | ||
export * from './DashboardLayout'; | ||
export * from './DashboardParams'; | ||
export * from './DashboardSimple'; | ||
export * from './GettingStarted'; | ||
export * from './Overview'; |
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
6 changes: 3 additions & 3 deletions
6
example/pages/SupportPage.tsx → example/pages/GettingStartedPage.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 |
---|---|---|
@@ -1,11 +1,11 @@ | ||
import * as React from 'react'; | ||
import { useA11yRouteContainer, useDocumentTitle } from 'use-patternfly'; | ||
import { Support } from '../components'; | ||
import { GettingStarted } from '../components'; | ||
|
||
export default function SupportPage() { | ||
export default function GettingStartedPage() { | ||
const a11yContainerProps = useA11yRouteContainer(); | ||
useDocumentTitle('Support'); | ||
return ( | ||
<Support {...a11yContainerProps} /> | ||
<GettingStarted {...a11yContainerProps} /> | ||
); | ||
} |
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,11 @@ | ||
import * as React from 'react'; | ||
import { useA11yRouteContainer, useDocumentTitle } from 'use-patternfly'; | ||
import { Overview } from '../components'; | ||
|
||
export default function OverviewPage() { | ||
const a11yContainerProps = useA11yRouteContainer(); | ||
useDocumentTitle('Overview'); | ||
return ( | ||
<Overview {...a11yContainerProps} /> | ||
); | ||
} |