mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2024-11-19 18:00:17 +01:00
18 lines
607 B
TypeScript
18 lines
607 B
TypeScript
import { useContext } from 'react';
|
|
import { LargeScreenContext } from '../components/Context/LargeScreenProvider';
|
|
|
|
interface UseIsLargeScreenResult {
|
|
isLargeScreen: boolean;
|
|
setLargeScreenValue: (value: 'Handheld' | 'LargeScreen' | undefined) => void;
|
|
}
|
|
|
|
export const useIsLargeScreen = (): UseIsLargeScreenResult => {
|
|
const context = useContext(LargeScreenContext);
|
|
if (context === undefined) {
|
|
throw new Error('useIsLargeScreen must be used within a LargeScreenProvider');
|
|
}
|
|
return {
|
|
isLargeScreen: context.isLargeScreen,
|
|
setLargeScreenValue: context.setLargeScreenValue,
|
|
};
|
|
}; |