BlueWallet/hooks/useIsLargeScreen.ts

11 lines
369 B
TypeScript
Raw Normal View History

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;
2024-04-19 00:31:06 +02:00
};