Skip to content

Commit

Permalink
opt: style
Browse files Browse the repository at this point in the history
  • Loading branch information
nanqic committed Jan 10, 2024
1 parent b6379d5 commit 01c56e0
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
4 changes: 4 additions & 0 deletions src/assets/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,8 @@ summary svg:hover,
.folder:hover,
details li:hover {
color: forestgreen;
}

.text-editor textarea {
line-height: 1.5;
}
4 changes: 2 additions & 2 deletions src/components/MarkmapHooks.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ const MarkmapHooks = React.memo((props) => {

return (
<React.Fragment>
<div className={`w-full flex flex-col h-screen`}>
<div className={`${props.showEdit && 'relative'} w-full flex flex-col h-screen`}>
<div className="absolute bottom-1 left-1" ref={refToolbar}></div>
<svg className="flex-1" ref={refSvg} />
</div>
<div className="absolute bottom-1 left-1" ref={refToolbar}></div>
</React.Fragment>
);
})
Expand Down
9 changes: 4 additions & 5 deletions src/components/TextEdit.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,18 +129,17 @@ export default function TextEdit({ content, setContent, setEditing }) {
unorderedListCommand,
orderedListCommand,
divider,
help,
divider,
clear,
divider,
help,
divider,
localStorage.getItem("token") && save,
];

return (
<div className='w-2/3 text-sm hidden sm:block sm:visible'>

<div className='text-editor w-2/3 text-sm hidden sm:block sm:visible'>
<MDEditor
height={500}
height="100%"
className="h-3/4 w-full p-2 border bg-gray-100 text-gray-700 rounded"
preview="edit"
onChange={setValue}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/MarkmapLoader.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ const MarkmapLoader = () => {
const listUrl = `${import.meta.env.VITE_SERVER_URL}/api/fs/list?path=markmap`;
const dirsContent = (await postRequest(`${listUrl}/${user}`))?.data.content;
dispatch({ type: 'SET_DIRS', payload: dirsContent?.filter(filterFile).map(x => x.name.slice(0, -3)) });
const dirfiles = await Promise.all(dirsContent?.filter(file => file.is_dir)?.map(async dir => {
const dirfiles = dirsContent && await Promise.all(dirsContent?.filter(file => file.is_dir)?.map(async dir => {
const resp = await postRequest(`${listUrl}/${user}/${dir.name}`);
const files = resp?.data.content.filter(filterFile).map(item => item.name.slice(0, -3));
return { name: dir.name, files };
Expand Down

0 comments on commit 01c56e0

Please sign in to comment.