Add word wrap toggle on code snippets 🔀 · Issue #525 · anoopcodehack/DevBoard · GitHub
Skip to content

Add word wrap toggle on code snippets 🔀 #525

Description

@anoopcodehack

Add word wrap toggle on code snippets 🔀

File: client/src/components/Board/TaskCard.jsx

Long code lines overflow the snippet box 💀
No way to toggle word wrap fr!!

Fix:
const [wrap, setWrap] = useState(false)

<button onClick={(e) => {
e.stopPropagation()
setWrap(v => !v)
}}
className="text-[10px] text-[#555]
hover:text-purple-400 transition">
{wrap ? '↔️ unwrap' : '↩️ wrap'}

<SyntaxHighlighter
wrapLines={wrap}
wrapLongLines={wrap}
...

~6 lines! No backend needed 🎯
Super useful for long code lines!! 🔥

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions