Skip to content

Commit

Permalink
Adds zero-state UI for My Rentals
Browse files Browse the repository at this point in the history
  • Loading branch information
aryanbhasin committed Apr 29, 2022
1 parent 6bfc4c2 commit f4d6d3e
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 0 deletions.
2 changes: 2 additions & 0 deletions frontend/src/client/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import WalletProvider from "./components/WalletProvider";
import Main from "./pages/Main";
import Create from "./pages/Create";
import Find from "./pages/Find";
import Rentals from "./pages/Rentals";
import About from "./pages/About";
import { ContextWrapper } from "./Context";

Expand All @@ -19,6 +20,7 @@ export const App = () => {
<Route path="/" element={<Main />} />
<Route path="/create" element={<Create />} />
<Route path="/find" element={<Find />} />
<Route path="/rentals" element={<Rentals /> } />
<Route path="/about" element={<About />} />
</Routes>
</WalletProvider>
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/client/components/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ export const Navbar = () => {
<div className="text-white hover:text-indigo-100 font-bold py-2 px-4">
<Link to="/find">Find</Link>
</div>
<div className="text-white hover:text-indigo-100 font-bold py-2 px-4">
<Link to="/rentals">My Rentals</Link>
</div>
<div className="text-white hover:text-indigo-100 font-bold py-2 pl-4 pr-10">
<Link to="/about">About</Link>
</div>
Expand Down
45 changes: 45 additions & 0 deletions frontend/src/client/pages/Rentals.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import React from "react";
import { Link } from "react-router-dom";
import { Navbar } from "../components/Navbar";
import { Footer } from "../components/Footer";

const Rentals = () => {
return (
<div className="flex bg-white-100 flex-col justify-start h-screen">
<Navbar />
<MyListingsView />
<MyRentalsView />
<div className="flex flex-col items-center">
<Footer />
</div>
</div>
);
}

const MyListingsView = () => {
return (
<div className="m-20 space-y-6">
<h1 className="text-4xl font-bold">My Listings</h1>
{/* TODO: Check if user has listed NFTs */}
<p>You haven't listed any NFTs!</p>
<div>
<Link to="/create" className="bg-indigo-800 hover:bg-indigo-700 text-white font-bold py-2 px-4 rounded">List a Rental</Link>
</div>
</div>
);
}

const MyRentalsView = () => {
return (
<div className="m-20 space-y-6">
<h1 className="text-4xl font-bold">My Rentals</h1>
{/* TODO: Check if user has rented NFTs */}
<p>You haven't rented any NFTs!</p>
<div>
<Link to="/find" className="bg-indigo-800 hover:bg-indigo-700 text-white font-bold py-2 px-4 rounded">Explore Current Rentals!</Link>
</div>
</div>
);
}

export default Rentals;

0 comments on commit f4d6d3e

Please sign in to comment.