From b24456b5cf45187e89de5dfa9fca7cd2d46961cd Mon Sep 17 00:00:00 2001 From: Youssef Date: Wed, 16 Feb 2022 19:54:30 +0100 Subject: [PATCH] fix: clear query params when click cancel --- .../FeatureStrategiesEnvironmentList.tsx | 2 +- .../useDropboxMarkup.tsx | 16 +++++++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/frontend/src/component/feature/FeatureView/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesEnvironmentList/FeatureStrategiesEnvironmentList.tsx b/frontend/src/component/feature/FeatureView/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesEnvironmentList/FeatureStrategiesEnvironmentList.tsx index e3c38c9896..28d2724cf0 100644 --- a/frontend/src/component/feature/FeatureView/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesEnvironmentList/FeatureStrategiesEnvironmentList.tsx +++ b/frontend/src/component/feature/FeatureView/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesEnvironmentList/FeatureStrategiesEnvironmentList.tsx @@ -8,7 +8,7 @@ import ConditionallyRender from '../../../../../common/ConditionallyRender'; import FeatureStrategiesSeparator from '../FeatureStrategiesSeparator/FeatureStrategiesSeparator'; import useFeatureStrategiesEnvironmentList from './useFeatureStrategiesEnvironmentList'; -import useDropboxMarkup from './useDropboxMarkup'; +import { useDropboxMarkup } from './useDropboxMarkup'; import useDeleteStrategyMarkup from './useDeleteStrategyMarkup'; import useProductionGuardMarkup from './useProductionGuardMarkup'; import FeatureStrategyEditable from '../FeatureStrategyEditable/FeatureStrategyEditable'; diff --git a/frontend/src/component/feature/FeatureView/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesEnvironmentList/useDropboxMarkup.tsx b/frontend/src/component/feature/FeatureView/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesEnvironmentList/useDropboxMarkup.tsx index 200a8f8f7e..d676d07ab8 100644 --- a/frontend/src/component/feature/FeatureView/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesEnvironmentList/useDropboxMarkup.tsx +++ b/frontend/src/component/feature/FeatureView/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesEnvironmentList/useDropboxMarkup.tsx @@ -3,13 +3,16 @@ import ConditionallyRender from '../../../../../common/ConditionallyRender'; import classnames from 'classnames'; import { useStyles } from './FeatureStrategiesEnvironmentList.styles'; import { Button } from '@material-ui/core'; +import React from 'react'; +import { useHistory } from 'react-router-dom'; -const useDropboxMarkup = ( +export const useDropboxMarkup = ( isOver: boolean, expandedSidebar: boolean, - setExpandedSidbar + setExpandedSidbar: React.Dispatch> ) => { const styles = useStyles(); + const history = useHistory(); const dropboxClasses = classnames(styles.dropbox, { [styles.dropboxActive]: isOver, @@ -33,7 +36,12 @@ const useDropboxMarkup = ( @@ -42,5 +50,3 @@ const useDropboxMarkup = ( /> ); }; - -export default useDropboxMarkup;