feat(directory): add layout scaffold

This commit is contained in:
Haoyu Xu
2023-02-24 19:27:24 -05:00
parent 9c26de493a
commit e98bf8d7ea
18 changed files with 765 additions and 33 deletions

View File

@@ -1,20 +1,28 @@
import {
useState,
useEffect
useEffect,
useContext
} from 'react'
import './home.css'
import { TitleContext } from '@/context/useTitleContext';
export default function Home(props) {
const { title, setTitle } = useContext(TitleContext)
useEffect(() => {
fetch("/_assets/directory.json").then(res => res.json()).then(data => {
console.log(data)
})
}, [])
useEffect(() => {
setTitle('dynamic_compile')
}, [])
return (
<section>
<section>
1233
{title}
<button onClick={() => setTitle('123')}>123</button>
</section>
<section>
22s