lbry-desktop/ui/component/loadingBarOneOff/view.jsx
infinite-persistence 163a10602c
CodeSplit: Show top loading bar while fetching
TODO: Get the primary color programatically
2021-06-25 16:00:46 +08:00

20 lines
478 B
JavaScript

// @flow
import * as React from 'react';
import LoadingBar from 'react-top-loading-bar';
// TODO: Retrieve from CSS?
export const COLOR_LOADING_BAR = '#2bbb90';
function LoadingBarOneOff(props: any) {
const loadingBarRef = React.useRef(null);
React.useEffect(() => {
if (loadingBarRef.current) {
loadingBarRef.current.continuousStart();
}
}, []);
return <LoadingBar color={COLOR_LOADING_BAR} ref={loadingBarRef} />;
}
export default LoadingBarOneOff;