diff --git a/ui/components/app/account-menu/account-menu.container.js b/ui/components/app/account-menu/account-menu.container.js index 52b87aaff..36a420656 100644 --- a/ui/components/app/account-menu/account-menu.container.js +++ b/ui/components/app/account-menu/account-menu.container.js @@ -4,7 +4,6 @@ import { withRouter } from 'react-router-dom'; import { toggleAccountMenu, showAccountDetail, - hideSidebar, lockMetamask, hideWarning, } from '../../../store/actions'; @@ -46,13 +45,11 @@ function mapDispatchToProps(dispatch) { toggleAccountMenu: () => dispatch(toggleAccountMenu()), showAccountDetail: (address) => { dispatch(showAccountDetail(address)); - dispatch(hideSidebar()); dispatch(toggleAccountMenu()); }, lockMetamask: () => { dispatch(lockMetamask()); dispatch(hideWarning()); - dispatch(hideSidebar()); dispatch(toggleAccountMenu()); }, }; diff --git a/ui/components/app/app-components.scss b/ui/components/app/app-components.scss index c868491ac..7f1184243 100644 --- a/ui/components/app/app-components.scss +++ b/ui/components/app/app-components.scss @@ -30,7 +30,6 @@ @import 'recovery-phrase-reminder/index'; @import 'step-progress-bar/index.scss'; @import 'selected-account/index'; -@import 'sidebars/index'; @import 'signature-request/index'; @import 'signature-request-original/index'; @import 'tab-bar/index'; diff --git a/ui/components/app/edit-gas-popover/edit-gas-popover.component.js b/ui/components/app/edit-gas-popover/edit-gas-popover.component.js index bac3e7d77..9f0cbdb05 100644 --- a/ui/components/app/edit-gas-popover/edit-gas-popover.component.js +++ b/ui/components/app/edit-gas-popover/edit-gas-popover.component.js @@ -22,7 +22,6 @@ import { createCancelTransaction, createSpeedUpTransaction, hideModal, - hideSidebar, updateTransaction, updateCustomSwapsEIP1559GasParams, updateSwapsUserFeeLevel, @@ -42,7 +41,6 @@ export default function EditGasPopover({ }) { const t = useContext(I18nContext); const dispatch = useDispatch(); - const showSidebar = useSelector((state) => state.appState.sidebar.isOpen); const networkAndAccountSupport1559 = useSelector( checkNetworkAndAccountSupports1559, ); @@ -98,19 +96,17 @@ export default function EditGasPopover({ /** * Temporary placeholder, this should be managed by the parent component but - * we will be extracting this component from the hard to maintain modal/ - * sidebar component. For now this is just to be able to appropriately close + * we will be extracting this component from the hard to maintain modal + * component. For now this is just to be able to appropriately close * the modal in testing */ const closePopover = useCallback(() => { if (onClose) { onClose(); - } else if (showSidebar) { - dispatch(hideSidebar()); } else { dispatch(hideModal()); } - }, [showSidebar, onClose, dispatch]); + }, [onClose, dispatch]); const onSubmit = useCallback(() => { if (!transaction || !mode) { diff --git a/ui/components/app/gas-customization/gas-modal-page-container/gas-modal-page-container-container.test.js b/ui/components/app/gas-customization/gas-modal-page-container/gas-modal-page-container-container.test.js index 37e853cd1..52f2b0fb4 100644 --- a/ui/components/app/gas-customization/gas-modal-page-container/gas-modal-page-container-container.test.js +++ b/ui/components/app/gas-customization/gas-modal-page-container/gas-modal-page-container-container.test.js @@ -166,7 +166,6 @@ describe('gas-modal-page-container container', () => { updateTransactionGasFees: sinon.spy(), someOtherDispatchProp: sinon.spy(), createSpeedUpTransaction: sinon.spy(), - hideSidebar: sinon.spy(), hideModal: sinon.spy(), cancelAndClose: sinon.spy(), }; @@ -268,7 +267,6 @@ describe('gas-modal-page-container container', () => { expect(dispatchProps.cancelAndClose.callCount).toStrictEqual(1); expect(dispatchProps.createSpeedUpTransaction.callCount).toStrictEqual(1); - expect(dispatchProps.hideSidebar.callCount).toStrictEqual(1); }); }); }); diff --git a/ui/components/app/gas-customization/gas-modal-page-container/gas-modal-page-container.container.js b/ui/components/app/gas-customization/gas-modal-page-container/gas-modal-page-container.container.js index 571544cf0..3d77f1214 100644 --- a/ui/components/app/gas-customization/gas-modal-page-container/gas-modal-page-container.container.js +++ b/ui/components/app/gas-customization/gas-modal-page-container/gas-modal-page-container.container.js @@ -4,7 +4,6 @@ import { hideModal, createRetryTransaction, createSpeedUpTransaction, - hideSidebar, } from '../../../../store/actions'; import { setCustomGasPrice, @@ -223,7 +222,6 @@ const mapDispatchToProps = (dispatch) => { createSpeedUpTransaction: (txId, customGasSettings) => { return dispatch(createSpeedUpTransaction(txId, customGasSettings)); }, - hideSidebar: () => dispatch(hideSidebar()), }; }; @@ -246,7 +244,6 @@ const mergeProps = (stateProps, dispatchProps, ownProps) => { createSpeedUpTransaction: dispatchCreateSpeedUpTransaction, createRetryTransaction: dispatchCreateRetryTransaction, updateTransactionGasFees: dispatchUpdateTransactionGasFees, - hideSidebar: dispatchHideSidebar, cancelAndClose: dispatchCancelAndClose, hideModal: dispatchHideModal, ...otherDispatchProps @@ -258,7 +255,6 @@ const mergeProps = (stateProps, dispatchProps, ownProps) => { ...ownProps, onSubmit: (gasLimit, gasPrice) => { if (ownProps.onSubmit) { - dispatchHideSidebar(); dispatchCancelAndClose(); ownProps.onSubmit({ gasLimit, gasPrice }); return; @@ -274,11 +270,9 @@ const mergeProps = (stateProps, dispatchProps, ownProps) => { dispatchCancelAndClose(); } else if (isSpeedUp) { dispatchCreateSpeedUpTransaction(txId, { gasPrice, gasLimit }); - dispatchHideSidebar(); dispatchCancelAndClose(); } else if (isRetry) { dispatchCreateRetryTransaction(txId, { gasPrice, gasLimit }); - dispatchHideSidebar(); dispatchCancelAndClose(); } else { dispatchSetGasData(gasLimit, gasPrice); @@ -293,9 +287,6 @@ const mergeProps = (stateProps, dispatchProps, ownProps) => { }, cancelAndClose: () => { dispatchCancelAndClose(); - if (isSpeedUp || isRetry) { - dispatchHideSidebar(); - } }, disableSave: insufficientBalance || diff --git a/ui/components/app/sidebars/index.js b/ui/components/app/sidebars/index.js deleted file mode 100644 index d5d5026c6..000000000 --- a/ui/components/app/sidebars/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from './sidebar.component'; diff --git a/ui/components/app/sidebars/index.scss b/ui/components/app/sidebars/index.scss deleted file mode 100644 index d2d224eb0..000000000 --- a/ui/components/app/sidebars/index.scss +++ /dev/null @@ -1,81 +0,0 @@ -@import 'sidebar-content'; - -.sidebar-right-enter { - transition: transform 300ms ease-in-out; - transform: translateX(-100%); -} - -.sidebar-right-enter.sidebar-right-enter-active { - transition: transform 300ms ease-in-out; - transform: translateX(0%); -} - -.sidebar-right-leave { - transition: transform 200ms ease-out; - transform: translateX(0%); -} - -.sidebar-right-leave.sidebar-right-leave-active { - transition: transform 200ms ease-out; - transform: translateX(-100%); -} - -.sidebar-left-enter { - transition: transform 300ms ease-in-out; - transform: translateX(100%); -} - -.sidebar-left-enter.sidebar-left-enter-active { - transition: transform 300ms ease-in-out; - transform: translateX(0%); -} - -.sidebar-left-leave { - transition: transform 200ms ease-out; - transform: translateX(0%); -} - -.sidebar-left-leave.sidebar-left-leave-active { - transition: transform 200ms ease-out; - transform: translateX(100%); -} - -.sidebar-left { - flex: 1 0 230px; - background: rgb(250, 250, 250); - z-index: $sidebar-z-index; - position: fixed; - left: 15%; - right: 0; - bottom: 0; - opacity: 1; - visibility: visible; - will-change: transform; - overflow-y: auto; - box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 4px; - width: 85%; - height: 100%; - - @media screen and (min-width: 769px) { - width: 408px; - left: calc(100% - 408px); - } - - @media screen and (max-width: $break-small) { - width: 100%; - left: 0%; - } -} - -.sidebar-overlay { - z-index: $sidebar-overlay-z-index; - position: fixed; - height: 100%; - width: 100%; - left: 0; - right: 0; - bottom: 0; - opacity: 1; - visibility: visible; - background-color: rgba(0, 0, 0, 0.3); -} diff --git a/ui/components/app/sidebars/sidebar-content.scss b/ui/components/app/sidebars/sidebar-content.scss deleted file mode 100644 index d8bb0a5d0..000000000 --- a/ui/components/app/sidebars/sidebar-content.scss +++ /dev/null @@ -1,104 +0,0 @@ -.sidebar-left { - display: flex; - - .gas-modal-page-container { - display: flex; - - .page-container { - flex: 1; - max-width: 100%; - - &__content { - display: flex; - overflow-y: initial; - } - - @media screen and (max-width: $break-small) { - max-width: 344px; - min-height: auto; - } - - @media screen and (min-width: $break-small) { - max-height: none; - } - } - - .page-container__bottom { - display: flex; - flex-direction: column; - height: 100%; - } - - .page-container__content { - overflow-y: inherit; - } - - .basic-tab-content { - height: auto; - margin-bottom: 0; - border-bottom: 1px solid #d2d8dd; - flex: 1 1 70%; - - @media screen and (max-width: $break-small) { - padding-left: 14px; - padding-bottom: 21px; - } - - .gas-price-button-group--alt { - @media screen and (max-width: $break-small) { - max-width: 318px; - - &__time-estimate { - @include H7; - } - } - } - } - - .advanced-tab { - @media screen and (min-width: $break-small) { - flex: 1 1 70%; - } - - &__fee-chart { - height: 320px; - - @media screen and (max-width: $break-small) { - height: initial; - } - } - - &__fee-chart__speed-buttons { - bottom: 77px; - - @media screen and (max-width: $break-small) { - display: none; - } - } - } - - .gas-modal-content { - display: flex; - flex-direction: column; - width: 100%; - - &__info-row-wrapper { - display: flex; - - @media screen and (min-width: $break-small) { - flex: 1 1 30%; - } - } - - &__info-row { - height: 170px; - - @media screen and (max-width: $break-small) { - height: initial; - display: flex; - justify-content: center; - } - } - } - } -} diff --git a/ui/components/app/sidebars/sidebar.component.js b/ui/components/app/sidebars/sidebar.component.js deleted file mode 100644 index 4ed71461b..000000000 --- a/ui/components/app/sidebars/sidebar.component.js +++ /dev/null @@ -1,79 +0,0 @@ -import React, { Component } from 'react'; -import PropTypes from 'prop-types'; -import ReactCSSTransitionGroup from 'react-transition-group/CSSTransitionGroup'; -import CustomizeGas from '../gas-customization/gas-modal-page-container'; -import { MILLISECOND } from '../../../../shared/constants/time'; - -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, - }; - - static contextTypes = { - t: PropTypes.func, - }; - - renderOverlay() { - const { onOverlayClose } = this.props; - - return ( -