Replace Folder Tree with MUI implementation.

This commit is contained in:
Tuan Cao 2022-03-23 22:25:39 +07:00
parent b245a3e2c2
commit 6e24e2a309

View File

@ -1,16 +1,13 @@
import Head from "next/head";
import Layout, {siteTitle} from "../components/layout"; import Layout, {siteTitle} from "../components/layout";
import {getSinglePost, getGraphData, getDirectoryData} from "../lib/post"; import {getSinglePost, getGraphData, getDirectoryData, convertObject} from "../lib/post";
import FolderTree from "../components/FolderTree";
import dynamic from 'next/dynamic' export default function Home({content, graphdata, filenames, tree, ...props}) {
const BasicTree = dynamic(() => import('../components/FileNavBar'));
export default function Home({content, graphdata, filenames, directoryTree, ...props}) {
return ( return (
<Layout home> <Layout home>
<section> <section>
{/*<BasicTree directoryTree/>*/} <FolderTree tree={tree}/>
<div dangerouslySetInnerHTML={{__html: content.data}}/> <div dangerouslySetInnerHTML={{__html: content.data}}/>
</section> </section>
</Layout> </Layout>
@ -19,24 +16,14 @@ export default function Home({content, graphdata, filenames, directoryTree, ...p
} }
export function getStaticProps() { export function getStaticProps() {
const tree = convertObject(getDirectoryData());
console.log("getStaticProps")
// const abc =
const convertedData = {name: "Test", children:[
{name: "Test", children:[
{name: "Test", children:[
]}
]}
]}
const contentData = getSinglePost("index"); const contentData = getSinglePost("index");
const graphdata = getGraphData(); const graphdata = getGraphData();
return { return {
props: { props: {
content: contentData, content: contentData,
graphdata: graphdata, graphdata: graphdata,
directoryTree: convertedData, tree: tree
}, },
}; };
} }