Compare commits

...

7 Commits

Author SHA1 Message Date
8ab2ddbe8e feat: responsiveness 2025-05-31 18:40:44 +02:00
7f9b719b2b feat: textarea border in light mode 2025-05-31 18:40:38 +02:00
2b7f4995ef feat: better border for table in light mode 2025-05-31 18:40:24 +02:00
321f4087e1 feat: delimiter color 2025-05-31 18:40:12 +02:00
9d19b470bc feat: register pages 2025-05-31 18:40:04 +02:00
68493be36e feat: redirect to not allowed page 2025-05-31 18:39:57 +02:00
f8772f8de2 feat: not allowed + not found pages 2025-05-31 18:39:49 +02:00
8 changed files with 34 additions and 10 deletions

View File

@ -13,6 +13,8 @@ import ApiServicesPage from "./pages/ApiServices";
import AdminLayout from "./layout/AdminLayout";
import ApiServiceCreatePage from "./pages/ApiServices/Create";
import ViewApiServicePage from "./pages/ApiServices/View";
import NotAllowedPage from "./pages/NotAllowed";
import NotFoundPage from "./pages/NotFound";
const router = createBrowserRouter([
{
@ -62,6 +64,14 @@ const router = createBrowserRouter([
{ path: "authenticate", element: <AuthenticatePage /> },
],
},
{
path: "/not-allowed",
element: <NotAllowedPage />,
},
{
path: "*",
element: <NotFoundPage />,
},
]);
const App: FC = () => {

View File

@ -25,7 +25,7 @@ const Breadcrumbs: FC<IBreadcrumbsProps> = ({ items, className }) => {
) : (
<p>{item.label}</p>
)}
{index + 1 < items.length && <p>/</p>}
{index + 1 < items.length && <p className="text-gray-500">/</p>}
</>
))}
</div>

View File

@ -33,7 +33,7 @@ const AdminLayout: FC = () => {
}
if (!profile?.isAdmin) {
return <Navigate to="/" />;
return <Navigate to="/not-allowed" />;
}
return <Outlet />;

View File

@ -90,7 +90,7 @@ const ApiServiceCreatePage: FC = () => {
{...register("description", {
required: "Description is required",
})}
className="dark:text-gray-100 border border-gray-600 dark:border-gray-700 rounded placeholder:text-gray-600 text-sm p-2 focus:outline-none focus:ring-2 focus:ring-blue-500"
className="dark:text-gray-100 border border-gray-300 dark:border-gray-700 rounded placeholder:text-gray-600 text-sm p-2 focus:outline-none focus:ring-2 focus:ring-blue-500"
placeholder="Some description goes here..."
></textarea>
{errors.description && (
@ -116,7 +116,7 @@ const ApiServiceCreatePage: FC = () => {
{...register("redirectUris", {
required: "At least one URI is required",
})}
className="dark:text-gray-100 border border-gray-600 dark:border-gray-700 rounded placeholder:text-gray-600 text-sm p-2 focus:outline-none focus:ring-2 focus:ring-blue-500"
className="dark:text-gray-100 border border-gray-300 dark:border-gray-700 rounded placeholder:text-gray-600 text-sm p-2 focus:outline-none focus:ring-2 focus:ring-blue-500"
placeholder="Enter multiple URIs separated with new line"
></textarea>
{errors.redirectUris && (

View File

@ -56,7 +56,7 @@ const ViewApiServicePage: FC = () => {
]}
/>
<div className="p-4">
<div className="sm:p-4 pt-4">
{/* 📋 Main Details */}
<InfoCard title="API Service Details">
<div className="flex flex-col gap-4 text-sm text-gray-700 dark:text-gray-300">

View File

@ -84,7 +84,7 @@ const ApiServicesPage: FC = () => {
key={service.id}
className="hover:bg-gray-50 dark:hover:bg-gray-800"
>
<td className="px-6 py-4 text-sm font-medium text-blue-600 border border-gray-700">
<td className="px-6 py-4 text-sm font-medium text-blue-600 border border-gray-300 dark:border-gray-700">
<Link
to={`/admin/api-services/view/${service.id}`}
className="hover:underline hover:text-gray-600 dark:hover:text-gray-300 transition-colors"
@ -92,10 +92,10 @@ const ApiServicesPage: FC = () => {
{service.name}
</Link>
</td>
<td className="px-6 py-4 text-sm text-gray-700 dark:text-gray-300 border border-gray-700">
<td className="px-6 py-4 text-sm text-gray-700 dark:text-gray-300 border border-gray-300 dark:border-gray-700">
{service.client_id}
</td>
<td className="px-6 py-4 text-sm border border-gray-700">
<td className="px-6 py-4 text-sm border border-gray-300 dark:border-gray-700">
<span
className={`inline-block px-2 py-1 text-xs rounded-full font-semibold ${
service.is_active
@ -106,10 +106,10 @@ const ApiServicesPage: FC = () => {
{service.is_active ? "Yes" : "No"}
</span>
</td>
<td className="px-6 py-4 text-sm text-gray-500 dark:text-gray-400 border border-gray-700">
<td className="px-6 py-4 text-sm text-gray-500 dark:text-gray-400 border border-gray-300 dark:border-gray-700">
{new Date(service.created_at).toLocaleString()}
</td>
<td className="px-6 py-4 text-sm text-gray-500 dark:text-gray-400 border border-gray-700">
<td className="px-6 py-4 text-sm text-gray-500 dark:text-gray-400 border border-gray-300 dark:border-gray-700">
{new Date(service.updated_at).toLocaleString()}
</td>
</tr>

View File

@ -0,0 +1,7 @@
import type { FC } from "react";
const NotAllowedPage: FC = () => {
return <div>this resource is not allowed</div>;
};
export default NotAllowedPage;

View File

@ -0,0 +1,7 @@
import type { FC } from "react";
const NotFoundPage: FC = () => {
return <div>404 - Not Found</div>;
};
export default NotFoundPage;