Moved code into src folder. Added build for component library.

This commit is contained in:
Mike Cao 2023-08-21 02:06:09 -07:00
parent 7a7233ead4
commit ede658771e
490 changed files with 749 additions and 442 deletions

View file

@ -1,27 +0,0 @@
import { useEffect } from 'react';
import useStore, { setConfig } from 'store/app';
import useApi from 'hooks/useApi';
let loading = false;
export function useConfig() {
const { config } = useStore();
const { get } = useApi();
async function loadConfig() {
const data = await get('/config');
loading = false;
setConfig(data);
}
useEffect(() => {
if (!config && !loading) {
loading = true;
loadConfig();
}
}, []);
return config;
}
export default useConfig;