Fix component gallery layout (#888)

This commit is contained in:
hashrock
2022-11-08 11:40:13 +09:00
committed by GitHub
parent fea7a27029
commit 5902be5335
5 changed files with 19 additions and 16 deletions
+8 -7
View File
@@ -25,18 +25,19 @@ export default function CodeBox(props: CodeBoxProps) {
<summary class="text-center cursor-pointer bg-gray-50 select-none text-gray-600 hover:text-gray-800 hover:bg-gray-100 py-2 rounded-b">
Code
</summary>
<code class="relative">
<pre
class="bg-gray-800 text-blue-300 p-2 text-sm rounded whitespace-pre-wrap"
dangerouslySetInnerHTML={{ __html: highlighted }}
/>
<div class="relative">
<pre class="bg-gray-800 text-blue-300 p-2 text-sm rounded whitespace-pre-wrap">
<code
dangerouslySetInnerHTML={{ __html: highlighted }}
/>
</pre>
<button
onClick={onCopy}
class="absolute top-2 right-2 px-3 py-2 border border-gray-400 rounded text-white"
class="absolute top-2 right-2 px-3 py-2 border border-gray-400 rounded text-white bg-gray-800"
>
{copied ? "Copied!" : "Copy"}
</button>
</code>
</div>
</details>
</div>
);