-
Notifications
You must be signed in to change notification settings - Fork 317
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
feat(rna): add DefaultContent and override styles #3009
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
import React from 'react'; | ||
|
||
import { AuthenticatorDemo } from '../features/Authenticator'; | ||
// import Example from '../features/Authenticator/Demo/Example'; | ||
import Example from '../features/Authenticator/Styles/Example'; | ||
// import { Demo as InAppDemo } from '../features/InAppMessaging'; | ||
Comment on lines
+3
to
5
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Moving forward we will use this structure for RN |
||
|
||
const App = () => { | ||
return <AuthenticatorDemo />; | ||
// return <InAppDemo />; | ||
return <Example />; | ||
}; | ||
|
||
export default App; |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import React, { ReactNode } from 'react'; | ||
import { StyleProp, StyleSheet, Text, View, ViewStyle } from 'react-native'; | ||
|
||
import { Authenticator, useAuthenticator } from '@aws-amplify/ui-react-native'; | ||
import { Amplify } from 'aws-amplify'; | ||
|
||
import { Button } from '../../../ui'; | ||
|
||
Amplify.configure({}); | ||
|
||
const MyHeader = ({ | ||
children, | ||
style, | ||
}: { | ||
children?: ReactNode; | ||
style?: StyleProp<ViewStyle>; | ||
}) => ( | ||
<View style={style}> | ||
<Text style={{ fontSize: 36 }}>{children}</Text> | ||
</View> | ||
); | ||
|
||
function SignOutButton() { | ||
const { signOut } = useAuthenticator(); | ||
return <Button onPress={signOut}>Sign Out</Button>; | ||
} | ||
|
||
function App() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just noting this example is not complete and will be used for the |
||
return ( | ||
<Authenticator.Provider> | ||
<Authenticator | ||
components={{ | ||
SignIn: (props) => ( | ||
<Authenticator.SignIn {...props} Header={MyHeader} /> | ||
), | ||
}} | ||
> | ||
<View style={style.container}> | ||
<SignOutButton /> | ||
</View> | ||
</Authenticator> | ||
</Authenticator.Provider> | ||
); | ||
} | ||
|
||
const style = StyleSheet.create({ | ||
container: { flex: 1, alignItems: 'center', justifyContent: 'center' }, | ||
}); | ||
|
||
export default App; |
This file was deleted.
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.
Assuming this should not go in