diff options
author | Hsuan Lee <boczeratul@gmail.com> | 2019-03-06 17:46:50 +0800 |
---|---|---|
committer | Hsuan Lee <boczeratul@gmail.com> | 2019-03-06 17:46:50 +0800 |
commit | 35703539d0f2b4ddb3b11d0de8c9634af59ab71f (patch) | |
tree | ae3731221dbbb3a6fa40060a8d916cfd3f738289 /packages/website/ts/components/documentation/version_drop_down.tsx | |
parent | 92a1fde5b1ecd81b07cdb5bf0c9c1cd3544799db (diff) | |
download | dexon-0x-contracts-35703539d0f2b4ddb3b11d0de8c9634af59ab71f.tar dexon-0x-contracts-35703539d0f2b4ddb3b11d0de8c9634af59ab71f.tar.gz dexon-0x-contracts-35703539d0f2b4ddb3b11d0de8c9634af59ab71f.tar.bz2 dexon-0x-contracts-35703539d0f2b4ddb3b11d0de8c9634af59ab71f.tar.lz dexon-0x-contracts-35703539d0f2b4ddb3b11d0de8c9634af59ab71f.tar.xz dexon-0x-contracts-35703539d0f2b4ddb3b11d0de8c9634af59ab71f.tar.zst dexon-0x-contracts-35703539d0f2b4ddb3b11d0de8c9634af59ab71f.zip |
Deploy @dexon-foundation/0x.jsstable
Diffstat (limited to 'packages/website/ts/components/documentation/version_drop_down.tsx')
-rw-r--r-- | packages/website/ts/components/documentation/version_drop_down.tsx | 80 |
1 files changed, 0 insertions, 80 deletions
diff --git a/packages/website/ts/components/documentation/version_drop_down.tsx b/packages/website/ts/components/documentation/version_drop_down.tsx deleted file mode 100644 index 5e77530fd..000000000 --- a/packages/website/ts/components/documentation/version_drop_down.tsx +++ /dev/null @@ -1,80 +0,0 @@ -import { colors } from '@0x/react-shared'; -import * as _ from 'lodash'; -import * as React from 'react'; -import { Button } from 'ts/components/ui/button'; -import { Container } from 'ts/components/ui/container'; -import { DropDown, DropdownMouseEvent } from 'ts/components/ui/drop_down'; -import { Text } from 'ts/components/ui/text'; -import { styled } from 'ts/style/theme'; - -interface ActiveNodeProps { - className?: string; - selectedVersion: string; -} - -const PlainActiveNode: React.StatelessComponent<ActiveNodeProps> = ({ className, selectedVersion }) => ( - <Container className={className}> - <Container className="flex justify-center"> - <Text fontColor={colors.grey700} fontSize="12px"> - v {selectedVersion} - </Text> - <Container paddingLeft="6px"> - <i className="zmdi zmdi-chevron-down" style={{ fontSize: 17, color: 'rgba(153, 153, 153, 0.8)' }} /> - </Container> - </Container> - </Container> -); - -const ActiveNode = styled(PlainActiveNode)` - cursor: pointer; - border: 1px solid ${colors.beigeWhite}; - border-radius: 4px; - padding: 4px 6px 4px 8px; -`; - -interface VersionDropDownProps { - selectedVersion: string; - versions: string[]; - onVersionSelected: (semver: string) => void; -} - -interface VersionDropDownState {} - -export class VersionDropDown extends React.Component<VersionDropDownProps, VersionDropDownState> { - public render(): React.ReactNode { - const activeNode = <ActiveNode selectedVersion={this.props.selectedVersion} />; - return ( - <DropDown - activateEvent={DropdownMouseEvent.Click} - activeNode={activeNode} - popoverContent={this._renderDropdownMenu()} - anchorOrigin={{ horizontal: 'middle', vertical: 'bottom' }} - targetOrigin={{ horizontal: 'middle', vertical: 'top' }} - popoverStyle={{ borderRadius: 4 }} - /> - ); - } - private _renderDropdownMenu(): React.ReactNode { - const items = _.map(this.props.versions, version => { - const isSelected = version === this.props.selectedVersion; - return ( - <Container key={`dropdown-items-${version}`}> - <Button - borderRadius="0px" - padding="0.8em 0em" - width="100%" - isDisabled={isSelected} - onClick={this._onClick.bind(this, version)} - > - v {version} - </Button> - </Container> - ); - }); - const dropdownMenu = <Container width="88px">{items}</Container>; - return dropdownMenu; - } - private _onClick(selectedVersion: string): void { - this.props.onVersionSelected(selectedVersion); - } -} |