clean up some code

This commit is contained in:
Triston Armstrong 2023-12-24 00:11:22 -06:00
parent f8298e7930
commit c245e92fde
3 changed files with 25 additions and 33 deletions

View File

@ -39,11 +39,8 @@ export default function FolderTree(props) {
const currentNode = props.flattenNodes.find(aNode => {
return aNode.id === nodIds
})
// console.log(event)
// console.log(currentNode)
if (currentNode != null && currentNode.routePath != null) {
router.push(currentNode.routePath)
// router.reload()
}
}}
sx={{ flexGrow: 1, maxWidth: 400, overflowY: 'auto' }}

View File

@ -1,15 +1,11 @@
import Head from 'next/head'
// import BasicTree from 'lib/MyFolderTree'
export const siteTitle = 'Digital Backroom - An Internet Archive'
import {Box} from '@mui/material'
export default function Layout({children}) {
return (
<div>
<main className= "theme-light">
{children}
</main>
</div>
)
export default function Layout({ children }) {
return (
<div>
<main className="theme-light">
{children}
</main>
</div>
)
}

View File

@ -1,24 +1,23 @@
import React, {useState} from 'react';
import React, { useState } from 'react';
import MDContent from "./MDContent";
import {v4 as uuidv4} from 'uuid';
import { v4 as uuidv4 } from 'uuid';
function MDContainer({post, fileNames}) {
const [posts, setPosts] = useState([post]);
function MDContainer({ post, fileNames }) {
const [posts, setPosts] = useState([post]);
function handleClick(content) {
// console.log(content)
setPosts(prevPosts => {
return [...prevPosts, content]
})
}
function handleClick(content) {
setPosts(prevPosts => {
return [...prevPosts, content]
})
}
return (
<div className="Container">
{posts.map(p => (
<MDContent key={uuidv4()} content={p} handleOpenNewContent={handleClick} fileNames={fileNames}/>
))}
</div>
);
return (
<div className="Container">
{posts.map(p => (
<MDContent key={uuidv4()} content={p} handleOpenNewContent={handleClick} fileNames={fileNames} />
))}
</div>
);
}
export default MDContainer;