Skip to content

Commit

Permalink
Merge pull request #84 from avored/82-react-page-table-with-list-of-a…
Browse files Browse the repository at this point in the history
…dmin-users

82 react page table with list of admin users
  • Loading branch information
indpurvesh authored Dec 17, 2023
2 parents 315533d + 0b3b768 commit 0ece011
Show file tree
Hide file tree
Showing 18 changed files with 352 additions and 133 deletions.
Empty file removed data/avored.db/.gitkeep
Empty file.
8 changes: 4 additions & 4 deletions public/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -918,6 +918,10 @@ select {
margin-bottom: auto;
}

.ml-1 {
margin-left: 0.25rem;
}

.ml-2 {
margin-left: 0.5rem;
}
Expand Down Expand Up @@ -990,10 +994,6 @@ select {
margin-top: 2rem;
}

.ml-1 {
margin-left: 0.25rem;
}

.block {
display: block;
}
Expand Down
34 changes: 34 additions & 0 deletions react-admin/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions react-admin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"@testing-library/user-event": "^13.5.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"@headlessui/react": "^1.7.17",
"react-router-dom": "^6.20.1",
"react-scripts": "5.0.1",
"web-vitals": "^2.1.4"
Expand Down
12 changes: 11 additions & 1 deletion react-admin/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,25 @@ import {BrowserRouter, Navigate, Route, Routes} from 'react-router-dom';
import Dashboard from './pages/Dashboard'
import Login from './pages/auth/Login'
import Home from "./pages/Home";
import AppLayout from "./layouts/AppLayout";
import PageTable from "./pages/page/PageTable";
import PageCreate from "./pages/page/PageCreate";

function App() {
return (
<BrowserRouter>
<Routes>
{/*<Route path="/" element={<Navigate to="/admin" replace />} />*/}
<Route path="/" element={<Home />} />
<Route path="/admin" element={<Dashboard />} />

<Route path="/admin/login" element={<Login />} />

<Route element={<AppLayout />}>
<Route path="/admin" element={<Dashboard />} />
<Route path="/admin/page" element={<PageTable />} />
<Route path="/admin/page/create" element={<PageCreate />} />
</Route>

</Routes>
</BrowserRouter>
);
Expand Down
14 changes: 14 additions & 0 deletions react-admin/src/layouts/AppLayout.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import AppHeader from "./partials/AppHeader";
import AppSidebar from "./partials/AppSidebar";

function AppLayout() {
return (
<div
className="min-h-screen">
<AppHeader />
<AppSidebar />
</div>
);
}

export default AppLayout;
22 changes: 22 additions & 0 deletions react-admin/src/layouts/partials/AppHeader.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import logo from "../../assets/logo_only.svg";

function AppHeader() {
return (
<header
className="h-16 py-2 shadow-lg px-4 md:sticky top-0 bg-gray-800 z-40">
<a href="/admin"
className="text-white flex items-center space-x-2 group hover:text-white">
<div>
<img src={logo} className="h-12"/>
</div>

<div>
<span className="text-2xl font-semibold">AvoRed</span>
<span className="text-xs block">Rust CMS</span>
</div>
</a>
</header>
);
}

export default AppHeader;
114 changes: 114 additions & 0 deletions react-admin/src/layouts/partials/AppSidebar.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
import logo from "../../assets/logo_only.svg";
import FeatherIcon from "feather-icons-react";
import {Link, Outlet} from "react-router-dom";

function AppSidebar() {
return (
<div className="flex">
<div
className="w-64 max-h-screen top-16 pt-5 h-screen bg-gray-800 text-blue-100 fixed inset-y-0 left-0 transform transition duration-200 ease-in-out">
<nav
className="px-4 pt-4 scroller overflow-y-scroll max-h-[calc(100vh-64px)]"
>
<ul className="flex flex-col space-y-2">


<li className="text-sm text-gray-500 ">
<a href="/admin"
className="flex items-center w-full py-1 px-2 rounded relative hover:text-white hover:bg-gray-700 ">
<div className="pr-2">
<FeatherIcon className="h-4 w-4" icon="anchor"/>
</div>
<div>Dashboard</div>
</a>
</li>

<div
className="section border-b pt-4 mb-4 text-xs text-gray-600 border-gray-700 pb-1 pl-3">
Content Manager
</div>


<li className="text-sm text-gray-500 ">
<Link
className="flex items-center w-full py-1 px-2 rounded relative hover:text-white hover:bg-gray-700"
to={`/admin/page`}>
<div className="pr-2">
<FeatherIcon className="h-4 w-4" icon="anchor"/>
</div>
<div>Page</div>
</Link>

<a href="#"
className="flex items-center w-full py-1 px-2 mt-3 rounded relative hover:text-white hover:bg-gray-700 ">
<div className="pr-2">
<FeatherIcon className="h-4 w-4" icon="compass"/></div>
<div>Components</div>
</a>
<a href="/admin/asset"
className="flex items-center w-full py-1 px-2 mt-3 rounded relative hover:text-white hover:bg-gray-700 ">
<div className="pr-2">
<FeatherIcon className="h-4 w-4" icon="image"/>
</div>
<div>
Assets Manager
</div>
</a>
</li>


<div
className="section border-b pt-4 mb-4 text-xs text-gray-600 border-gray-700 pb-1 pl-3">
Managment
</div>


<li className="text-sm text-gray-500 ">
<a href="#"
className="flex items-center w-full py-1 px-2 rounded relative hover:text-white hover:bg-gray-700">
<div className="pr-2">
<FeatherIcon className="h-4 w-4" icon="anchor"/>
</div>
<div>Team</div>
<div
className="absolute right-1.5 transition-transform duration-300"
>
<FeatherIcon className="h-4 w-4" icon="chevron-down"/>
</div>
</a>

<div
className="pl-4 pr-2 overflow-hidden transition-all transform translate duration-300 max-h-0 "
>
<ul
className="flex flex-col mt-2 pl-2 text-gray-500 border-l border-gray-700 space-y-1 text-xs">

<li className="text-sm text-gray-500 ">
<a href="#"
className="flex items-center w-full py-1 px-2 rounded relative hover:text-white hover:bg-gray-700">
<div>
Admin Users
</div>
</a>
</li>

<li className="text-sm text-gray-500 ">
<a href="/admin/role"
className="flex items-center w-full py-1 px-2 rounded relative hover:text-white hover:bg-gray-700">
<div>
Roles
</div>
</a>
</li>
</ul>
</div>
</li>
</ul>
</nav>
</div>
<Outlet/>
</div>
);
}

export default AppSidebar;
Loading

0 comments on commit 0ece011

Please sign in to comment.