import get from 'lodash.get' import Icon from 'shared/components/icon/index.js' import Link from 'next/link' import orderBy from 'lodash.orderby' import Logo from 'shared/components/logos/freesewing.js' import ThemePicker from 'shared/components/theme-picker.js' import { getTagline } from 'site/utils.js' // TODO: Clean this up after restructuring markdown content const hide = ['contributors', 'developers', 'editors', 'translators'] // Don't show children for blog and showcase posts const keepClosed = ['blog', 'showcase', ] // TODO: For now we force tailwind to pickup these styles // At some point this should 'just work' though, but let's not worry about it now const force = [
, ] /* helper method to order nav entries */ const order = obj => orderBy(obj, ['__order', '__title'], ['asc', 'asc']) // Component for the collapse toggle const Chevron = ({w=8, m=2}) => // Helper method to filter out the real children const currentChildren = current => Object.values(order(current)) .filter(entry => (typeof entry === 'object')) const howActive = (slug) => { } // Shared classes for links const linkClasses = "text-lg text-base-content lg:text-xl py-1 hover:cursor-pointer hover:text-secondary bg-opacity-50" // Figure out whether a page is on the path to the active page const isActive = (slug, active) => { if (slug === active) return true let result = true const slugParts = slug.split('/') const activeParts = active.split('/') for (const i in slugParts) { if (slugParts[i] !== activeParts[i]) result = false } return result } // Component that renders a sublevel of navigation const SubLevel = ({ nodes={}, active }) => ({getTagline()}