Refactor hooks and contexts for improved state management and modularity
Some checks are pending
Deploy to Test Environment / deploy-to-test (push) Has started running
Some checks are pending
Deploy to Test Environment / deploy-to-test (push) Has started running
- Updated `useActiveDeals` hook to include reset functionality for API calls. - Enhanced `useApi` hook to provide a reset method for clearing state. - Refactored `useAuth`, `useFlyers`, `useMasterItems`, `useModal`, and `useUserData` hooks to utilize context providers for better state management. - Created new context files: `AuthContext`, `FlyersContext`, `MasterItemsContext`, `ModalContext`, and `UserDataContext` to encapsulate related state and logic. - Updated tests for hooks to accommodate changes in context structure and reset functionality. - Adjusted imports in `index.tsx` to reflect new context structure.
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
import React, { ReactNode } from 'react';
|
||||
import { renderHook, waitFor, act } from '@testing-library/react';
|
||||
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
|
||||
import { AuthProvider, useAuth } from './useAuth';
|
||||
import { useAuth } from './useAuth';
|
||||
import { AuthProvider } from '../contexts/AuthContext';
|
||||
import * as apiClient from '../services/apiClient';
|
||||
import type { User, UserProfile } from '../types';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user