mirror of
https://github.com/privacy-scaling-explorations/pse.dev.git
synced 2026-01-10 22:58:06 -05:00
frontend updates and fixes
This commit is contained in:
@@ -1,25 +0,0 @@
|
||||
import { useEffect, useState } from "react"
|
||||
|
||||
/**
|
||||
* @dev This hook is used as helper to fetch content from the server
|
||||
* @returns
|
||||
*/
|
||||
export default function useContent({ lang, id }: any) {
|
||||
const [projectContent, setProjectContent] = useState<any>(null)
|
||||
|
||||
useEffect(() => {
|
||||
const fetchContent = async () => {
|
||||
const [content] = await Promise.all([
|
||||
fetch(
|
||||
`https://raw.githubusercontent.com/privacy-scaling-explorations/pse.dev/main/app/i18n/locales/${lang}/projects/${id}.json`
|
||||
).then((res) => res.json()),
|
||||
])
|
||||
setProjectContent(content)
|
||||
}
|
||||
fetchContent()
|
||||
}, [])
|
||||
|
||||
return {
|
||||
projectContent,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user