+
+ >
+ );
}
diff --git a/src/index.css b/src/index.css
index 46dfb6b..fc4a0b9 100644
--- a/src/index.css
+++ b/src/index.css
@@ -3,10 +3,10 @@
@tailwind utilities;
:root {
- font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
- line-height: 1.5;
- font-weight: 400;
- --wavelength-612-color: #FF5700;
- --wavelength-612-color-light: #FF7F33;
- --wavelength-612-color-dark: #CC4700;
-}
\ No newline at end of file
+ font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
+ line-height: 1.5;
+ font-weight: 400;
+ --wavelength-612-color: #ff5700;
+ --wavelength-612-color-light: #ff7f33;
+ --wavelength-612-color-dark: #cc4700;
+}
diff --git a/src/index.tsx b/src/index.tsx
index b5abbaf..5ddd38b 100644
--- a/src/index.tsx
+++ b/src/index.tsx
@@ -6,7 +6,7 @@ import "./index.css";
import AdminPage from "./routes/admin/Admin";
import { AuthService, client } from "./api";
-client.setConfig({baseUrl: "http://127.0.0.1:8000"})
+client.setConfig({ baseUrl: "http://127.0.0.1:8000" });
const token = await AuthService.authJwtLogin({
body: { username: "boss@fsektionen.se", password: "dabdab" },
@@ -14,9 +14,12 @@ const token = await AuthService.authJwtLogin({
const myHeaders = new Headers();
-myHeaders.append("Authorization", `${token.data!.token_type} ${token.data!.access_token}`)
+myHeaders.append(
+ "Authorization",
+ `${token.data!.token_type} ${token.data!.access_token}`
+);
-client.setConfig({headers: myHeaders})
+client.setConfig({ headers: myHeaders });
// OpenAPI.interceptors.request.use((request) => {
// (request.headers as Headers).set(
@@ -38,11 +41,12 @@ const router = createBrowserRouter([
},
]);
-const rootElement = document.getElementById('root');
+const rootElement = document.getElementById("root");
if (rootElement) {
const root = ReactDOM.createRoot(rootElement);
- root.render(
-
- ,)
+ root.render(
+
+
+
+ );
}
-
diff --git a/src/routes/admin/Admin.css b/src/routes/admin/Admin.css
index 3602e75..3ace0d6 100644
--- a/src/routes/admin/Admin.css
+++ b/src/routes/admin/Admin.css
@@ -1,72 +1,8 @@
-.sidebar {
- display: block;
- text-align: left;
- background-color: var(--wavelength-612-color);
- max-width: 10%;
- height: 100vh;
- flex-grow: 1;
- overflow-y: auto;
-}
-
-.sidebar a,
-.sidebar button {
- text-align: left;
- display: inline-block;
- box-sizing: border-box;
- background: none;
- padding: 10px;
- height: auto;
- width: 100%;
- border: none;
- cursor: pointer;
-}
-
-/* Styles for the second sidebar */
-.second-sidebar {
- display: block;
- text-align: left;
- background-color: lightgray;
- max-width: 15%;
- height: 100vh;
- position: absolute;
- left: 10%;
- /* Position it next to the main sidebar */
- top: 0;
- overflow-y: auto;
- z-index: 1000;
- /* Ensure it is above other content */
-}
-
-.second-sidebar a {
- text-align: left;
- display: inline-block;
- box-sizing: border-box;
- background: none;
- padding: 10px;
- height: auto;
- width: 100%;
-}
-
-.content {
- text-align: left;
- padding: 10px;
- margin-left: 5%;
- /* Default margin for when only the main sidebar is open */
- transition: margin-left 0.3s;
- /* Smooth transition */
-}
-
-/* Adjust the margin when the second sidebar is open */
-body.second-sidebar-open .content {
- margin-left: 15%;
- /* Adjust to accommodate both sidebars */
-}
-
#root {
- all: unset;
- display: flex;
+ all: unset;
+ display: flex;
}
body {
- all: unset;
-}
\ No newline at end of file
+ all: unset;
+}
diff --git a/src/routes/admin/Admin.tsx b/src/routes/admin/Admin.tsx
index e60f1a2..570d000 100644
--- a/src/routes/admin/Admin.tsx
+++ b/src/routes/admin/Admin.tsx
@@ -1,51 +1,58 @@
-
-import { useState, useEffect } from "react";
+import { useState } from "react";
import { Link, Route, Routes } from "react-router-dom";
import Landing from "./Landing";
import News from "./news/News";
import Songs from "./songs/Songs";
-import "./Admin.css";
import Test from "./test/Test";
export default function AdminPage() {
- // State to manage the visibility of the second sidebar
- const [isSecondSidebarOpen, setIsSecondSidebarOpen] = useState(false);
+ // State to manage which dropdown is open
+ const [openDropdown, setOpenDropdown] = useState(false);
+
+ // Function to toggle the visibility of the dropdown
+ const toggleDropdown = () => {
+ setOpenDropdown(!openDropdown);
+ };
- // Function to toggle the visibility
- const toggleSecondSidebar = () => {
- setIsSecondSidebarOpen(!isSecondSidebarOpen);
- };
+ return (
+
+ {/* Sidebar */}
+
+
+ Home
+
+
+ Test
+
+
+ More Options
+
- // Add or remove a class on the body element based on the state
- useEffect(() => {
- if (isSecondSidebarOpen) {
- document.body.classList.add("second-sidebar-open");
- } else {
- document.body.classList.remove("second-sidebar-open");
- }
- }, [isSecondSidebarOpen]);
+ {/* Dropdown Menu */}
+ {openDropdown && (
+