1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01:00

fix: clear query params when click cancel

This commit is contained in:
Youssef 2022-02-16 19:54:30 +01:00
parent f862489fe8
commit b24456b5cf
2 changed files with 12 additions and 6 deletions

View File

@ -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';

View File

@ -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<React.SetStateAction<boolean>>
) => {
const styles = useStyles();
const history = useHistory();
const dropboxClasses = classnames(styles.dropbox, {
[styles.dropboxActive]: isOver,
@ -33,7 +36,12 @@ const useDropboxMarkup = (
</div>
<Button
style={{ marginTop: '1rem' }}
onClick={() => setExpandedSidbar(false)}
onClick={() => {
setExpandedSidbar(false);
history.replace({
search: '',
});
}}
>
Cancel
</Button>
@ -42,5 +50,3 @@ const useDropboxMarkup = (
/>
);
};
export default useDropboxMarkup;