diff --git a/client/package-lock.json b/client/package-lock.json index f97cf03..8568aff 100644 --- a/client/package-lock.json +++ b/client/package-lock.json @@ -1,5 +1,5 @@ { - "name": "team-6", + "name": "TaskBlaster", "version": "0.1.0", "lockfileVersion": 1, "requires": true, diff --git a/client/package.json b/client/package.json index 6c07d9b..bd6b8c5 100644 --- a/client/package.json +++ b/client/package.json @@ -1,5 +1,5 @@ { - "name": "team-6", + "name": "TaskBlaster", "version": "0.1.0", "private": true, "dependencies": { @@ -10,7 +10,6 @@ "@testing-library/jest-dom": "^4.2.4", "@testing-library/react": "^9.5.0", "@testing-library/user-event": "^7.2.1", - "axios": "^0.19.2", "date-fns": "^2.12.0", "react": "^16.13.1", "react-dom": "^16.13.1", diff --git a/client/public/favicon.ico b/client/public/favicon.ico index bcd5dfd..0aa3627 100644 Binary files a/client/public/favicon.ico and b/client/public/favicon.ico differ diff --git a/client/public/logo192.png b/client/public/logo192.png index fc44b0a..b1f940d 100644 Binary files a/client/public/logo192.png and b/client/public/logo192.png differ diff --git a/client/public/logo512.png b/client/public/logo512.png index a4e47a6..f8a43ec 100644 Binary files a/client/public/logo512.png and b/client/public/logo512.png differ diff --git a/client/public/manifest.json b/client/public/manifest.json index 080d6c7..23fad9f 100644 --- a/client/public/manifest.json +++ b/client/public/manifest.json @@ -1,6 +1,6 @@ { - "short_name": "React App", - "name": "Create React App Sample", + "short_name": "TaskBlaster", + "name": "TaskBlaster Project Management Tool", "icons": [ { "src": "favicon.ico", diff --git a/client/src/api/TaskAPI.js b/client/src/api/TaskAPI.js index 6e136ab..ce55ba4 100644 --- a/client/src/api/TaskAPI.js +++ b/client/src/api/TaskAPI.js @@ -9,8 +9,11 @@ const HEADERS = { class TaskAPI { - async getAllTasks(removeTask) { - const responseJson = await (await fetch(`${API_URL}/tasks`)).json(); + async getAllTasks(removeTask) { + const response = await fetch(`${API_URL}/tasks`); + console.log(`GET: ${response.status}`); + const responseJson = await response.json(); + var taskComponents = []; for (let [key, taskData] of Object.entries(responseJson)) { taskComponents[key] = diff --git a/client/src/components/Appbar.js b/client/src/components/Appbar.js index 2d2ebff..e114593 100644 --- a/client/src/components/Appbar.js +++ b/client/src/components/Appbar.js @@ -15,6 +15,8 @@ import Grid from '@material-ui/core/Grid'; import { makeStyles, useTheme } from '@material-ui/core/styles'; import { MenuList, MenuItem } from '@material-ui/core'; import { Link } from 'react-router-dom'; +import * as logo from '../images/logo_no_bg.png'; +import { withRouter } from "react-router-dom" const drawerWidth = 240; @@ -60,14 +62,36 @@ const useStyles = makeStyles((theme) => ({ }, button: { color: "white", + }, + logo: { + height: "auto", + width: "auto", + maxHeight: "64px", + maxWidth: "250px", + paddingTop: "8px" } })); -export default function Appbar() { +function Appbar(props) { const classes = useStyles(); const theme = useTheme(); const [open, setOpen] = React.useState(false); + const changeTitle = () => { + switch(window.location.pathname) { + case '/': + return 'Home'; + case '/tasks': + return 'My Tasks'; + case '/login': + return 'Login'; + case '/signup': + return 'Sign Up'; + default: + return 'Home'; + } + } + const handleDrawerOpen = () => { setOpen(true); }; @@ -75,9 +99,8 @@ export default function Appbar() { const handleDrawerClose = () => { setOpen(false); }; - - // TODO: - // Return different appbars for unauthenticated and authenticated + + let title = changeTitle(); return (
@@ -101,9 +124,10 @@ export default function Appbar() { - - TaskBlaster - + logo + + + {title} {/* Pad out the middle of the appbar */} @@ -141,3 +165,4 @@ export default function Appbar() { ); } +export default withRouter(Appbar); diff --git a/client/src/components/Home.js b/client/src/components/Home.js index f5d3bba..4da2eb9 100644 --- a/client/src/components/Home.js +++ b/client/src/components/Home.js @@ -3,10 +3,11 @@ import logo from '../images/logo.svg'; import './Home.css'; export default function Home() { + document.title = "Home | TaskBlaster" + return (
logo - Home
) } diff --git a/client/src/components/Login.js b/client/src/components/Login.js index 096abe9..5e7472f 100644 --- a/client/src/components/Login.js +++ b/client/src/components/Login.js @@ -6,7 +6,7 @@ import Button from '@material-ui/core/Button'; import TextField from '@material-ui/core/TextField'; import FormControlLabel from '@material-ui/core/FormControlLabel'; import Checkbox from '@material-ui/core/Checkbox'; -import { CssBaseline, Container } from '@material-ui/core'; +import { CssBaseline } from '@material-ui/core'; const useStyles = makeStyles(theme => ({ content: { @@ -46,13 +46,13 @@ const changeHandler = () => { } function Login() { + document.title = "Login | TaskBlaster" + const classes = useStyles(); return ( - - Sign in - + {document.title.split("|")[0]}
{ } function SignUp() { + document.title = "Sign Up | TaskBlaster" + const classes = useStyles(); return ( - - Sign up - + {document.title.split("|")[0]} diff --git a/client/src/components/Tasks.js b/client/src/components/Tasks.js index b5b31fe..e9b2e84 100644 --- a/client/src/components/Tasks.js +++ b/client/src/components/Tasks.js @@ -45,7 +45,7 @@ class Tasks extends React.Component { showDialog: false } this.removeTask = this.removeTask.bind(this); - + document.title = "My Tasks | TaskBlaster"; } componentDidMount() { diff --git a/client/src/images/logo_no_bg.png b/client/src/images/logo_no_bg.png new file mode 100644 index 0000000..bee7925 Binary files /dev/null and b/client/src/images/logo_no_bg.png differ diff --git a/client/src/components/App.test.js b/client/src/test/App.test.js similarity index 87% rename from client/src/components/App.test.js rename to client/src/test/App.test.js index 6222103..52ddaa6 100644 --- a/client/src/components/App.test.js +++ b/client/src/test/App.test.js @@ -1,6 +1,6 @@ import React from 'react'; import { render } from '@testing-library/react'; -import App from './App'; +import App from '../components/App'; // test('renders learn react link', () => { // const { getByText } = render();