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 => {
|
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' }}
|
||||||
|
@ -1,15 +1,11 @@
|
|||||||
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 (
|
||||||
|
<div>
|
||||||
return (
|
<main className="theme-light">
|
||||||
<div>
|
{children}
|
||||||
<main className= "theme-light">
|
</main>
|
||||||
{children}
|
</div>
|
||||||
</main>
|
)
|
||||||
</div>
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,24 +1,23 @@
|
|||||||
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]
|
})
|
||||||
})
|
}
|
||||||
}
|
|
||||||
|
|
||||||
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>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default MDContainer;
|
export default MDContainer;
|
Loading…
Reference in New Issue
Block a user