-
Notifications
You must be signed in to change notification settings - Fork 1
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 #17 from ubccsss/shiyu_branch
Navbar
- Loading branch information
Showing
10 changed files
with
244 additions
and
25 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
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,6 +1,6 @@ | ||
export default { | ||
plugins: { | ||
tailwindcss: {}, | ||
autoprefixer: {}, | ||
autoprefixer: {} | ||
}, | ||
} |
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,114 @@ | ||
import './index.css' | ||
function App() { | ||
|
||
import { BrowserRouter as Router, Routes, Route } from "react-router-dom"; | ||
import "./index.css"; | ||
import Navbar from "./components/Navbar"; | ||
import ShoppingList from "./components/ShoppingList"; | ||
const App = () => { | ||
return ( | ||
<> | ||
</> | ||
) | ||
} | ||
<Router> | ||
<Routes> | ||
<Route path="/" element={<ShoppingList />} /> | ||
<Route | ||
path="/store" | ||
element={ | ||
<Navbar | ||
title="Login" | ||
needbuttons={true} | ||
isofficerpage={false} | ||
needtitle={true} | ||
/> | ||
} | ||
/> | ||
<Route | ||
path="/officer" | ||
element={ | ||
<Navbar | ||
title="Login" | ||
needbuttons={false} | ||
isofficerpage={true} | ||
needtitle={true} | ||
/> | ||
} | ||
/> | ||
<Route | ||
path="/officer/mainmenu" | ||
element={ | ||
<Navbar | ||
title="Login" | ||
needbuttons={true} | ||
isofficerpage={true} | ||
needtitle={true} | ||
/> | ||
} | ||
/> | ||
<Route | ||
path="/officer/itemdetail/:id" | ||
element={ | ||
<Navbar | ||
title="Login" | ||
needbuttons={true} | ||
isofficerpage={true} | ||
needtitle={true} | ||
/> | ||
} | ||
/> | ||
<Route | ||
path="/officer/reimburse" | ||
element={ | ||
<Navbar | ||
title="Login" | ||
needbuttons={true} | ||
isofficerpage={true} | ||
needtitle={true} | ||
/> | ||
} | ||
/> | ||
<Route | ||
path="/officer/inventory" | ||
element={ | ||
<Navbar | ||
title="Login" | ||
needbuttons={true} | ||
isofficerpage={true} | ||
needtitle={true} | ||
/> | ||
} | ||
/> | ||
<Route | ||
path="/officer/shoppinglist" | ||
element={ | ||
<Navbar | ||
title="Login" | ||
needbuttons={true} | ||
isofficerpage={true} | ||
needtitle={true} | ||
/> | ||
} | ||
/> | ||
<Route | ||
path="/officer/additem" | ||
element={ | ||
<Navbar | ||
title="Login" | ||
needbuttons={true} | ||
isofficerpage={true} | ||
needtitle={true} | ||
/> | ||
} | ||
/> | ||
<Route | ||
path="/officer/transaction" | ||
element={ | ||
<Navbar | ||
title="Login" | ||
needbuttons={true} | ||
isofficerpage={true} | ||
needtitle={true} | ||
/> | ||
} | ||
/> | ||
</Routes> | ||
</Router> | ||
); | ||
}; | ||
|
||
export default App | ||
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,45 @@ | ||
import "../index.css"; | ||
import { Link } from "react-router-dom"; | ||
interface NavbarProps { | ||
title: string; | ||
needbuttons: boolean; | ||
isofficerpage: boolean; | ||
needtitle: boolean; | ||
} | ||
|
||
const Navbar = ({ | ||
title, | ||
needbuttons, | ||
isofficerpage, | ||
needtitle, | ||
}: NavbarProps) => { | ||
return ( | ||
<div className={isofficerpage ? "darkmode" : "lightmode"}> | ||
{needbuttons && ( | ||
<div className="flex justify-end right-4 p-4 text-black-700"> | ||
<Link to="/officer/mainmenu" className="btn-o mr-4"> | ||
Back to Main | ||
</Link> | ||
|
||
<Link to="/officer" className="btn-o"> | ||
Logout | ||
</Link> | ||
</div> | ||
)} | ||
{needtitle && ( | ||
<div className="relative top-15 text-center text-6xl "> | ||
{title} | ||
<hr | ||
className={ | ||
isofficerpage | ||
? "h-px my-6 bg-white border-1 w-4/5 mx-auto" | ||
: "h-px my-6 bg-black border-1 w-4/5 mx-auto" | ||
} | ||
/> | ||
</div> | ||
)} | ||
</div> | ||
); | ||
}; | ||
|
||
export default Navbar; |
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,17 @@ | ||
import "../index.css"; | ||
import Navbar from "./Navbar"; | ||
const ShoppingList = () => { | ||
return ( | ||
<div className="lightmode min-h-screen"> | ||
<Navbar | ||
title="Shopping List" | ||
needbuttons={true} | ||
isofficerpage={false} | ||
needtitle={true} | ||
/> | ||
<div className="text-white">hello!!</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default ShoppingList; |
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,3 +1,19 @@ | ||
@tailwind base; | ||
@tailwind components; | ||
@tailwind utilities; | ||
@tailwind utilities; | ||
|
||
.btn-o { | ||
@apply w-40 h-10 bg-[#D9C4E3] rounded-[5px] text-xl text-black flex items-center justify-center; | ||
} | ||
|
||
.btn-c { | ||
@apply w-40 h-10 bg-[#4991BA] rounded-[5px] text-xl text-white flex items-center justify-center; | ||
} | ||
|
||
.darkmode { | ||
@apply bg-zinc-800 text-white; | ||
} | ||
|
||
.lightmode { | ||
@apply bg-white text-black; | ||
} |
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,10 @@ | ||
import React from 'react' | ||
import ReactDOM from 'react-dom/client' | ||
import App from './App.tsx' | ||
import './index.css' | ||
import React from "react"; | ||
import ReactDOM from "react-dom/client"; | ||
import App from "./App.tsx"; | ||
import "./index.css"; | ||
|
||
ReactDOM.createRoot(document.getElementById('root')!).render( | ||
ReactDOM.createRoot(document.getElementById("root")!).render( | ||
<React.StrictMode> | ||
<App /> | ||
</React.StrictMode>, | ||
) | ||
</React.StrictMode> | ||
); |
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,12 +1,8 @@ | ||
/** @type {import('tailwindcss').Config} */ | ||
export default { | ||
content: [ | ||
"./index.html", | ||
"./src/**/*.{js,ts,jsx,tsx}", | ||
], | ||
content: ["./index.html", "./src/**/*.{js,ts,jsx,tsx}"], | ||
theme: { | ||
extend: {}, | ||
}, | ||
plugins: [], | ||
} | ||
|
||
}; |