Skip to content

feat: add CodeDisplay component with syntax highlighting and copy-to-clipboard#356

Open
Harbduls wants to merge 11 commits intoSoroScan:mainfrom
Harbduls:feature/code-display-component
Open

feat: add CodeDisplay component with syntax highlighting and copy-to-clipboard#356
Harbduls wants to merge 11 commits intoSoroScan:mainfrom
Harbduls:feature/code-display-component

Conversation

@Harbduls
Copy link
Copy Markdown
Contributor

Closes #312

Adds a reusable CodeDisplay component with a dark terminal-style theme matching the SoroScan design system.

Features
Syntax highlighting via react-syntax-highlighter (Prism) — supports javascript, typescript, python, json, bash and more
Copy-to-clipboard button with "Copied" feedback state and textarea fallback for older browsers
Optional line numbers via showLineNumbers prop
Optional header label via label prop
Horizontal scrolling for long lines — no layout overflow
Terminal-style header bar with language indicator
Usage

Tests
21 unit tests covering rendering, line numbers, copy functionality, feedback state, scroll container, and multi-language support.

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Apr 26, 2026

@Harbduls Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Build code block component with syntax highlighting and copy button

2 participants