Auth0 client integration ready
This commit is contained in:
1 parent
3f9423e91d
commit
eca2e6deff
12 files changed
+614
-10
No files matched your search
@@ -0,0 +1,13 @@
|
||||
import React, { Component } from 'react'
|
||||
|
||||
class Callback extends Component {
|
||||
render() {
|
||||
return (
|
||||
<div>
|
||||
Authenticating...
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
export default Callback
|
||||
@@ -1,13 +1,14 @@
|
||||
import React, { Component } from 'react';
|
||||
import {graphql} from 'react-apollo';
|
||||
import {getUserByAuthIdQuery} from '../queries/queries';
|
||||
import {auth} from '../App';
|
||||
|
||||
class LoggedInUser extends Component {
|
||||
|
||||
displayLoggedInUser(){
|
||||
|
||||
const user = this.props.data.userByAuthId;
|
||||
console.log(this.props);
|
||||
|
||||
if(user){
|
||||
if (user.firstName) {
|
||||
return(
|
||||
@@ -24,7 +25,8 @@ class LoggedInUser extends Component {
|
||||
}
|
||||
|
||||
} else {
|
||||
return( <div>Login / Sign up</div> );
|
||||
console.log(auth);
|
||||
return( <div onClick={() => auth.login()}>Login / Sign up</div> );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ function ButtonAppBar(props) {
|
||||
<IconButton className={classes.menuButton} color="inherit" title="About this Module" component={AboutLink}><AboutIcon /></IconButton>
|
||||
<IconButton className={classes.menuButton} color="inherit" title="Go to another Module" component={AboutLink}><ModulesIcon /></IconButton>
|
||||
|
||||
<LoggedInUser authId="2"/>
|
||||
<LoggedInUser authId="999"/>
|
||||
</Toolbar>
|
||||
</AppBar>
|
||||
</div>
|
||||
|
||||
@@ -37,6 +37,7 @@ const styles = theme => ({
|
||||
class ProfileTabs extends React.Component {
|
||||
state = {
|
||||
value: 0,
|
||||
cureateDisabled: "false"
|
||||
};
|
||||
|
||||
handleChange = (event, value) => {
|
||||
@@ -44,12 +45,14 @@ class ProfileTabs extends React.Component {
|
||||
};
|
||||
|
||||
updateUser = () => {
|
||||
this.setState({ value: 1 });
|
||||
this.setState({ value: 1, cureateDisabled: "true" });
|
||||
};
|
||||
|
||||
render() {
|
||||
const { classes } = this.props;
|
||||
const { value } = this.state;
|
||||
const { createDisabled } = this.state;
|
||||
console.log(createDisabled);
|
||||
|
||||
return (
|
||||
<div className={classes.root}>
|
||||
@@ -62,7 +65,8 @@ class ProfileTabs extends React.Component {
|
||||
indicatorColor="primary"
|
||||
textColor="primary"
|
||||
>
|
||||
<Tab label="Create Profile" icon={<AddIcon />} />
|
||||
<Tab label="Create Profile" icon={<AddIcon />} />
|
||||
<Tab disabled={createDisabled} label="Create Profile" icon={<AddIcon />} />
|
||||
<Tab label="Update Profile" icon={<UpdateIcon />} />
|
||||
<Tab label="Manage Images" icon={<ImageIcon />} />
|
||||
</Tabs>
|
||||
|
||||
Reference in new issue
Block a user