-
Notifications
You must be signed in to change notification settings - Fork 305
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(docs): remove dynamic imports from React primitive pages (#4869)
Co-authored-by: jacoblogan <[email protected]>
- Loading branch information
1 parent
b4afb51
commit 8d41213
Showing
274 changed files
with
4,149 additions
and
4,196 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@aws-amplify/ui-react": minor | ||
--- | ||
|
||
chore(docs): remove dynamic imports from React primitive pages, add FilterChildren internal component |
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,36 @@ | ||
import { useRouter } from 'next/router'; | ||
import { FilterChildren } from '@aws-amplify/ui-react/internal'; | ||
import { isString } from '@aws-amplify/ui'; | ||
|
||
import { Framework } from '@/data/frameworks'; | ||
|
||
export interface InlineFilterProps { | ||
children: React.ReactNode; | ||
/** | ||
* List of platforms that will render this content. If the current platform | ||
* is not in this list then the content will not be rendered | ||
*/ | ||
filters: (Framework | 'all')[]; | ||
} | ||
|
||
/** | ||
* Used to show content for filtered platforms | ||
* Usage: | ||
* <InlineFilter filters={['react', 'android']}> | ||
* This content will only render for react and angular platforms | ||
* </InlineFilter> | ||
*/ | ||
export const InlineFilter = ({ filters, children }: InlineFilterProps) => { | ||
const router = useRouter(); | ||
const platform = router?.query?.platform; | ||
|
||
if (!isString(platform)) { | ||
return null; | ||
} | ||
|
||
return ( | ||
<FilterChildren allowedFilters={filters} targetFilter={platform}> | ||
{children} | ||
</FilterChildren> | ||
); | ||
}; |
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 @@ | ||
export { InlineFilter, type InlineFilterProps } from './InlineFilter'; |
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,22 @@ | ||
import { PageTabLayout } from '@/components/Layout/PageTabLayout'; | ||
import { PropsTableTab } from '@/components/propsTable/PropsTableTab'; | ||
|
||
export const PrimitiveTabs = ({ children, htmlElement, mdnUrl, title }) => { | ||
return ( | ||
<PageTabLayout | ||
tabComponents={[ | ||
{ title: 'Documentation', children }, | ||
{ | ||
title: 'Props', | ||
children: ( | ||
<PropsTableTab | ||
componentName={title} | ||
htmlElement={htmlElement} | ||
mdnUrl={mdnUrl} | ||
/> | ||
), | ||
}, | ||
]} | ||
/> | ||
); | ||
}; |
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
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
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.