import { truncate } from "lodash"; import React, { JSX } from "preact"; import { moderationBar } from "server/admin/components/moderation-bar.component"; import { CommonLocals } from "./common.middleware"; import links from "./core/links"; import { ifFalse, ifNotSet, ifSet, ifTrue } from "./macros/jsx-utils"; import { BookshelfModel } from "bookshelf"; import config from "./core/config"; export default function base(context: CommonLocals, contents: JSX.Element): JSX.Element { const { pageImage, launchTime, rootUrl, path, event, user, unreadNotifications } = context; const pageTitle = (context.pageTitle ? (context.pageTitle + " | ") : "") + "Alakajam!"; const pageDescription = context.pageDescription || "A community for game development enthusiasts, organizing regular events && competitions."; const inEvent = event && event.get("id"); return {pageTitle} )} {context.scripts?.map(scriptUrl => )} {analytics()} ; } function userMenu(user, unreadNotifications) { return ; } function eventLink( event: BookshelfModel, statusField: string, targetPath: string, label: string | JSX.Element, icon: string, currentPath: string, options: { requiredValue?: string[] } = {}) { if (!statusField || event.get(statusField) !== "disabled") { const targetUrl = targetPath.includes("/") ? targetPath : links.routeUrl(event, "event", targetPath); return ; } } function analytics() { if (process.env.NODE_ENV === "production") { return ; } }