Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 78f31cc

Browse filesBrowse files
committed
feat: add btn to create new heading below toc list
1 parent 7bfca1b commit 78f31cc
Copy full SHA for 78f31cc

File tree

Expand file treeCollapse file tree

2 files changed

+7
-3
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+7
-3
lines changed

‎packages/webapp/components/TipTap/tableOfContents/TocDesktop.tsx

Copy file name to clipboardExpand all lines: packages/webapp/components/TipTap/tableOfContents/TocDesktop.tsx
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { useChatStore } from '@stores'
33
import useHandelTocUpdate from './hooks/useHandelTocUpdate'
44
import { RenderTocs } from './RenderTocs'
55
import { DocTitleChatRoomDesktop } from './components/DocTitleChatRoom'
6+
import AppendHeadingButton from '@components/pages/document/components/AppendHeadingButton'
67

78
const TOCDesktop = ({ className }: any) => {
89
const { headingId } = useChatStore((state) => state.chatRoom)
@@ -22,6 +23,7 @@ const TOCDesktop = ({ className }: any) => {
2223
<div className={`${className}`}>
2324
<DocTitleChatRoomDesktop className="mt-1" />
2425
<ul className="toc__list menu p-0">{renderedTocs}</ul>
26+
<AppendHeadingButton className="mt-4" />
2527
</div>
2628
)
2729
}

‎packages/webapp/components/pages/document/components/AppendHeadingButton.tsx

Copy file name to clipboardExpand all lines: packages/webapp/components/pages/document/components/AppendHeadingButton.tsx
+5-3Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { FaPlus } from 'react-icons/fa6'
33
import ENUMS from '@components/TipTap/enums'
44
import { useModal } from '@components/ui/ModalDrawer'
55
import { useStore } from '@stores'
6+
import { MdAdd } from 'react-icons/md'
67

78
const AppendHeadingButton = ({ className }: { className: string }) => {
89
const { close: closeModal } = useModal() || {}
@@ -52,9 +53,10 @@ const AppendHeadingButton = ({ className }: { className: string }) => {
5253
}, [editor])
5354

5455
return (
55-
<div className={`flex justify-center p-3 ${className}`}>
56-
<button className="btn btn-sm btn-block bg-docsy text-white" onClick={appendHeadingToEnd}>
57-
<FaPlus size={22} />
56+
<div className={`p-3 ${className}`}>
57+
<button className="btn btn-sm btn-primary btn-outline btn-block" onClick={appendHeadingToEnd}>
58+
<MdAdd size={20} />
59+
<span className="">Add headings</span>
5860
</button>
5961
</div>
6062
)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.