import * as React from "react"; import * as Constants from "~/common/constants"; import * as System from "~/components/system"; import * as SVG from "~/common/svg"; import { css } from "@emotion/react"; import ApplicationUserControls from "~/components/core/ApplicationUserControls"; const IconMap = { HOME: , NETWORK: , DIRECTORY: , FOLDER: , WALLET: , DEALS: , MAKE_DEAL: , SLATES: , SLATE: , LOCAL_DATA: , PROFILE_PAGE: , SETTINGS_DEVELOPER: , SETTINGS: , DIRECTORY: , FILECOIN: , }; const STYLES_NAVIGATION = css` width: 100%; display: block; padding: 24px 0 0 0; `; const STYLES_NAVIGATION_ITEM = css` display: flex; align-items: flex-start; justify-content: space-between; cursor: pointer; color: ${Constants.system.black}; user-select: none; padding-right: 24px; font-family: ${Constants.font.medium}; :hover { padding-right: 0px; color: ${Constants.system.brand}; } `; const STYLES_EXPANDER = css` flex-shrink: 0; @media (max-width: ${Constants.sizes.mobile}px) { display: none; } `; const STYLES_ICON = css` flex-shrink: 0; position: relative; `; // NOTE(jim): Adjusts on mobile. const STYLES_CHILDREN = css` min-width: 10%; width: 100%; height: 100%; overflow-wrap: break-word; padding: 11px 0px 14px 8px; font-family: ${Constants.font.medium}; font-size: ${Constants.typescale.lvl1}; position: relative; display: flex; align-items: flex-start; justify-content: flex-start; @media (max-width: ${Constants.sizes.mobile}px) { display: none; } `; const STYLES_ICON_ELEMENT = css` height: 40px; width: 40px; display: inline-flex; align-items: center; justify-content: center; user-select: none; svg { transform: rotate(0deg); transition: 200ms ease transform; } @media (max-width: ${Constants.sizes.mobile}px) { margin: 0 8px 0 12px; } `; const Item = (props) => { return ( {props.treeChildren && props.treeChildren.length ? ( ) : null} props.onNavigateTo({ id: props.id }, props.data)} onTouchEnd={() => props.onNavigateTo({ id: props.id }, props.data)} > props.onNavigateTo({ id: props.id }, props.data)} onTouchEnd={() => props.onNavigateTo({ id: props.id }, props.data)} style={{ color: props.activeIds[props.id] ? Constants.system.brand : null, }} /> ); }; class NodeReference extends React.Component { static defaultProps = { treeChildren: [], }; state = { showTreeChildren: false, }; _handleToggleShow = () => { this.setState({ showTreeChildren: !this.state.showTreeChildren }); }; render() { return ( {this.state.showTreeChildren && this.props.treeChildren ? this.props.treeChildren.map((child) => { if (!child || child.ignore) { return null; } return ( ); }) : null} ); } } export default class ApplicationNavigation extends React.Component { render() { return ( ); } }