-
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.
- Loading branch information
1 parent
be27b56
commit 4b69537
Showing
1 changed file
with
82 additions
and
0 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,82 @@ | ||
import React from "react" | ||
import { | ||
BrowserRouter as Router, | ||
Routes, | ||
Route, | ||
Link, | ||
useParams, | ||
} from "react-router-dom" | ||
import DepositForm from "./components/DepositForm" | ||
import UserSelectAndNavigate from "./components/UserSelectAndNavigate" | ||
import BestClients from "./components/BestClients" | ||
import BestProfession from "./components/BestProfession" | ||
import Contracts from "./components/Contracts" | ||
import ContractDetails from "./components/ContractDetails" | ||
import UnpaidJobs from "./components/UnpaidJobs" | ||
import PayJob from "./components/PayJob" | ||
import { UserProvider } from './context/UserContext'; | ||
import ProfileIdInput from "./components/ProfileIdInput" | ||
|
||
const App: React.FC = () => { | ||
return ( | ||
<UserProvider> | ||
<Router> | ||
<div> | ||
<nav> | ||
<ul> | ||
<li> | ||
<Link to="/">Home</Link> | ||
</li> | ||
<li> | ||
<Link to="/best-clients">Best Clients</Link> | ||
</li> | ||
<li> | ||
<Link to="/best-profession">Best Profession</Link> | ||
</li> | ||
<li> | ||
<Link to="/contracts">View Contracts</Link> | ||
</li> | ||
<li> | ||
<Link to="/contract-details">Contract Details</Link> | ||
</li> | ||
<li> | ||
<Link to="/unpaid-jobs">Unpaid Jobs</Link> | ||
</li> | ||
<li> | ||
<Link to="/pay-job">Pay Job</Link> | ||
</li> | ||
<li> | ||
<UserSelectAndNavigate /> | ||
</li> | ||
<li> | ||
<ProfileIdInput /> | ||
</li> | ||
</ul> | ||
</nav> | ||
|
||
<Routes> | ||
<Route path="/deposit/:userId" element={<DepositFormWrapper />} /> | ||
<Route path="/" element={<Home />} /> | ||
<Route path="/best-clients" element={<BestClients />} /> | ||
<Route path="/best-profession" element={<BestProfession />} /> | ||
<Route path="/contract-details" element={<ContractDetails />} /> | ||
<Route path="/contracts" element={<Contracts />} /> | ||
<Route path="/unpaid-jobs" element={<UnpaidJobs />} /> | ||
<Route path="/pay-job" element={<PayJob />} /> | ||
</Routes> | ||
</div> | ||
</Router> | ||
</UserProvider> | ||
) | ||
} | ||
|
||
const Home: React.FC = () => { | ||
return <h2>What's the deel? 😃</h2> | ||
} | ||
|
||
const DepositFormWrapper: React.FC = () => { | ||
const { userId } = useParams<{ userId: string }>() | ||
return <DepositForm userId={parseInt(userId!, 10)} /> | ||
} | ||
|
||
export default App |