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 => { const currentNode = props.flattenNodes.find(aNode => {
return aNode.id === nodIds return aNode.id === nodIds
}) })
// console.log(event)
// console.log(currentNode)
if (currentNode != null && currentNode.routePath != null) { if (currentNode != null && currentNode.routePath != null) {
router.push(currentNode.routePath) router.push(currentNode.routePath)
// router.reload()
} }
}} }}
sx={{ flexGrow: 1, maxWidth: 400, overflowY: 'auto' }} sx={{ flexGrow: 1, maxWidth: 400, overflowY: 'auto' }}

View File

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

View File

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