react-responsive-tools 2.5.0 → 2.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TBreakpoint } from '../interfaces/TBreakpoint.js';
|
|
2
2
|
import { TAdaptiveVariant } from '../interfaces/TAdaptiveVariant.js';
|
|
3
|
-
export
|
|
3
|
+
export declare function useBreakpoint(b: TBreakpoint | number, variant?: TAdaptiveVariant): boolean;
|
|
4
4
|
export declare function useBreakpointMF(b: TBreakpoint | number): boolean;
|
|
5
5
|
export declare function useBreakpointDF(b: TBreakpoint | number): boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useMediaQuery } from 'react-responsive';
|
|
2
2
|
import useVariant from './useVariant.js';
|
|
3
3
|
import getBreakpoint from "../functions/getBreakpoint.js";
|
|
4
|
-
export
|
|
4
|
+
export function useBreakpoint(b, variant = 'MtF') {
|
|
5
5
|
const _bp = typeof b === 'number' ? b + 'px' : getBreakpoint(b);
|
|
6
6
|
const v = useVariant(variant);
|
|
7
7
|
return useMediaQuery({ query: `(${v}-width: ${_bp})` });
|