-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from kawtarzz/styling
Styling
- Loading branch information
Showing
18 changed files
with
413 additions
and
245 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,36 @@ | ||
import { Authorized } from "./components/views/Authorized.js" | ||
import ApplicationViews from "./components/views/ApplicationViews.js" | ||
import AppNavBar from "./components/nav/NavBar.js" | ||
import { Login } from "./components/auth/Login.js" | ||
import { Register } from "./components/auth/Register.js" | ||
import { Route, Routes } from "react-router-dom" | ||
import './index.css' | ||
|
||
import { Outlet, Route, Routes } from "react-router-dom" | ||
import Home from "./components/Home" | ||
import { Login } from "./components/auth/Login" | ||
import { Register } from "./components/auth/Register" | ||
import TaskList from "./components/tasks/TaskList" | ||
import { useState, useEffect } from "react" | ||
import RewardsList from "./components/rewards/Rewards" | ||
import { Navbar } from "react-bootstrap" | ||
import Nav from './components/Navbar' | ||
import Header from "./components/ui/Header" | ||
import ApplicationViews from "./components/views/ApplicationViews" | ||
import { Authorized } from './components/views/Authorized' | ||
import { ButtonAction } from "./components/ui/ButtonAction" | ||
export const App = () => { | ||
return <> | ||
|
||
<Routes> | ||
<Route path="/login" element={<Login />} /> | ||
<Route path="/register" element={<Register />} /> | ||
|
||
<Route path="*" element={ | ||
<Authorized><> | ||
|
||
|
||
<AppNavBar /> | ||
|
||
return ( | ||
<> | ||
<Routes> | ||
<Route path="/login" element={<Login />} /> | ||
<Route path="/register" element={<Register />} /> | ||
<Route path="*" element={ | ||
<Authorized><> | ||
<Nav /> | ||
<Header /> | ||
<ApplicationViews /> | ||
|
||
</> | ||
</Authorized>} /> | ||
</Routes> | ||
</> | ||
) | ||
|
||
</> | ||
</Authorized>} /> | ||
</Routes> | ||
|
||
</> | ||
} | ||
|
||
export default App; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// import Header from './ui/Header'; | ||
// import React from 'react'; | ||
// import { ButtonAction } from './ui/ButtonAction'; | ||
// import { Outlet, Route, Routes } from "react-router-dom" | ||
// import Navbar from './Navbar' | ||
// import { Container, Nav } from 'react-bootstrap'; | ||
|
||
// const Home = () => { | ||
// return ( | ||
// <> | ||
// <Container> | ||
// <Header /> | ||
// <ButtonAction /> | ||
// <Outlet /> | ||
// </Container> | ||
// </> | ||
|
||
// ) | ||
// } | ||
|
||
// export default Home; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import React from 'react'; | ||
import 'bootstrap/dist/css/bootstrap.min.css'; | ||
import Container from 'react-bootstrap/Container'; | ||
import Nav from 'react-bootstrap/Nav'; | ||
import Navbar from 'react-bootstrap/Navbar'; | ||
import NavDropdown from 'react-bootstrap/NavDropdown'; | ||
import Icon from './img/logo-icon.svg' | ||
|
||
function nav() { | ||
const localcookiJarUser = localStorage.getItem("cookijar_user"); | ||
const cookijarUserObject = JSON.parse(localcookiJarUser) | ||
|
||
return ( | ||
<Navbar bg="primary" className="m-auto" data-bs-theme="dark" expand="lg"> | ||
<Navbar.Brand href="/home"> | ||
<img | ||
alt="" | ||
src={Icon} | ||
width="160" | ||
height="160" | ||
className="d-inline-block align-center" | ||
/>{' '} CookiJar | ||
</Navbar.Brand> | ||
<Navbar.Toggle aria-controls="basic-navbar-nav" /> | ||
<Navbar.Collapse id="basic-navbar-nav"> | ||
<Nav className="me-auto"> | ||
<Nav.Link href="/tasks">To-do</Nav.Link> | ||
<Nav.Link href="/tasks/new"> + New Task </Nav.Link> | ||
<NavDropdown title={`${cookijarUserObject.name}'s Jar`} id="basic-nav-dropdown"> | ||
<NavDropdown.Item href="/createreward"> | ||
+ New Reward | ||
</NavDropdown.Item> | ||
<NavDropdown.Item href="/rewards"> | ||
Cash-In | ||
</NavDropdown.Item> | ||
<NavDropdown.Item href="/rewards"> | ||
Rewards List | ||
</NavDropdown.Item> | ||
<NavDropdown.Divider /> | ||
<NavDropdown.Item href={`/users/${cookijarUserObject.id}`}> | ||
My Account | ||
</NavDropdown.Item> | ||
</NavDropdown> | ||
<Nav.Link href="/logout" onClick={() => { | ||
localStorage.removeItem("cookijar_user") | ||
}}> | ||
Logout | ||
</Nav.Link> | ||
</Nav> | ||
</Navbar.Collapse> | ||
</Navbar> | ||
); | ||
} | ||
|
||
export default nav; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { Link, useNavigate } from "react-router-dom" | ||
import { Button } from "react-bootstrap" | ||
import { Navbar } from "react-bootstrap" | ||
import { Container } from "react-bootstrap" | ||
import logo from "./logo.svg" | ||
import { Nav } from "react-bootstrap" | ||
|
||
|
||
export default function CookiNav() { | ||
const navigate = useNavigate() | ||
return ( | ||
<> <Nav className="bg-body-tertiary"> | ||
<Container> | ||
<Nav.Link href="/"> | ||
<img | ||
alt="logo" | ||
src={logo} | ||
width="200" | ||
height="200" | ||
|
||
/>{' '} | ||
|
||
</Nav.Link> | ||
<Nav.Link to="/tasks" onClick={() => { navigate("/tasks") }}>Tasks</Nav.Link>{' '} | ||
<Nav.Link to="/create" onClick={() => { navigate("/create"); }}> Add Task</Nav.Link> | ||
<Nav.Link to="/login" className="logout" onClick={() => { | ||
localStorage.removeItem("cookijar_user") | ||
navigate("/", { replace: true }) | ||
}}>Logout</Nav.Link >{' '} | ||
</Container> | ||
|
||
</Nav> | ||
</> | ||
|
||
) | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.