Skip to content

Commit

Permalink
fix: changed the code block styles to work on phones
Browse files Browse the repository at this point in the history
  • Loading branch information
joshika39 committed Feb 8, 2025
1 parent 081d63d commit 3c9f02a
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions components/code/code-block.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,16 @@ export default function CodeBlock({children, className, copyString}: {
}) {

return (
<div className={cn('relative bg-gray-300 dark:bg-gray-700 rounded-md flex flex-row p-4 w-full justify-between', className)}>
<pre className={'text-foreground overflow-x-auto content-center'}>
<div
className={cn(
'relative bg-gray-300 grid grid-cols-6 gap-x-2 w-full dark:bg-gray-700 rounded-md p-4 justify-between',
className
)}
>
<pre className={'text-foreground col-span-5 whitespace-pre-wrap w-full content-center overflow-x-auto '}>
{children}
</pre>
<CopyButton content={copyString || children as string} className={''}/>
<CopyButton content={copyString || children as string} className={'m-0 self-center'}/>
</div>
);
}

0 comments on commit 3c9f02a

Please sign in to comment.