Skip to content

Commit

Permalink
remove unused Recoil code
Browse files Browse the repository at this point in the history
  • Loading branch information
SKarolFolio committed Dec 2, 2024
1 parent 0d4ff46 commit 2152a97
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 61 deletions.
7 changes: 2 additions & 5 deletions src/components/Prompt/Prompt.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { FC, useState } from 'react';
import { useBlocker } from 'react-router-dom';
import { useModalControls } from '@common/hooks/useModalControls';
import state from '@state';
import { useSetRecoilState } from 'recoil';
import { ModalCloseRecord } from '@components/ModalCloseRecord';
import { ForceNavigateToDest, QueryParams } from '@common/constants/routes.constants';
import { ModalSwitchToNewRecord } from '@components/ModalSwitchToNewRecord';
Expand All @@ -11,8 +9,8 @@ import { useNavigateToEditPage } from '@common/hooks/useNavigateToEditPage';
import { RecordStatus } from '@common/constants/record.constants';
import { getForceNavigateToDest } from '@common/helpers/navigation.helper';
import { useContainerEvents } from '@common/hooks/useContainerEvents';
import './Prompt.scss';
import { useStatusState } from '@src/store';
import './Prompt.scss';

interface Props {
when: boolean;
Expand All @@ -30,8 +28,7 @@ export const Prompt: FC<Props> = ({ when: shouldPrompt }) => {
setIsModalOpen: setIsSwitchToNewRecordModalOpen,
openModal: openSwitchToNewRecordModal,
} = useModalControls();
const { setIsEditedRecord: setIsEdited } = useStatusState();
const setRecordStatus = useSetRecoilState(state.status.recordStatus);
const { setIsEditedRecord: setIsEdited, setRecordStatus } = useStatusState();
const [forceNavigateTo, setForceNavigateTo] = useState<{
pathname: string;
search: string;
Expand Down
22 changes: 0 additions & 22 deletions src/state/data.ts

This file was deleted.

4 changes: 0 additions & 4 deletions src/state/index.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
import config from './config';
import inputs from './inputs';
import status from './status';
import ui from './ui';
import loadingState from './loadingState';
import search from './search';
import data from './data';

export default {
config,
inputs,
status,
ui,
loadingState,
search,
data,
};
28 changes: 0 additions & 28 deletions src/state/status.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ describe('MarcPreviewComplexLookup', () => {
<RecoilRoot
initializeState={({ set }) => {
set(state.ui.isMarcPreviewOpen, isMarcPreviewOpen);
set(state.data.marcPreviewData, marcPreviewData);
set(state.data.marcPreviewMetadata, marcPreviewMetadata);
}}
>
<MarcPreviewComplexLookup onClose={onClose} />
Expand Down

0 comments on commit 2152a97

Please sign in to comment.