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
+1 -1
View File
@@ -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)"
/>
);
+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>
);
+1 -1
View File
@@ -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" />
+6 -4
View File
@@ -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) => (
+3 -3
View File
@@ -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}>