Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,14 @@
"@svgr/webpack": "^6.2.0",
"@tailwindcss/forms": "^0.5.1",
"@tailwindcss/typography": "^0.5.2",
"@tiptap/extension-bubble-menu": "^2.0.0-beta.56",
"@tiptap/extension-link": "^2.0.0-beta.37",
"@tiptap/react": "^2.0.0-beta.109",
"@tiptap/starter-kit": "^2.0.0-beta.184",
"autoprefixer": "^10.4.7",
"axios": "^0.26.0",
"chart.js": "^3.7.0",
"draft-js": "^0.11.7",
"ethers": "^5.5.3",
"firebase": "^9.6.5",
"firebase-admin": "^10.0.2",
Expand Down
42 changes: 37 additions & 5 deletions pages/dao/[daoId]/challenges/[challengeId]/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,17 @@ import useMembership from '../../../../../lib/useMembership'
import Link from 'next/link'
import { classNames, formatDate } from '../../../../../lib/utils'
import { SimpleCard } from '../../../../../components/Card'
import ReactMarkdown from 'react-markdown'
import remarkGfm from 'remark-gfm'
import toast from 'react-hot-toast'
import { TextArea } from '@/components/TextArea'
import { FileInput } from '@/components/Input'
import {
useEditor,
EditorContent,
BubbleMenu,
FloatingMenu,
} from '@tiptap/react'
import StarterKit from '@tiptap/starter-kit'

const ProofOfWorkModal = ({ show, onClose, workproof }) => {
const verifications = workproof?.verifications ? Object.values(workproof.verifications) : []
Expand Down Expand Up @@ -379,6 +385,12 @@ const ChallengeDetails = () => {
toast.error(`Something went wrong ${e.message}`,)
}
}
const editor = useEditor({
extensions: [
StarterKit,
],
content: challenge?.description ? `${challenge?.description}`: "",
})

return (
<LayoutWrapper>
Expand All @@ -397,10 +409,30 @@ const ChallengeDetails = () => {
</div>
<div className="flex flex-col w-full pt-16 gap-4 max-w-2xl mx-auto">
<div className="w-full">
<div className="prose prose-sm prose-daonative-text prose-invert text-daonative-text">
<ReactMarkdown remarkPlugins={[remarkGfm]}>
{challenge?.description}
</ReactMarkdown>
<div className="w-full rounded-md bg-daonative-component-bg border-transparent text-daonative-text">
<>
{editor && <BubbleMenu className="bubble-menu" tippyOptions={{ duration: 100 }} editor={editor}>
<button
onClick={() => editor.chain().focus().toggleBold().run()}
className={`p-2 ${editor.isActive('bold') ? 'is-active' : ''}`}
>
Bold
</button>
<button
onClick={() => editor.chain().focus().toggleItalic().run()}
className={`p-2 ${editor.isActive('italic') ? 'is-active' : ''}`}
>
Italic
</button>
<button
onClick={() => editor.chain().focus().toggleStrike().run()}
className={`p-2 ${editor.isActive('strike') ? 'is-active' : ''}`}
>
Strike
</button>
</BubbleMenu>}
<EditorContent editor={editor} />
</>
</div>
</div>
<div className="w-full">
Expand Down
Loading