-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(@aws-amplify/ui-react): withAuthenticator(Component[, props]) (#…
…5204) * Add build:watch to @aws-amplify/ui-react * Fix yarn workspace support for @aws-amplify/ui-react * Add withAuthenticator(Component[, props]) * Add stories for withAuthenticator * Add withAuthenticator to the README * Update Storybook README to build all UI packages * Add withAuthenticator migration guide
- Loading branch information
1 parent
91e7432
commit 39d84e7
Showing
7 changed files
with
82 additions
and
9 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 |
---|---|---|
@@ -1 +1,3 @@ | ||
export * from './components'; | ||
export * from './components'; | ||
|
||
export { withAuthenticator } from './withAuthenticator'; |
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,14 @@ | ||
import React, { ComponentType, ComponentPropsWithRef } from 'react'; | ||
|
||
import { AmplifyAuthenticator } from './'; | ||
|
||
export function withAuthenticator( | ||
Component: ComponentType, | ||
props?: ComponentPropsWithRef<typeof AmplifyAuthenticator> | ||
) { | ||
return ( | ||
<AmplifyAuthenticator {...props}> | ||
<Component /> | ||
</AmplifyAuthenticator> | ||
); | ||
} |
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