clean up some code
This commit is contained in:
parent
f8298e7930
commit
c245e92fde
@ -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' }}
|
||||
|
@ -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>
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
export default MDContainer;
|
||||
|
Loading…
Reference in New Issue
Block a user