import * as React from "react"; import * as Strings from "~/common/strings"; import * as Constants from "~/common/constants"; import * as SVG from "~/common/svg"; import { css } from "@emotion/react"; import Pill from "~/components/core/Pill"; const IconMap = { HOME: , FILE: , FOLDER: , WALLET: , CHANNELS: , DEALS: , PEERS: , DEALS: , STATUS: , STATS: , DATA_TRANSFER: , LOGS: , MINERS: , STORAGE_MARKET: , }; const STYLES_NAVIGATION = css` width: 100%; display; block; padding: 24px 0 0 0; font-size: 18px; `; const STYLES_NAVIGATION_ITEM = css` display: flex; align-items: flex-start; justify-content: space-between; cursor: pointer; color: ${Constants.system.black}; :hover { color: ${Constants.system.brand}; } `; const STYLES_EXPANDER = css` flex-shrink: 0; `; const STYLES_ICON = css` flex-shrink: 0; position: relative; `; const STYLES_CHILDREN = css` min-width: 10%; width: 100%; height: 100%; overflow-wrap: break-word; padding: 11px 0px 14px 8px; font-family: "inter-semi-bold"; font-weight: 400; font-size: 14px; line-height: 1.225; position: relative; display: flex; align-items: flex-start; justify-content: flex-start; `; 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; } `; const Item = ({ data, id, activeId, activeIds, level, children, showActive, treeChildren, decorator, onToggleShow, onNavigateTo, }) => { return ( {onToggleShow ? ( ) : null} onNavigateTo({ id }, data)}> {IconMap[decorator]} {decorator === "LOGS" ? ( 56 ) : null} onNavigateTo({ id }, data)} style={{ fontFamily: decorator === "FILE" ? "inter-regular" : null, color: activeIds[id] ? Constants.system.brand : null, }} > {children} ); }; const STYLES_SMALL_LINK = css` padding: 0 16px 0 16px; font-size: 14px; font-family: "inter-semi-bold"; margin-top: 11px; color: #666; transition: 200ms ease all; cursor: pointer; :hover { color: ${Constants.system.brand}; } `; class NodeReference extends React.Component { state = { showTreeChildren: false, }; _handleToggleShow = () => { this.setState({ showTreeChildren: !this.state.showTreeChildren }); }; render() { const { id, activeId, activeIds, level, children, treeChildren, activePage, decorator, onNavigateTo, data, } = this.props; const { showTreeChildren } = this.state; let showActive = showTreeChildren || activeIds[id]; let showChildren = showActive && treeChildren && treeChildren.length; return ( {children} {showChildren ? treeChildren.map((child) => { if (!child) { return null; } if (child.ignore) { return null; } return ( {child.name} ); }) : null} ); } } export default class ApplicationNavigation extends React.Component { render() { return ( {this.props.navigation.map((each) => { if (!each) { return null; } if (each.ignore) { return null; } return ( {each.name} ); })} { window.open("https://filscan.io/"); }} style={{ marginTop: 48 }} > Block Explorer { window.open("/system"); }} > Design System { window.open("https://docs.filecoin.io/"); }} > Documentation { window.open("https://filecoin.io/#community"); }} > Community ); } }