-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
src: improved navigation, updated dependencies, added darknode map to…
…oltip
- Loading branch information
Showing
28 changed files
with
948 additions
and
683 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import * as React from "react"; | ||
|
||
import { classNames } from "../../lib/react/className"; | ||
import { ReactComponent as IconDropdown } from "../../styles/images/icon-dropdown.svg"; | ||
import { ExternalLink, URLs } from "./ExternalLink"; | ||
|
||
const Option: React.FC<{ href: string }> = ({ href, children }) => | ||
<ExternalLink href={href}><li role="button" className="header--dropdown--option"> | ||
{children} | ||
</li></ExternalLink>; | ||
|
||
// tslint:disable: react-unused-props-and-state | ||
export const MoreDropdown: React.StatelessComponent<Props> = ({ }) => { | ||
const [shown, setShown] = React.useState(false); | ||
|
||
const ref = React.useRef(null as HTMLDivElement | null); | ||
|
||
// tslint:disable-next-line: no-any | ||
const clickAway = (event: any) => { | ||
// tslint:disable-next-line: no-any | ||
if (ref) { | ||
const current = ref.current; | ||
if ((current && !current.contains(event.target))) { | ||
setShown(false); | ||
} | ||
} | ||
document.removeEventListener("mousedown", clickAway); | ||
// @ts-ignore | ||
}; | ||
|
||
const toggle = () => { | ||
const newShown = !shown; | ||
setShown(newShown); | ||
|
||
if (newShown) { | ||
document.addEventListener("mousedown", clickAway); | ||
} else { | ||
document.removeEventListener("mousedown", clickAway); | ||
} | ||
}; | ||
|
||
return <div | ||
className="header--group" | ||
ref={ref} | ||
> | ||
<div className={classNames("header--selected")} role="menuitem" onClick={toggle}><span>More</span> <IconDropdown /></div> | ||
{shown ? | ||
<div className="header--dropdown--spacing header--dropdown--options"> | ||
<ul className="header--dropdown"> | ||
<Option href={URLs.renProjectDevelopers}>RenVM Developer Center</Option> | ||
<Option href={URLs.renProject}>RenProject.io</Option> | ||
<Option href={URLs.gitbook}>Documentation</Option> | ||
<Option href={URLs.gitbookDevelopers}>Developer Docs</Option> | ||
</ul> | ||
</div> : <></> | ||
} | ||
</div>; | ||
}; | ||
|
||
interface Props { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import React, { FC } from "react"; | ||
|
||
import { classNames } from "../../lib/react/className"; | ||
|
||
export enum StatusDotColor { | ||
Red = "red", | ||
Yellow = "yellow", | ||
Green = "green", | ||
} | ||
|
||
export const StatusDot: FC<{ color: StatusDotColor, size: number }> = ({ color, size }) => { | ||
return <span style={{ width: size, height: size, minWidth: size, minHeight: size }} className={classNames("status-dot", `status-dot--${color}`)}><span /></span>; | ||
}; |
Oops, something went wrong.