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: ,
ENCRYPTED: ,
NETWORK: ,
DIRECTORY: ,
FOLDER: ,
WALLET: ,
DEALS: ,
MAKE_DEAL: ,
SLATES: ,
SLATE: ,
LOCAL_DATA: ,
PROFILE_PAGE: ,
SETTINGS_DEVELOPER: ,
SETTINGS: ,
DIRECTORY: ,
FILECOIN: ,
MINERS: ,
};
const STYLES_MOBILE_HIDDEN = css`
@media (max-width: ${Constants.sizes.mobile}px) {
display: none;
}
`;
const STYLES_NAVIGATION = css`
margin-top: ${Constants.sizes.topOffset}px;
width: 100%;
display: block;
padding: 24px 0 0 0;
@media (max-width: ${Constants.sizes.mobile}px) {
display: flex;
flex-direction: row;
justify-content: space-around;
margin-top: 0;
padding: 0;
height: 100%;
align-items: center;
}
`;
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: 0px;
}
`;
const Item = (props) => {
return (
{props.treeChildren && props.treeChildren.length ? (
) : null}
props.onAction({
type: "NAVIGATE",
value: props.id,
data: props.data,
})
}
>
props.onAction({
type: "NAVIGATE",
value: props.id,
data: 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 (
);
}
}