-
Notifications
You must be signed in to change notification settings - Fork 377
chore: Convert examples to typescript #6791
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
Merged
Merged
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 hidden or 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,4 @@ | ||
| declare module '*.svg' { | ||
| const content: string; | ||
| export default content; | ||
| } |
6 changes: 3 additions & 3 deletions
6
packages/react-core/src/components/BackToTop/examples/BackToTop.css
This file contains hidden or 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,4 @@ | ||
| #ws-react-c-back-to-top-basic { | ||
| height: 300px; | ||
| position: relative; | ||
| } | ||
| height: 300px; | ||
| position: relative; | ||
| } |
This file contains hidden or 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
4 changes: 4 additions & 0 deletions
4
packages/react-core/src/components/BackToTop/examples/BackToTopBasic.tsx
This file contains hidden or 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,4 @@ | ||
| import React from 'react'; | ||
| import { BackToTop } from '@patternfly/react-core'; | ||
|
|
||
| export const BackToTopBasic: React.FunctionComponent = () => <BackToTop isAlwaysVisible />; |
This file contains hidden or 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
4 changes: 4 additions & 0 deletions
4
packages/react-core/src/components/Backdrop/examples/BackdropBasic.tsx
This file contains hidden or 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,4 @@ | ||
| import React from 'react'; | ||
| import { Backdrop } from '@patternfly/react-core'; | ||
|
|
||
| export const BackdropBasic: React.FunctionComponent = () => <Backdrop />; |
10 changes: 10 additions & 0 deletions
10
packages/react-core/src/components/Backdrop/examples/BackdropSpinner.tsx
This file contains hidden or 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,10 @@ | ||
| import React from 'react'; | ||
| import { Backdrop, Spinner, Bullseye } from '@patternfly/react-core'; | ||
|
|
||
| export const BackdropSpinner: React.FunctionComponent = () => ( | ||
| <Backdrop> | ||
| <Bullseye> | ||
| <Spinner /> | ||
| </Bullseye> | ||
| </Backdrop> | ||
| ); |
This file contains hidden or 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
15 changes: 15 additions & 0 deletions
15
packages/react-core/src/components/BackgroundImage/examples/BackgroundImageBasic.tsx
This file contains hidden or 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,15 @@ | ||
| import React from 'react'; | ||
| import { BackgroundImage } from '@patternfly/react-core'; | ||
|
|
||
| /** | ||
| * Note: When using background-filter.svg, you must also include #image_overlay as the fragment identifier | ||
| */ | ||
| const images = { | ||
| xs: '/assets/images/pfbg_576.jpg', | ||
| xs2x: '/assets/images/pfbg_576@2x.jpg', | ||
| sm: '/assets/images/pfbg_768.jpg', | ||
| sm2x: '/assets/images/pfbg_768@2x.jpg', | ||
| lg: '/assets/images/pfbg_1200.jpg' | ||
| }; | ||
|
|
||
| export const BackgroundImageBasic: React.FunctionComponent = () => <BackgroundImage src={images} />; |
This file contains hidden or 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
19 changes: 19 additions & 0 deletions
19
packages/react-core/src/components/Badge/examples/BadgeRead.tsx
This file contains hidden or 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,19 @@ | ||
| import React from 'react'; | ||
| import { Badge } from '@patternfly/react-core'; | ||
|
|
||
| export const BadgeRead: React.FunctionComponent = () => ( | ||
| <React.Fragment> | ||
| <Badge key={1} isRead> | ||
| 7 | ||
| </Badge>{' '} | ||
| <Badge key={2} isRead> | ||
| 24 | ||
| </Badge>{' '} | ||
| <Badge key={3} isRead> | ||
| 240 | ||
| </Badge>{' '} | ||
| <Badge key={4} isRead> | ||
| 999+ | ||
| </Badge> | ||
| </React.Fragment> | ||
| ); |
8 changes: 8 additions & 0 deletions
8
packages/react-core/src/components/Badge/examples/BadgeUnread.tsx
This file contains hidden or 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,8 @@ | ||
| import React from 'react'; | ||
| import { Badge } from '@patternfly/react-core'; | ||
|
|
||
| export const BadgeUnread: React.FunctionComponent = () => ( | ||
| <React.Fragment> | ||
| <Badge key={1}>7</Badge> <Badge key={2}>24</Badge> <Badge key={3}>240</Badge> <Badge key={4}>999+</Badge> | ||
| </React.Fragment> | ||
| ); |
This file contains hidden or 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
16 changes: 16 additions & 0 deletions
16
packages/react-core/src/components/Banner/examples/BannerBasic.tsx
This file contains hidden or 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,16 @@ | ||
| import React from 'react'; | ||
| import { Banner } from '@patternfly/react-core'; | ||
|
|
||
| export const BannerBasic: React.FunctionComponent = () => ( | ||
| <React.Fragment> | ||
| <Banner>Default banner</Banner> | ||
| <br /> | ||
| <Banner variant="info">Info banner</Banner> | ||
| <br /> | ||
| <Banner variant="danger">Danger banner</Banner> | ||
| <br /> | ||
| <Banner variant="success">Success banner</Banner> | ||
| <br /> | ||
| <Banner variant="warning">Warning banner</Banner> | ||
| </React.Fragment> | ||
| ); | ||
This file contains hidden or 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
5 changes: 5 additions & 0 deletions
5
packages/react-core/src/components/Brand/examples/BrandBasic.tsx
This file contains hidden or 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,5 @@ | ||
| import React from 'react'; | ||
| import { Brand } from '@patternfly/react-core'; | ||
| import pfLogo from './pfLogo.svg'; | ||
|
|
||
| export const BrandBasic: React.FunctionComponent = () => <Brand src={pfLogo} alt="Patternfly Logo" />; |
This file contains hidden or 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
13 changes: 13 additions & 0 deletions
13
packages/react-core/src/components/Breadcrumb/examples/BreadcrumbBasic.tsx
This file contains hidden or 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,13 @@ | ||
| import React from 'react'; | ||
| import { Breadcrumb, BreadcrumbItem } from '@patternfly/react-core'; | ||
|
|
||
| export const BreadcrumbBasic: React.FunctionComponent = () => ( | ||
| <Breadcrumb> | ||
| <BreadcrumbItem to="#">Section home</BreadcrumbItem> | ||
| <BreadcrumbItem to="#">Section title</BreadcrumbItem> | ||
| <BreadcrumbItem to="#">Section title</BreadcrumbItem> | ||
| <BreadcrumbItem to="#" isActive> | ||
| Section landing | ||
| </BreadcrumbItem> | ||
| </Breadcrumb> | ||
| ); |
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.
Usually our examples match the core examples. For that reason, I would add back the
<br />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.
Done. And updated other recent instances where I was using flexbox instead of breaks and empty spaces as well.