File tree Expand file tree Collapse file tree 5 files changed +8
-12
lines changed
packages/gatsby-theme/src Expand file tree Collapse file tree 5 files changed +8
-12
lines changed Original file line number Diff line number Diff line change @@ -15,11 +15,8 @@ const Account = () => {
15
15
}
16
16
if ( user ) {
17
17
return < Profile user = { user } /> ;
18
- } else {
19
- return (
20
- < GithubButton onClick = { ( ) => loginUser ( ) } > Sign up</ GithubButton >
21
- ) ;
22
18
}
19
+ return < GithubButton onClick = { ( ) => loginUser ( ) } > Sign up</ GithubButton > ;
23
20
} }
24
21
</ WithCurrentUser >
25
22
) ;
Original file line number Diff line number Diff line change @@ -15,9 +15,8 @@ const Upvote = () => {
15
15
{ ( { user } ) => {
16
16
if ( user ) {
17
17
return < UpvoteData event = { ( ) => console . log ( 'upvoted!' ) } /> ;
18
- } else {
19
- return < UpvoteData event = { ( ) => loginUser ( ) } /> ;
20
18
}
19
+ return < UpvoteData event = { ( ) => loginUser ( ) } /> ;
21
20
} }
22
21
</ WithCurrentUser >
23
22
) ;
@@ -27,6 +26,8 @@ type UpvoteDataProps = {
27
26
event : string ;
28
27
} ;
29
28
29
+ // place holder until we have a backend that stores the number of upvotes
30
+ // and can keep track of which tutorials a user upvotes
30
31
const UpvoteData : React . FunctionComponent < UpvoteDataProps > = ( { event } ) => {
31
32
return (
32
33
< Flex flexDirection = "column" alignItems = "center" justifyContent = "center" >
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ const TutorialLayout: React.FunctionComponent<TutorialLayoutProps> = ({
18
18
return null ;
19
19
}
20
20
const { pageTitle } = data ! . mdx ! . frontmatter ! ;
21
- const tutorialTitle = data ! . tutorialTitle ! . frontmatter ! . tutorialTitle ! ;
21
+ const { tutorialTitle } = data ! . tutorialTitle ! . frontmatter ! ;
22
22
const chapters = data ! . pageTitles ! . edges ! . map (
23
23
a => a . node ! . frontmatter ! . pageTitle ! ,
24
24
) ;
Original file line number Diff line number Diff line change @@ -15,10 +15,9 @@ const Profile = () => {
15
15
}
16
16
if ( user ) {
17
17
return < ProfilePage user = { user } /> ;
18
- } else {
19
- navigate ( '/signup/' ) ;
20
- return null ;
21
18
}
19
+ navigate ( '/signup/' ) ;
20
+ return null ;
22
21
} }
23
22
</ WithCurrentUser >
24
23
) ;
Original file line number Diff line number Diff line change @@ -17,9 +17,8 @@ const Signup = () => {
17
17
if ( user ) {
18
18
navigate ( '/profile/' ) ;
19
19
return null ;
20
- } else {
21
- return < SignupPage /> ;
22
20
}
21
+ return < SignupPage /> ;
23
22
} }
24
23
</ WithCurrentUser >
25
24
) ;
You can’t perform that action at this time.
0 commit comments