BlueWallet/hooks/useIsLargeScreen.ts
2024-05-13 13:08:47 -04:00

11 lines
369 B
TypeScript

import { useContext } from 'react';
import { LargeScreenContext } from '../components/Context/LargeScreenProvider';
export const useIsLargeScreen = (): boolean => {
const context = useContext(LargeScreenContext);
if (context === undefined) {
throw new Error('useIsLargeScreen must be used within a LargeScreenProvider');
}
return context.isLargeScreen;
};