From 124885d2f38ce92f0b37ab089951094a57d78867 Mon Sep 17 00:00:00 2001
From: Brad Westfall
Date: Thu, 30 May 2019 11:49:11 -0700
Subject: [PATCH 01/48] rename
---
src/{wireframes => wireframe}/App.js | 0
src/{wireframes => wireframe}/wireframes.scss | 0
2 files changed, 0 insertions(+), 0 deletions(-)
rename src/{wireframes => wireframe}/App.js (100%)
rename src/{wireframes => wireframe}/wireframes.scss (100%)
diff --git a/src/wireframes/App.js b/src/wireframe/App.js
similarity index 100%
rename from src/wireframes/App.js
rename to src/wireframe/App.js
diff --git a/src/wireframes/wireframes.scss b/src/wireframe/wireframes.scss
similarity index 100%
rename from src/wireframes/wireframes.scss
rename to src/wireframe/wireframes.scss
From af6d480d204f32ff943d2efbaeedaa90d44dfa23 Mon Sep 17 00:00:00 2001
From: Brad Westfall
Date: Thu, 30 May 2019 11:58:41 -0700
Subject: [PATCH 02/48] lesson branch cleanup
---
src/index.js | 21 ++++++++-------------
src/styles/ui/panels/recent-projects.scss | 1 +
src/ui/AuthorizedPrimaryHeader.js | 9 ++-------
src/utils/AuthorizedRoute.js | 13 -------------
4 files changed, 11 insertions(+), 33 deletions(-)
delete mode 100644 src/utils/AuthorizedRoute.js
diff --git a/src/index.js b/src/index.js
index 3589d09..0a5ceae 100644
--- a/src/index.js
+++ b/src/index.js
@@ -1,23 +1,18 @@
import React from 'react'
import ReactDOM from 'react-dom'
-import { Switch, Route, Redirect } from 'react-router-dom'
-import Router from './utils/Router'
-import { AuthUserProvider } from './utils/AuthUser'
-import AuthorizedRoute from './utils/AuthorizedRoute'
+import { BrowserRouter, Switch, Route, Redirect } from 'react-router-dom'
import UnauthorizedLayout from './layouts/UnauthorizedLayout'
import AuthorizedLayout from './layouts/AuthorizedLayout'
import './styles/main.scss'
const App = () => (
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
)
ReactDOM.render(, document.getElementById('root'))
diff --git a/src/styles/ui/panels/recent-projects.scss b/src/styles/ui/panels/recent-projects.scss
index 25f1206..1ec51ef 100644
--- a/src/styles/ui/panels/recent-projects.scss
+++ b/src/styles/ui/panels/recent-projects.scss
@@ -1,5 +1,6 @@
.panel.panel-recent-projects {
margin-top: -7em;
+ padding-bottom: 3em;
}
.card-recent-project {
diff --git a/src/ui/AuthorizedPrimaryHeader.js b/src/ui/AuthorizedPrimaryHeader.js
index c5f741f..305f2b9 100644
--- a/src/ui/AuthorizedPrimaryHeader.js
+++ b/src/ui/AuthorizedPrimaryHeader.js
@@ -1,11 +1,8 @@
-import React, { useContext } from 'react'
+import React from 'react'
import { Route, Link } from 'react-router-dom'
import classnames from 'classnames'
-import { AuthUserContext } from '../utils/AuthUser'
const AuthorizedPrimaryHeader = () => {
- const { logout } = useContext(AuthUserContext)
-
return (
{
)}
/>
diff --git a/src/utils/AuthorizedRoute.js b/src/utils/AuthorizedRoute.js
deleted file mode 100644
index 2c89f55..0000000
--- a/src/utils/AuthorizedRoute.js
+++ /dev/null
@@ -1,13 +0,0 @@
-import React, { useContext } from 'react'
-import { Route, Redirect } from 'react-router-dom'
-import { AuthUserContext } from './AuthUser'
-
-const AuthorizedRoute = ({ component, history, ...rest }) => {
- const { logged } = useContext(AuthUserContext)
-
- if (logged === null) return Loading...
- if (logged !== true) return
- return
-}
-
-export default AuthorizedRoute
From 100f345a3b74d2521516f04ceeddb6adef8cf327 Mon Sep 17 00:00:00 2001
From: Brad Westfall
Date: Thu, 30 May 2019 13:45:56 -0700
Subject: [PATCH 03/48] adding switch
---
src/index.js | 19 ++++++++++---------
src/wireframe/App.js | 13 +++++++++----
2 files changed, 19 insertions(+), 13 deletions(-)
diff --git a/src/index.js b/src/index.js
index 0a5ceae..3325893 100644
--- a/src/index.js
+++ b/src/index.js
@@ -4,15 +4,16 @@ import { BrowserRouter, Switch, Route, Redirect } from 'react-router-dom'
import UnauthorizedLayout from './layouts/UnauthorizedLayout'
import AuthorizedLayout from './layouts/AuthorizedLayout'
import './styles/main.scss'
+import App from './wireframe/App'
-const App = () => (
-
-
-
-
-
-
-
-)
+// const App = () => (
+//
+//
+//
+//
+//
+//
+//
+// )
ReactDOM.render(, document.getElementById('root'))
diff --git a/src/wireframe/App.js b/src/wireframe/App.js
index 11543d6..2c574e8 100644
--- a/src/wireframe/App.js
+++ b/src/wireframe/App.js
@@ -22,8 +22,10 @@ const AuthorizedLayout = () => (
Logout
-
-
+
+
+
+
@@ -46,8 +48,11 @@ const DashboardLayout = () => (
Search
-
-
+
+
+
+
+
From b100d0bc1a242354dbfaf8098fa8a7589a7e0baa Mon Sep 17 00:00:00 2001
From: Brad Westfall
Date: Thu, 30 May 2019 13:56:47 -0700
Subject: [PATCH 04/48] removing login stuff
---
src/auth/Login.js | 28 ++------
src/index.js | 19 +++--
src/wireframe/App.js | 88 -----------------------
src/wireframe/wireframes.scss | 128 ----------------------------------
4 files changed, 14 insertions(+), 249 deletions(-)
delete mode 100644 src/wireframe/App.js
delete mode 100644 src/wireframe/wireframes.scss
diff --git a/src/auth/Login.js b/src/auth/Login.js
index 91dd083..a87fe19 100644
--- a/src/auth/Login.js
+++ b/src/auth/Login.js
@@ -1,25 +1,8 @@
-import React, { useState, useContext } from 'react'
+import React from 'react'
import Panel from '../ui/Panel'
import Card from '../ui/Card'
-import { AuthUserContext } from '../utils/AuthUser'
-
-const Login = ({ history }) => {
- const { login } = useContext(AuthUserContext)
- const [username, setUsername] = useState('')
- const [password, setPassword] = useState('')
- const [errorMessage, setErrorMessage] = useState()
-
- function handleSubmit(e) {
- e.preventDefault()
-
- if (username === 'react' && password === 'react') {
- login()
- history.push('/projects')
- } else {
- setErrorMessage('Invalid')
- }
- }
+const Login = () => {
return (
@@ -31,10 +14,9 @@ const Login = ({ history }) => {
The username is react and the password is react
- {errorMessage && {errorMessage}
}
-
diff --git a/src/ui/ProjectSidebar.js b/src/ui/ProjectSidebar.js
index 02785ec..85b84e5 100644
--- a/src/ui/ProjectSidebar.js
+++ b/src/ui/ProjectSidebar.js
@@ -4,19 +4,19 @@ import { Link, withRouter } from 'react-router-dom'
const ProjectSidebar = ({ match }) => (
- Recent projects
-
-
- history.push('')}>
-
- Add Project
-
-
- {Array.isArray(projects) &&
- projects.map(project => (
- history.push(`/projects/${project.id}`)}>
-
- {project.name}
- {project.id}
-
+
+
{
+ return (
+
+ Recent projects
+
+
+
+
+ Add Project
+
+
+ {Array.isArray(projects) &&
+ projects.map(project => (
+ history.push(`/projects/${project.id}`)}>
+
+ {project.name}
+ {project.id}
+
+
+ ))}
+
- ))}
-
-
+
+ )
+ }}
+ />
)
diff --git a/src/layouts/AuthorizedLayout.js b/src/layouts/AuthorizedLayout.js
index 16e32ea..9b7faf2 100644
--- a/src/layouts/AuthorizedLayout.js
+++ b/src/layouts/AuthorizedLayout.js
@@ -8,8 +8,9 @@ const AuthorizedLayout = ({ match }) => (
)
diff --git a/src/projects/AddProject.js b/src/projects/AddProject.js
new file mode 100644
index 0000000..058237b
--- /dev/null
+++ b/src/projects/AddProject.js
@@ -0,0 +1,25 @@
+import React, { useState } from 'react'
+import { Prompt } from 'react-router-dom'
+import Card from '../ui/Card'
+
+const AddProject = () => {
+ const [formIsDirty, setFormIsDirty] = useState(false)
+
+ function handleSubmit(e) {
+ e.preventDefault()
+ }
+
+ return (
+
+
+
+
+ )
+}
+
+export default AddProject
diff --git a/src/ui/AuthorizedPrimaryHeader.js b/src/ui/AuthorizedPrimaryHeader.js
index 1699124..03bb466 100644
--- a/src/ui/AuthorizedPrimaryHeader.js
+++ b/src/ui/AuthorizedPrimaryHeader.js
@@ -1,23 +1,18 @@
import React from 'react'
-import { Route, Link } from 'react-router-dom'
+import { Link, withRouter } from 'react-router-dom'
import classnames from 'classnames'
import { useAuthUser } from '../utils/AuthUser'
-const AuthorizedPrimaryHeader = () => {
+const AuthorizedPrimaryHeader = ({ location }) => {
const { setLogged } = useAuthUser()
+ const lightBackground = ['/projects', '/projects/add'].includes(location.pathname)
return (
- (
-
-
- Firebase
-
- )}
- />
+
+
+ Firebase
+