Fix component gallery layout (#888)
This commit is contained in:
@@ -4,7 +4,7 @@ export default function Background(props: JSX.HTMLAttributes<HTMLDivElement>) {
|
||||
return (
|
||||
<div
|
||||
{...props}
|
||||
class="bg-gray-200 py-16 px-8 flex items-center justify-center rounded"
|
||||
class="bg-gray-200 py-16 px-8 flex gap-4 items-center justify-center rounded flex-wrap"
|
||||
style="background-image: url(/gallery/grid.svg)"
|
||||
/>
|
||||
);
|
||||
|
||||
@@ -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>
|
||||
);
|
||||
|
||||
@@ -27,7 +27,7 @@ export default function Footer({ children }: Props) {
|
||||
];
|
||||
|
||||
return (
|
||||
<div class="bg-white flex w-full max-w-screen-lg gap-16 px-8 py-8 text-sm">
|
||||
<div class="bg-white flex flex-col md:flex-row w-full max-w-screen-lg gap-8 md:gap-16 px-8 py-8 text-sm">
|
||||
<div class="flex-1">
|
||||
<div class="flex items-center gap-1">
|
||||
<LemonIcon class="inline-block" />
|
||||
|
||||
@@ -12,10 +12,12 @@ export default function Header({ active }: Props) {
|
||||
];
|
||||
|
||||
return (
|
||||
<div class="bg-white w-full max-w-screen-lg py-6 px-8 flex items-center justify-center">
|
||||
<LemonIcon />
|
||||
<div class="text-2xl flex-1 ml-1 font-bold">
|
||||
Fresh
|
||||
<div class="bg-white w-full max-w-screen-lg py-6 px-8 flex flex-col md:flex-row gap-4">
|
||||
<div class="flex items-center flex-1">
|
||||
<LemonIcon />
|
||||
<div class="text-2xl ml-1 font-bold">
|
||||
Fresh
|
||||
</div>
|
||||
</div>
|
||||
<ul class="flex items-center gap-6">
|
||||
{menus.map((menu) => (
|
||||
|
||||
@@ -53,13 +53,13 @@ export default function ComponentGallery(props: ComponentGalleryProps) {
|
||||
<Button>
|
||||
Click me
|
||||
</Button>
|
||||
<Button class="flex gap-1 ml-2">
|
||||
<Button class="flex gap-1">
|
||||
<IconHappy class="w-6 h-6 inline-block text-gray-500" />
|
||||
<div>
|
||||
With an Icon
|
||||
</div>
|
||||
</Button>
|
||||
<Button disabled class="ml-2">
|
||||
<Button disabled>
|
||||
Disabled
|
||||
</Button>
|
||||
</Section>
|
||||
@@ -89,7 +89,7 @@ export default function ComponentGallery(props: ComponentGalleryProps) {
|
||||
source={props.sources.Input}
|
||||
>
|
||||
<Input placeholder="Placeholder" />
|
||||
<Input class="ml-2" placeholder="Disabled" disabled />
|
||||
<Input placeholder="Disabled" disabled />
|
||||
</Section>
|
||||
|
||||
<Section title="Header" source={props.sources.Header}>
|
||||
|
||||
Reference in New Issue
Block a user