-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(GIST-41): added syntax highlighting (#12)
* feat(GIST-41): added syntax highlighting * fix(GIST-41): deleted higlight js
- Loading branch information
1 parent
f7c1cda
commit 165276b
Showing
7 changed files
with
954 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import React, { useEffect } from "react"; | ||
import CodeEditor from "@uiw/react-textarea-code-editor"; | ||
import { cn } from "@/lib/utils"; | ||
|
||
export interface CodeareaProps | ||
extends React.TextareaHTMLAttributes<HTMLTextAreaElement> { | ||
className?: string; | ||
language?: string; | ||
} | ||
|
||
const Codearea = ({ className, language, ...props }: CodeareaProps) => { | ||
return ( | ||
<CodeEditor | ||
value={props.value} | ||
language={language} | ||
onChange={props.onChange} | ||
className={cn( | ||
"flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground outline-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50", | ||
className, | ||
)} | ||
style={{ | ||
backgroundColor: "#0C0D0E", | ||
fontFamily: | ||
"ui-monospace,SFMono-Regular,SF Mono,Consolas,Liberation Mono,Menlo,monospace", | ||
}} | ||
/> | ||
); | ||
}; | ||
|
||
Codearea.displayName = "Codearea"; | ||
|
||
export { Codearea }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,24 @@ | ||
import * as React from 'react' | ||
import * as React from "react"; | ||
|
||
import { cn } from '@/lib/utils' | ||
import { cn } from "@/lib/utils"; | ||
|
||
export interface TextareaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {} | ||
export interface TextareaProps | ||
extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {} | ||
|
||
const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(({ className, ...props }, ref) => { | ||
return ( | ||
<textarea | ||
className={cn( | ||
'flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50', | ||
className | ||
)} | ||
ref={ref} | ||
{...props} | ||
/> | ||
) | ||
}) | ||
Textarea.displayName = 'Textarea' | ||
const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>( | ||
({ className, ...props }, ref) => { | ||
return ( | ||
<textarea | ||
className={cn( | ||
"flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground outline-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50", | ||
className, | ||
)} | ||
ref={ref} | ||
{...props} | ||
/> | ||
); | ||
}, | ||
); | ||
Textarea.displayName = "Textarea"; | ||
|
||
export { Textarea } | ||
export { Textarea }; |
Oops, something went wrong.