diff --git a/package.json b/package.json index 8b3c84b..31db85a 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,7 @@ "moment": "^2.25.3", "react": "^16.13.1", "react-dom": "^16.13.1", + "react-google-button": "^0.7.1", "react-redux": "^7.2.0", "react-redux-firebase": "^3.4.0", "react-router-dom": "^5.2.0", diff --git a/src/components/Alert.tsx b/src/components/Alert.tsx new file mode 100644 index 0000000..0aa6566 --- /dev/null +++ b/src/components/Alert.tsx @@ -0,0 +1,15 @@ +import React, {FC} from 'react'; +import {FontAwesomeIcon} from '@fortawesome/react-fontawesome'; +import {faExclamationTriangle} from '@fortawesome/free-solid-svg-icons'; + +interface IProps { + text: string; +} + +const Alert: FC = ({text}) => ( +
+ {text} +
+); + +export default Alert; diff --git a/src/components/NavBar.tsx b/src/components/NavBar.tsx index 9635b0a..d2622be 100644 --- a/src/components/NavBar.tsx +++ b/src/components/NavBar.tsx @@ -3,14 +3,17 @@ import React, {FC} from 'react'; import {Link} from 'react-router-dom'; import * as ROUTES from '../constants/routes'; //Redux +import {compose} from '@reduxjs/toolkit'; import {connect} from 'react-redux'; +import {withFirebase, WithFirebaseProps} from 'react-redux-firebase'; import {selectProfile} from '../store/firebase'; -// import {selectAuthState} from '../store/auth'; // Style import {FontAwesomeIcon} from '@fortawesome/react-fontawesome'; import {faCode, faSignOutAlt, faUser} from '@fortawesome/free-solid-svg-icons'; +// Typing +import User from '../models/User'; -interface IProps { +interface IProps extends WithFirebaseProps { isEmpty: boolean; isLoaded: boolean; } @@ -18,7 +21,7 @@ interface IProps { /** * Main Navbar serves navigation routes. */ -const NavBar: FC = ({isEmpty, isLoaded}) => { +const NavBar: FC = ({firebase, isEmpty, isLoaded}) => { const publicLinks = (
  • @@ -58,7 +61,11 @@ const NavBar: FC = ({isEmpty, isLoaded}) => {
  • - + firebase.logout()} + > Log out @@ -67,7 +74,7 @@ const NavBar: FC = ({isEmpty, isLoaded}) => { ); /** Display appropriated links after loading given authenticated prop */ - const RenderLinks = !isLoaded && !isEmpty ? privateLinks : publicLinks; + const RenderLinks = isLoaded && !isEmpty ? privateLinks : publicLinks; return (