-
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 #20 from AmielCyber/update
Added Mobile Bottom Navigation
- Loading branch information
Showing
23 changed files
with
216 additions
and
93 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,15 +1,16 @@ | ||
import NavBar from "./layout/NavBar.tsx"; | ||
import {Outlet} from "react-router-dom"; | ||
import TopNavBar from "./layout/TopNavBar.tsx"; | ||
import BottomNavBar from "./layout/BottomNavBar.tsx"; | ||
|
||
function App() { | ||
return ( | ||
<> | ||
<TopNavBar/> | ||
<Outlet/> | ||
<BottomNavBar isAuthenticated={false}/> | ||
</> | ||
|
||
return ( | ||
<> | ||
<NavBar /> | ||
<Outlet /> | ||
</> | ||
|
||
); | ||
); | ||
} | ||
|
||
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,9 @@ | ||
// Icon by https://heroicons.com | ||
function AccountIcon(){ | ||
return ( | ||
<svg xmlns="http://www.w3.org/2000/svg" fill="hsl(var(--p))" viewBox="0 0 24 24" stroke="hsl(var(--p))" strokeWidth={1.5} className="w-6 h-6"> | ||
<path strokeLinecap="round" strokeLinejoin="round" d="M15.75 6a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0zM4.501 20.118a7.5 7.5 0 0114.998 0A17.933 17.933 0 0112 21.75c-2.676 0-5.216-.584-7.499-1.632z" /> | ||
</svg> | ||
) | ||
} | ||
export default AccountIcon; |
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// Icon by https://heroicons.com | ||
function HomeIcon(){ | ||
return ( | ||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" strokeWidth={1.5} stroke="hsl(var(--p))" className="w-5 h-5"> | ||
<path strokeLinecap="round" strokeLinejoin="round" d="M13.5 21v-7.5a.75.75 0 01.75-.75h3a.75.75 0 01.75.75V21m-4.5 0H2.36m11.14 0H18m0 0h3.64m-1.39 0V9.349m-16.5 11.65V9.35m0 0a3.001 3.001 0 003.75-.615A2.993 2.993 0 009.75 9.75c.896 0 1.7-.393 2.25-1.016a2.993 2.993 0 002.25 1.016c.896 0 1.7-.393 2.25-1.016a3.001 3.001 0 003.75.614m-16.5 0a3.004 3.004 0 01-.621-4.72L4.318 3.44A1.5 1.5 0 015.378 3h13.243a1.5 1.5 0 011.06.44l1.19 1.189a3 3 0 01-.621 4.72m-13.5 8.65h3.75a.75.75 0 00.75-.75V13.5a.75.75 0 00-.75-.75H6.75a.75.75 0 00-.75.75v3.75c0 .415.336.75.75.75z" /> | ||
</svg> | ||
); | ||
} | ||
export default HomeIcon; |
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,14 @@ | ||
function SignInIcon(){ | ||
return( | ||
<svg | ||
xmlns="http://www.w3.org/2000/svg" | ||
viewBox="0 0 24 24" | ||
strokeWidth={1.5} | ||
stroke="hsl(var(--p))" | ||
className="w-6 h-6" | ||
fill="none"> | ||
<path strokeLinecap="round" strokeLinejoin="round" d="M15.75 9V5.25A2.25 2.25 0 0013.5 3h-6a2.25 2.25 0 00-2.25 2.25v13.5A2.25 2.25 0 007.5 21h6a2.25 2.25 0 002.25-2.25V15M12 9l-3 3m0 0l3 3m-3-3h12.75" /> | ||
</svg> | ||
) | ||
} | ||
export default SignInIcon; |
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,9 @@ | ||
// Icon by https://heroicons.com | ||
function SignOutIcon(){ | ||
return( | ||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" strokeWidth={1.5} stroke="hsl(var(--p))" className="w-6 h-6"> | ||
<path strokeLinecap="round" strokeLinejoin="round" d="M15.75 9V5.25A2.25 2.25 0 0013.5 3h-6a2.25 2.25 0 00-2.25 2.25v13.5A2.25 2.25 0 007.5 21h6a2.25 2.25 0 002.25-2.25V15m3 0l3-3m0 0l-3-3m3 3H9" /> | ||
</svg> | ||
) | ||
} | ||
export default SignOutIcon; |
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,10 @@ | ||
// Icon by https://heroicons.com | ||
function SignUpIcon(){ | ||
return ( | ||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" strokeWidth={1.5} stroke="hsl(var(--p))" className="w-6 h-6"> | ||
<path strokeLinecap="round" strokeLinejoin="round" d="M19 7.5v3m0 0v3m0-3h3m-3 0h-3m-2.25-4.125a3.375 3.375 0 11-6.75 0 3.375 3.375 0 016.75 0zM4 19.235v-.11a6.375 6.375 0 0112.75 0v.109A12.318 12.318 0 0110.374 21c-2.331 0-4.512-.645-6.374-1.766z" /> | ||
</svg> | ||
) | ||
} | ||
|
||
export default SignUpIcon; |
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,9 @@ | ||
// Icon by https://heroicons.com | ||
function XMarkIcon(){ | ||
return ( | ||
<svg xmlns="http://www.w3.org/2000/svg" fill="hsl(var(--p))" viewBox="0 0 24 24" strokeWidth={1.5} stroke="currentColor" className="w-6 h-6"> | ||
<path strokeLinecap="round" strokeLinejoin="round" d="M6 18L18 6M6 6l12 12" /> | ||
</svg> | ||
); | ||
} | ||
export default XMarkIcon; |
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,20 @@ | ||
import AccountIcon from "../icons/AccountIcon.tsx"; | ||
import SignOutIcon from "../icons/SignOutIcon.tsx"; | ||
import BottomNavButton from "./BottomNavButton.tsx"; | ||
|
||
function BottomNavAuthLinks() { | ||
return ( | ||
<> | ||
<BottomNavButton route="/account"> | ||
<AccountIcon/> | ||
<span className="btm-nav-label">Account</span> | ||
</BottomNavButton> | ||
<BottomNavButton route="/account/signout"> | ||
<SignOutIcon/> | ||
<span className="btm-nav-label">Sign Out</span> | ||
</BottomNavButton> | ||
</> | ||
); | ||
} | ||
|
||
export default BottomNavAuthLinks; |
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,32 @@ | ||
import CartButton from "../cart/CartButton.tsx"; | ||
import CoffeeIcon from "../icons/CoffeeIcon.tsx"; | ||
import HomeIcon from "../icons/HomeIcon.tsx"; | ||
import BottomNavGuestLinks from "./BottomNavGuestLinks.tsx"; | ||
import BottomNavAuthLinks from "./BottomNavAuthLinks.tsx"; | ||
import BottomNavButton from "./BottomNavButton.tsx"; | ||
|
||
type Props = { | ||
isAuthenticated: boolean; | ||
} | ||
|
||
function BottomNavBar(props: Props) { | ||
return ( | ||
<div className="btm-nav md:hidden"> | ||
<BottomNavButton route="/"> | ||
<HomeIcon/> | ||
<span className="btm-nav-label">Home</span> | ||
</BottomNavButton> | ||
<BottomNavButton route="menu"> | ||
<CoffeeIcon isTopIcon={false}/> | ||
<span className="btm-nav-label">Order</span> | ||
</BottomNavButton> | ||
{props.isAuthenticated ? <BottomNavAuthLinks/> : <BottomNavGuestLinks/>} | ||
<BottomNavButton> | ||
<CartButton/> | ||
</BottomNavButton> | ||
</div> | ||
); | ||
} | ||
|
||
export default BottomNavBar; | ||
|
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,28 @@ | ||
import {ReactNode} from "react"; | ||
import {NavLink} from "react-router-dom"; | ||
|
||
const buttonNavClasses = "active:border-primary hover:border-primary active:ring-primary active:ring-2"; | ||
const activeNavClasses = "active text-secondary " + buttonNavClasses; | ||
|
||
type Props = { | ||
children: ReactNode; | ||
route?: string; | ||
} | ||
|
||
function BottomNavButton(props: Props) { | ||
if (props.route) { | ||
return ( | ||
<NavLink to={props.route} className={({isActive}) => isActive ? activeNavClasses : buttonNavClasses}> | ||
{props.children} | ||
</NavLink> | ||
); | ||
} else { | ||
return ( | ||
<button className={buttonNavClasses}> | ||
{props.children} | ||
</button> | ||
); | ||
} | ||
} | ||
|
||
export default BottomNavButton; |
20 changes: 20 additions & 0 deletions
20
ReactRoastDotnet.Client/src/layout/BottomNavGuestLinks.tsx
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,20 @@ | ||
import SignUpIcon from "../icons/SignUpIcon.tsx"; | ||
import SignInIcon from "../icons/SignInIcon.tsx"; | ||
import BottomNavButton from "./BottomNavButton.tsx"; | ||
|
||
function BottomNavGuestLinks() { | ||
return ( | ||
<> | ||
<BottomNavButton route="account/create"> | ||
<SignUpIcon/> | ||
<span className="btm-nav-label">Sign Up</span> | ||
</BottomNavButton> | ||
<BottomNavButton route="account/signin"> | ||
<SignInIcon/> | ||
<span className="btm-nav-label">Sign In</span> | ||
</BottomNavButton> | ||
</> | ||
) | ||
} | ||
|
||
export default BottomNavGuestLinks; |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -27,4 +27,4 @@ function NavigationLinks() { | |
); | ||
} | ||
|
||
export default NavigationLinks; | ||
export default NavigationLinks; |
This file was deleted.
Oops, something went wrong.
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,10 +1,11 @@ | ||
type Props = { | ||
pageName: string; | ||
} | ||
function LoadingPage(props: Props){ | ||
|
||
function LoadingPage(props: Props) { | ||
return ( | ||
<h1>Loading {props.pageName} page...</h1> | ||
); | ||
} | ||
|
||
export default LoadingPage; | ||
export default LoadingPage; |
Oops, something went wrong.