chore: moved to a new branch to save space

This commit is contained in:
Haoyu Xu
2023-03-16 21:49:29 -04:00
commit 59bffecc0f
116 changed files with 23521 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
import { useCallback } from 'react';
import { atom, useAtom } from 'jotai';
const backgroundsAtom = atom([]);
export function useBackgrounds() {
const [backgrounds, setBackgrounds] = useAtom(backgroundsAtom);
const fetchBackgrounds = useCallback(async () => {
const res = await fetch('/_assets/backgrounds.json')
const data = await res.json()
setBackgrounds(data)
}, [setBackgrounds])
return {
backgrounds,
fetchBackgrounds
};
}