fix: fixes survey link share modal and moble nav menu

This commit is contained in:
Anshuman Pandey
2023-08-03 17:13:51 +05:30
parent 73904e11a6
commit 369c9ed7b2
6 changed files with 74 additions and 16 deletions
+5 -3
View File
@@ -1,5 +1,6 @@
"use client";
import { cn } from "@formbricks/lib/cn";
import { DocumentDuplicateIcon } from "@heroicons/react/24/outline";
import Prism from "prismjs";
import "prismjs/themes/prism.css";
@@ -9,15 +10,16 @@ import toast from "react-hot-toast";
interface CodeBlockProps {
children: React.ReactNode;
language: string;
customCodeClass?: string;
}
const CodeBlock: React.FC<CodeBlockProps> = ({ children, language }) => {
const CodeBlock: React.FC<CodeBlockProps> = ({ children, language, customCodeClass = "" }) => {
useEffect(() => {
Prism.highlightAll();
}, [children]);
return (
<div className="group relative mt-4 rounded-md text-sm text-slate-200">
<div className="group relative mt-4 rounded-md text-sm text-slate-200">
<DocumentDuplicateIcon
className="absolute right-4 top-4 z-20 h-5 w-5 cursor-pointer text-slate-600 opacity-0 transition-all duration-150 group-hover:opacity-60"
onClick={() => {
@@ -27,7 +29,7 @@ const CodeBlock: React.FC<CodeBlockProps> = ({ children, language }) => {
}}
/>
<pre>
<code className={`language-${language} whitespace-pre-wrap`}>{children}</code>
<code className={cn(`language-${language} whitespace-pre-wrap`, customCodeClass)}>{children}</code>
</pre>
</div>
);