-
Notifications
You must be signed in to change notification settings - Fork 30
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
Showing
19 changed files
with
227 additions
and
23 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
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
Binary file not shown.
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,7 +1,9 @@ | ||
import { CreateTenantForm } from "@/ui/tenant/CreateTenantForm.tsx"; | ||
|
||
function App() { | ||
return <CreateTenantForm />; | ||
return ( | ||
<div className="App"> | ||
<h1>Account Management</h1> | ||
</div> | ||
); | ||
} | ||
|
||
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,18 @@ | ||
import { useRouteError } from "react-router-dom"; | ||
|
||
type ErrorObject = { statusText?: string; message?: string }; | ||
export default function ErrorPage() { | ||
const error = useRouteError() as ErrorObject; | ||
|
||
console.error(error); | ||
|
||
return ( | ||
<div className="flex flex-col justify-center items-center w-full"> | ||
<h1>Oops!</h1> | ||
<p>Sorry, an unexpected error has occurred.</p> | ||
<p> | ||
<i>{error.statusText || error.message}</i> | ||
</p> | ||
</div> | ||
); | ||
} |
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 @@ | ||
import React from "react"; | ||
import ReactDOM from "react-dom/client"; | ||
import App from "./App"; | ||
import { RouterProvider } from "react-router-dom"; | ||
import "./main.css"; | ||
import { router } from "./router"; | ||
|
||
ReactDOM.createRoot(document.getElementById("root")!).render( | ||
<React.StrictMode> | ||
<App /> | ||
<RouterProvider router={router} /> | ||
</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
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,27 @@ | ||
import { createBrowserRouter } from "react-router-dom"; | ||
import Root from "@/routes/root.tsx"; | ||
import ErrorPage from "@/error-page.tsx"; | ||
import { CreateTenantForm } from "./ui/tenant/CreateTenantForm"; | ||
import { CreatedTenantSuccess } from "./ui/tenant/CreatedTenantSuccess"; | ||
|
||
export const router = createBrowserRouter([ | ||
{ | ||
path: "/", | ||
element: <Root />, | ||
errorElement: <ErrorPage />, | ||
children: [ | ||
{ | ||
path: "/tenant/:id", | ||
element: <h1>Tenant</h1>, | ||
}, | ||
{ | ||
path: "/tenant/create", | ||
element: <CreateTenantForm />, | ||
}, | ||
{ | ||
path: "/tenant/create/success", | ||
element: <CreatedTenantSuccess />, | ||
}, | ||
], | ||
}, | ||
]); |
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,39 @@ | ||
import { Outlet, useNavigate } from "react-router-dom"; | ||
import AcmeLogo from "@/ui/acme-logo.svg"; | ||
import { Button } from "react-aria-components"; | ||
|
||
export default function Root() { | ||
const navigate = useNavigate(); | ||
|
||
function handleCreateTenant() { | ||
navigate("/tenant/create"); | ||
} | ||
|
||
return ( | ||
<div className="flex flex-row h-full w-full"> | ||
<div className="flex gap-2 flex-col h-full w-80 border-r border-border bg-gray-100 px-6"> | ||
<h1 className="flex gap-1 items-center order-1 border-t border-border px-4 py-8"> | ||
<AcmeLogo className="w-6 h-6" /> ACME Company | ||
</h1> | ||
<div className="justify-start flex flex-row border-b border-border py-4"> | ||
<Button className="bg-blue-600 text-white py-2 px-4 rounded-full" onPress={handleCreateTenant}> | ||
Create Tenant | ||
</Button> | ||
</div> | ||
<nav className="grow"> | ||
<ul> | ||
<li className="p-4 hover:bg-gray-200 rounded-xl cursor-pointer"> | ||
<a href={`/`}>Account Management</a> | ||
</li> | ||
<li className="p-4 hover:bg-gray-200 rounded-xl cursor-pointer"> | ||
<a href={`/user-management`}>User Management</a> | ||
</li> | ||
</ul> | ||
</nav> | ||
</div> | ||
<div className="flex flex-col w-full h-full bg-background"> | ||
<Outlet /> | ||
</div> | ||
</div> | ||
); | ||
} |
22 changes: 22 additions & 0 deletions
22
application/account-management/WebApp/src/ui/acme-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
37 changes: 37 additions & 0 deletions
37
application/account-management/WebApp/src/ui/tenant/CreatedTenantSuccess.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,37 @@ | ||
import { useEffect, useState } from "react"; | ||
import { Button } from "react-aria-components"; | ||
import Confetti, { type ConfettiConfig } from "react-dom-confetti"; | ||
|
||
const config: ConfettiConfig = { | ||
angle: 90, | ||
spread: 360, | ||
startVelocity: 28, | ||
elementCount: 170, | ||
dragFriction: 0.12, | ||
duration: 3000, | ||
stagger: 3, | ||
width: "10px", | ||
height: "10px", | ||
//perspective: "500px", | ||
colors: ["#a864fd", "#29cdff", "#78ff44", "#ff718d", "#fdff6a"], | ||
}; | ||
|
||
export function CreatedTenantSuccess() { | ||
const [confetti, setConfetti] = useState(false); | ||
|
||
useEffect(() => { | ||
setConfetti(true); | ||
}, []); | ||
|
||
return ( | ||
<div className="items-center flex flex-col justify-center h-full"> | ||
<div className="p-8 bg-gray-800 text-white rounded-xl shadow-md text-center gap-4 flex flex-col"> | ||
<h1 className="text-2xl">Success!</h1> | ||
<p>Your tenant has been created.</p> | ||
<div className="self-center absolute top-10"> | ||
<Confetti active={confetti} config={config} /> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
} |
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
Oops, something went wrong.