This repository has been archived by the owner on Aug 15, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add user details in reducer, set up dummy profile page
- Loading branch information
1 parent
1afa5af
commit 6823a0b
Showing
13 changed files
with
357 additions
and
82 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
File renamed without changes.
File renamed without changes.
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,41 @@ | ||
import React from 'react'; | ||
import { connect } from 'react-redux'; | ||
import { Layout } from '@ui-kitten/components'; | ||
|
||
import LoginStyles from '../../styles/Login.Styles'; | ||
import IconButton from '../../components/user/IconButton'; | ||
import LoginAvatar from '../../components/user/Avatar'; | ||
import AuthContext from '../../contexts/AuthContext'; | ||
|
||
type OwnProps = { | ||
userName?: string, | ||
userAvatar?: string, | ||
userId?: string | ||
}; | ||
|
||
const LoginScreen: React.FC<OwnProps> = (props: OwnProps) => { | ||
const { login } = React.useContext(AuthContext); | ||
|
||
return ( | ||
<Layout style={LoginStyles.container}> | ||
<LoginAvatar | ||
greetingMessage={props.userName ? `Welcome ${props.userName}` : 'Welcome Stranger!'} | ||
avatarImgSource={props.userAvatar} | ||
actionMessage={props.userId ? undefined : 'Please log in to continue.'} | ||
/> | ||
<IconButton | ||
iconName="google" | ||
buttonText="Login with Google" | ||
handleButtonPress={login} | ||
/> | ||
</Layout> | ||
); | ||
}; | ||
|
||
const mapStateToProps = ({ auth } : any) => ({ | ||
userName: auth.userName, | ||
userAvatar: auth.userAvatar, | ||
userId: auth.userId | ||
}); | ||
|
||
export default connect(mapStateToProps)(LoginScreen); |
This file was deleted.
Oops, something went wrong.
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,42 @@ | ||
import React from 'react'; | ||
import { connect } from 'react-redux'; | ||
import { Layout } from '@ui-kitten/components'; | ||
|
||
import LoginStyles from '../../styles/Login.Styles'; | ||
import IconButton from '../../components/user/IconButton'; | ||
import LoginAvatar from '../../components/user/Avatar'; | ||
import AuthContext from '../../contexts/AuthContext'; | ||
|
||
type OwnProps = { | ||
userName?: string, | ||
userAvatar?: string, | ||
userId?: string | ||
}; | ||
|
||
// TODO: WIP - just testing the redux store. | ||
const ProfileScreen: React.FC<OwnProps> = (props: OwnProps) => { | ||
const { login } = React.useContext(AuthContext); | ||
|
||
return ( | ||
<Layout style={LoginStyles.container}> | ||
<LoginAvatar | ||
greetingMessage={props.userName ? `Welcome ${props.userName}` : 'Welcome Stranger!'} | ||
avatarImgSource={props.userAvatar} | ||
actionMessage={props.userId ? undefined : 'Please log in to continue.'} | ||
/> | ||
<IconButton | ||
iconName="google" | ||
buttonText="Login with Google" | ||
handleButtonPress={login} | ||
/> | ||
</Layout> | ||
); | ||
}; | ||
|
||
const mapStateToProps = ({ auth } : any) => ({ | ||
userName: auth.userName, | ||
userAvatar: auth.userAvatar, | ||
userId: auth.userId | ||
}); | ||
|
||
export default connect(mapStateToProps)(ProfileScreen); |
File renamed without changes.
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.