[deploy] Emit frontend bundle as ESM for browser
All checks were successful
Deploy Discord Bot / deploy (push) Successful in 38s
All checks were successful
Deploy Discord Bot / deploy (push) Successful in 38s
This commit is contained in:
@@ -1,8 +1,4 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.renderSidebar = renderSidebar;
|
||||
exports.initNavigation = initNavigation;
|
||||
const store_js_1 = require("../state/store.js");
|
||||
import { setState } from '../state/store.js';
|
||||
const defaultNav = [
|
||||
{ id: 'overview', label: 'Uebersicht', icon: '[*]' },
|
||||
{ id: 'tickets', label: 'Ticketsystem', icon: '[*]' },
|
||||
@@ -11,7 +7,7 @@ const defaultNav = [
|
||||
{ id: 'events', label: 'Events', icon: '[*]' },
|
||||
{ id: 'admin', label: 'Admin', icon: '[*]', requiresAdmin: true }
|
||||
];
|
||||
function renderSidebar(container, isAdmin) {
|
||||
export function renderSidebar(container, isAdmin) {
|
||||
container.innerHTML = '';
|
||||
const brand = document.createElement('div');
|
||||
brand.className = 'brand';
|
||||
@@ -30,14 +26,14 @@ function renderSidebar(container, isAdmin) {
|
||||
container.appendChild(brand);
|
||||
container.appendChild(nav);
|
||||
}
|
||||
function initNavigation(onChange) {
|
||||
export function initNavigation(onChange) {
|
||||
const navLinks = Array.from(document.querySelectorAll('.nav a'));
|
||||
const activate = (section) => {
|
||||
navLinks.forEach((link) => link.classList.toggle('active', link.dataset.target === section));
|
||||
document.querySelectorAll('.section').forEach((sec) => {
|
||||
sec.classList.toggle('active', sec.id === `section-${section}`);
|
||||
});
|
||||
(0, store_js_1.setState)({}); // trigger listeners for potential observers
|
||||
setState({}); // trigger listeners for potential observers
|
||||
onChange(section);
|
||||
};
|
||||
navLinks.forEach((link) => {
|
||||
|
||||
Reference in New Issue
Block a user