File tree Expand file tree Collapse file tree 4 files changed +8
-8
lines changed Expand file tree Collapse file tree 4 files changed +8
-8
lines changed Original file line number Diff line number Diff line change 3
3
import classNames from 'classnames' ;
4
4
import React , { useRef } from 'react' ;
5
5
import LoadingSpinner from './LoadingSpinner' ;
6
- import { useLoading } from '../hooks' ;
6
+ import { useIsLoading } from '../hooks' ;
7
7
8
8
const sizes = Object . freeze ( {
9
9
xs : {
@@ -54,7 +54,7 @@ export default function EmbeddedVideo({
54
54
width,
55
55
} : EmbeddedVideoProps ) {
56
56
const ref = useRef < HTMLIFrameElement > ( null ) ;
57
- const loading = useLoading ( ref ) ;
57
+ const loading = useIsLoading ( ref ) ;
58
58
const offline = typeof navigator !== 'undefined' && ! navigator . onLine ;
59
59
const _width = width || ( size && sizes [ size ] . width ) ;
60
60
const _height = height || ( size && sizes [ size ] . height ) ;
Original file line number Diff line number Diff line change 3
3
import classNames from 'classnames' ;
4
4
import React , { useRef } from 'react' ;
5
5
import LoadingSpinner from './LoadingSpinner' ;
6
- import { useLoaded } from '../hooks' ;
6
+ import { useIsLoaded } from '../hooks' ;
7
7
8
8
export type ProgressiveImageProps = {
9
9
alt ?: string ;
@@ -42,7 +42,7 @@ export default function ProgressiveImage({
42
42
...rest
43
43
} : ProgressiveImageProps ) {
44
44
const imageRef = useRef < HTMLImageElement > ( null ) ;
45
- const loaded = useLoaded ( imageRef , undefined , onLoad ) ;
45
+ const loaded = useIsLoaded ( imageRef , undefined , onLoad ) ;
46
46
return (
47
47
< picture
48
48
className = { classNames (
Original file line number Diff line number Diff line change 1
1
export * from './useBodyOverflow' ;
2
2
export * from './useBreakpoint' ;
3
3
export * from './useElementSize' ;
4
+ export * from './useIsLoaded' ;
4
5
export * from './useIsMounted' ;
5
6
export * from './useIsomorphicLayoutEffect' ;
6
7
export * from './useKeyboardEvent' ;
7
- export * from './useLoaded' ;
8
8
export * from './useLocalStorage' ;
9
9
export * from './useMediaQuery' ;
10
10
export * from './usePagination' ;
Original file line number Diff line number Diff line change 3
3
import { useEffect , useState } from 'react' ;
4
4
import { bindEvent , unbindEvent } from '../utils' ;
5
5
6
- export function useLoaded (
6
+ export function useIsLoaded (
7
7
ref : React . RefObject < HTMLElement > ,
8
8
key ?: string ,
9
9
onLoad ?: ( ) => void ,
@@ -52,9 +52,9 @@ export function useLoaded(
52
52
return loaded ;
53
53
}
54
54
55
- export function useLoading (
55
+ export function useIsLoading (
56
56
ref : React . RefObject < HTMLElement > ,
57
57
key ?: string ,
58
58
) : boolean {
59
- return ! useLoaded ( ref , key ) ;
59
+ return ! useIsLoaded ( ref , key ) ;
60
60
}
You can’t perform that action at this time.
0 commit comments