added few sections

This commit is contained in:
Daniel Shleifman
2021-05-28 17:33:21 +03:00
parent 461fc9014b
commit 8de8139f87
5 changed files with 402 additions and 242 deletions

View File

@@ -1,5 +1,5 @@
import { useEffect, useRef, useState } from 'react'
import { cacheHost } from 'utils/Hosts'
import { cacheHost, settingsHost } from 'utils/Hosts'
import axios from 'axios'
export const useUpdateCache = hash => {
@@ -71,3 +71,12 @@ export const useCreateCacheMap = cache => {
return cacheMap
}
export const useGetSettings = cache => {
const [settings, setSettings] = useState()
useEffect(() => {
axios.post(settingsHost(), { action: 'get' }).then(({ data }) => setSettings(data))
}, [cache])
return settings
}