diff options
Diffstat (limited to 'ui/app/components/sidebars/sidebar.component.js')
-rw-r--r-- | ui/app/components/sidebars/sidebar.component.js | 69 |
1 files changed, 0 insertions, 69 deletions
diff --git a/ui/app/components/sidebars/sidebar.component.js b/ui/app/components/sidebars/sidebar.component.js deleted file mode 100644 index b9e0f9e81..000000000 --- a/ui/app/components/sidebars/sidebar.component.js +++ /dev/null @@ -1,69 +0,0 @@ -import React, { Component } from 'react' -import PropTypes from 'prop-types' -import ReactCSSTransitionGroup from 'react-addons-css-transition-group' -import WalletView from '../wallet-view' -import { WALLET_VIEW_SIDEBAR } from './sidebar.constants' -import CustomizeGas from '../gas-customization/gas-modal-page-container/' - -export default class Sidebar extends Component { - - static propTypes = { - sidebarOpen: PropTypes.bool, - hideSidebar: PropTypes.func, - sidebarShouldClose: PropTypes.bool, - transitionName: PropTypes.string, - type: PropTypes.string, - sidebarProps: PropTypes.object, - onOverlayClose: PropTypes.func, - }; - - renderOverlay () { - const { onOverlayClose } = this.props - - return <div - className="sidebar-overlay" - onClick={() => { - onOverlayClose && onOverlayClose() - this.props.hideSidebar() - } - } /> - } - - renderSidebarContent () { - const { type, sidebarProps = {} } = this.props - const { transaction = {} } = sidebarProps - switch (type) { - case WALLET_VIEW_SIDEBAR: - return <WalletView responsiveDisplayClassname={'sidebar-right' } /> - case 'customize-gas': - return <div className={'sidebar-left'}><CustomizeGas transaction={transaction} /></div> - default: - return null - } - - } - - componentDidUpdate (prevProps) { - if (!prevProps.sidebarShouldClose && this.props.sidebarShouldClose) { - this.props.hideSidebar() - } - } - - render () { - const { transitionName, sidebarOpen, sidebarShouldClose } = this.props - - return ( - <div> - <ReactCSSTransitionGroup - transitionName={transitionName} - transitionEnterTimeout={300} - transitionLeaveTimeout={200} - > - { sidebarOpen && !sidebarShouldClose ? this.renderSidebarContent() : null } - </ReactCSSTransitionGroup> - { sidebarOpen && !sidebarShouldClose ? this.renderOverlay() : null } - </div> - ) - } - -} |