Skip to content

Commit

Permalink
Remove usimportexportparams (#266)
Browse files Browse the repository at this point in the history
Signed-off-by: Mahdi Triki <mohamed-mahdi.triki@rte-france.com>
  • Loading branch information
trikimahdi committed Jun 7, 2023
1 parent d842517 commit ebcf9cc
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 187 deletions.
23 changes: 14 additions & 9 deletions demo/src/FlatParametersTab.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/

import { useImportExportParams } from '../../src';
import React from 'react';
import React, { useCallback, useState } from 'react';
import RightResizableBox from './right-resizable-box';
import FlatParameters from '../../src/components/FlatParameters/FlatParameters';

Expand Down Expand Up @@ -105,18 +104,24 @@ const EXAMPLE_PARAMETERS = [
];

export const FlatParametersTab = () => {
const [currentParameters1, paramsComponent1] = useImportExportParams(
EXAMPLE_PARAMETERS,
null,
false
);
const [currentParameters, setCurrentParameters] = useState({});
const onChange = useCallback((paramName, value, isEdit) => {
if (!isEdit) {
setCurrentParameters((prevCurrentParameters) => {
return {
...prevCurrentParameters,
...{ [paramName]: value },
};
});
}
}, []);
return (
<div style={{ display: 'flex', margin: 8 }}>
<RightResizableBox>{paramsComponent1}</RightResizableBox>
<RightResizableBox>
<FlatParameters
paramsAsArray={EXAMPLE_PARAMETERS}
initValues={currentParameters1}
initValues={currentParameters}
onChange={onChange}
variant={'standard'}
/>
</RightResizableBox>
Expand Down
173 changes: 0 additions & 173 deletions src/hooks/useImportExportParams.js

This file was deleted.

5 changes: 0 additions & 5 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,6 @@ export card_error_boundary_fr from './components/translations/card-error-boundar
export { TagRenderer } from './components/ElementSearchDialog';
export { EquipmentItem } from './components/ElementSearchDialog/equipment-item';
export CardErrorBoundary from './components/CardErrorBoundary';
export {
useImportExportParams,
makeDeltaMap,
extractDefaultMap,
} from './hooks/useImportExportParams';
export { useIntlRef } from './hooks/useIntlRef';
export { useSnackMessage } from './hooks/useSnackMessage';
export { useDebounce } from './hooks/useDebounce';

0 comments on commit ebcf9cc

Please sign in to comment.