mirror of
https://github.com/rjNemo/meal_planner
synced 2026-06-12 13:26:45 +00:00
navbar done
This commit is contained in:
parent
b9ad1db190
commit
abd510457c
5 changed files with 45 additions and 36 deletions
|
|
@ -54,7 +54,7 @@ Free meal planner for cooks short on ideas! (like me …)
|
||||||
- Notation system: know what are the most loved meals
|
- Notation system: know what are the most loved meals
|
||||||
- Share recipe with your friends and family
|
- Share recipe with your friends and family
|
||||||
- Suggestions based on what your personal taste
|
- Suggestions based on what your personal taste
|
||||||
- Recipes in Video
|
- Recipes in Video ✓
|
||||||
- Get a full menu (Starter, Main, Dessert + Cocktail)
|
- Get a full menu (Starter, Main, Dessert + Cocktail)
|
||||||
- Send a daily suggestion to newsletter
|
- Send a daily suggestion to newsletter
|
||||||
- History
|
- History
|
||||||
|
|
@ -95,7 +95,6 @@ Free meal planner for cooks short on ideas! (like me …)
|
||||||
|
|
||||||
## TO DO
|
## TO DO
|
||||||
|
|
||||||
1. add sidenav on mobile
|
|
||||||
1. send message after contact form validation (confirm to sender and msg+info to admin)
|
1. send message after contact form validation (confirm to sender and msg+info to admin)
|
||||||
1. Design & Breadcrumb
|
1. Design & Breadcrumb
|
||||||
1. Cookie bar
|
1. Cookie bar
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
import { Link } from "react-router-dom";
|
||||||
import { useAuth0 } from "../utils/auth0-spa";
|
import { useAuth0 } from "../utils/auth0-spa";
|
||||||
import { Logo } from "./Logo";
|
import { Logo } from "./Logo";
|
||||||
import { RandomButton } from "./RandomButton";
|
import { RandomButton } from "./RandomButton";
|
||||||
|
|
@ -20,7 +21,7 @@ export const Navbar = props => {
|
||||||
{links.map((link, i) => (
|
{links.map((link, i) => (
|
||||||
<FooterLink key={i} link={link} />
|
<FooterLink key={i} link={link} />
|
||||||
))}
|
))}
|
||||||
<li>{isAuthenticated && <FooterLink link="profile" />}</li>
|
{isAuthenticated && <FooterLink link="profile" />}
|
||||||
<li>
|
<li>
|
||||||
<RandomButton
|
<RandomButton
|
||||||
handleClick={props.handleClick}
|
handleClick={props.handleClick}
|
||||||
|
|
@ -30,15 +31,14 @@ export const Navbar = props => {
|
||||||
</li>
|
</li>
|
||||||
<li>{!isAuthenticated ? <LogInButton /> : <LogOutButton />}</li>
|
<li>{!isAuthenticated ? <LogInButton /> : <LogOutButton />}</li>
|
||||||
</ul>
|
</ul>
|
||||||
<a
|
<Link
|
||||||
href="#"
|
to="#"
|
||||||
data-target="slide-out"
|
data-target="slide-out"
|
||||||
class="sidenav-trigger "
|
className="sidenav-trigger "
|
||||||
onClick={openNavClick}
|
onClick={openNavClick}
|
||||||
// onclick="openNav()"
|
|
||||||
>
|
>
|
||||||
<i class="material-icons">menu</i>
|
<i className="material-icons">menu</i>
|
||||||
</a>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import React, { useState } from "react";
|
import React from "react";
|
||||||
|
import { Link } from "react-router-dom";
|
||||||
import { useAuth0 } from "../utils/auth0-spa";
|
import { useAuth0 } from "../utils/auth0-spa";
|
||||||
// import { Logo } from "./Logo";
|
|
||||||
import { RandomButton } from "./RandomButton";
|
import { RandomButton } from "./RandomButton";
|
||||||
import { FooterLink } from "./FooterLink";
|
import { FooterLink } from "./FooterLink";
|
||||||
import { LogInButton } from "./LogInButton";
|
import { LogInButton } from "./LogInButton";
|
||||||
|
|
@ -8,7 +8,7 @@ import { LogOutButton } from "./LogOutButton";
|
||||||
|
|
||||||
export const SideNav = props => {
|
export const SideNav = props => {
|
||||||
const { showNav, closeNavClick, links } = props;
|
const { showNav, closeNavClick, links } = props;
|
||||||
const { isAuthenticated } = useAuth0();
|
const { isAuthenticated, user } = useAuth0();
|
||||||
let transformStyle = {
|
let transformStyle = {
|
||||||
transform: showNav ? "translateX(0%)" : "translateX(-105%)",
|
transform: showNav ? "translateX(0%)" : "translateX(-105%)",
|
||||||
transition: "0.5s"
|
transition: "0.5s"
|
||||||
|
|
@ -18,18 +18,14 @@ export const SideNav = props => {
|
||||||
<>
|
<>
|
||||||
<ul id="slide-out" className="sidenav" style={transformStyle}>
|
<ul id="slide-out" className="sidenav" style={transformStyle}>
|
||||||
<li>
|
<li>
|
||||||
<a>
|
<div className="user-view" style={{ height: "30vh" }}>
|
||||||
<i className="material-icons" onClick={closeNavClick}>
|
|
||||||
close
|
|
||||||
</i>
|
|
||||||
</a>
|
|
||||||
<div className="user-view">
|
|
||||||
<div className="background">
|
<div className="background">
|
||||||
<img
|
<img
|
||||||
// className="responsive-img"
|
// className="responsive-img"
|
||||||
style={{
|
style={{
|
||||||
position: "fixed" /* Sit on top of the page content */,
|
position: "fixed" /* Sit on top of the page content */,
|
||||||
width: "100%" /* Full width (cover the whole page) */,
|
width: "100%" /* Full width (cover the whole page) */,
|
||||||
|
height: "30vh" /* Full width (cover the whole page) */,
|
||||||
top: "0",
|
top: "0",
|
||||||
left: "0",
|
left: "0",
|
||||||
right: "0",
|
right: "0",
|
||||||
|
|
@ -44,45 +40,54 @@ export const SideNav = props => {
|
||||||
alt="sidenav_background"
|
alt="sidenav_background"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<a href="#user">
|
|
||||||
|
<i className="material-icons right" onClick={closeNavClick}>
|
||||||
|
close
|
||||||
|
</i>
|
||||||
|
|
||||||
|
{isAuthenticated ? (
|
||||||
|
<Link to="/profile">
|
||||||
|
<img className="circle" src={user.picture} alt="user_avatar" />
|
||||||
|
<span className="white-text name">{user.name}</span>
|
||||||
|
<span className="white-text email">{user.email}</span>
|
||||||
|
</Link>
|
||||||
|
) : (
|
||||||
|
// <Link to="/profile">
|
||||||
<img
|
<img
|
||||||
className="circle"
|
className="circle"
|
||||||
src={require("../images/chef.svg")}
|
src={require("../images/chef.svg")}
|
||||||
alt="user_avatar"
|
alt="user_avatar"
|
||||||
/>
|
/>
|
||||||
</a>
|
// </Link>
|
||||||
<a href="#name">
|
)}
|
||||||
<span className="white-text name">John Doe</span>
|
|
||||||
</a>
|
|
||||||
<a href="#email">
|
|
||||||
<span className="white-text email">jdandturk@gmail.com</span>
|
|
||||||
</a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li>
|
<li>
|
||||||
<a>
|
<RandomButton
|
||||||
<RandomButton
|
handleClick={props.handleClick}
|
||||||
handleClick={props.handleClick}
|
url={props.buttonUrl}
|
||||||
url={props.buttonUrl}
|
size="small"
|
||||||
size="small"
|
/>
|
||||||
/>
|
|
||||||
</a>
|
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a>{!isAuthenticated ? <LogInButton /> : <LogOutButton />}</a>
|
<Link to="#">
|
||||||
|
{!isAuthenticated ? <LogInButton /> : <LogOutButton />}
|
||||||
|
</Link>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li>
|
<li>
|
||||||
<div className="divider"></div>
|
<div className="divider"></div>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a className="subheader">Navigation</a>
|
<Link to="#" className="subheader">
|
||||||
|
Navigation
|
||||||
|
</Link>
|
||||||
</li>
|
</li>
|
||||||
{links.map((link, i) => (
|
{links.map((link, i) => (
|
||||||
<FooterLink key={i} link={link} />
|
<FooterLink key={i} link={link} />
|
||||||
))}
|
))}
|
||||||
<li>{isAuthenticated && <FooterLink link="profile" />}</li>
|
{isAuthenticated && <FooterLink link="profile" />}
|
||||||
</ul>
|
</ul>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -115,6 +115,7 @@ export const App = () => {
|
||||||
ev.preventDefault();
|
ev.preventDefault();
|
||||||
setShowNav(true);
|
setShowNav(true);
|
||||||
document.addEventListener("keydown", handleEscKey);
|
document.addEventListener("keydown", handleEscKey);
|
||||||
|
// document.addEventListener("click", handleOutsideClick);
|
||||||
};
|
};
|
||||||
const closeNavClick = ev => {
|
const closeNavClick = ev => {
|
||||||
ev.preventDefault();
|
ev.preventDefault();
|
||||||
|
|
@ -126,6 +127,9 @@ export const App = () => {
|
||||||
setShowNav(false);
|
setShowNav(false);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
// const handleOutsideClick = ev => {
|
||||||
|
// console.log(ev);
|
||||||
|
// };
|
||||||
|
|
||||||
const links = ["categories", "contact"];
|
const links = ["categories", "contact"];
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,7 @@ export const Profile = () => {
|
||||||
<p>
|
<p>
|
||||||
<b>Email: </b>
|
<b>Email: </b>
|
||||||
{user.email}
|
{user.email}
|
||||||
|
{/* <a href={`mailto:${user.email}`}>{user.email}</a> */}
|
||||||
</p>
|
</p>
|
||||||
{/* <code>{JSON.stringify(user, null, 2)}</code> */}
|
{/* <code>{JSON.stringify(user, null, 2)}</code> */}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue