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 ( return (
<div <div
{...props} {...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)" 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"> <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 Code
</summary> </summary>
<code class="relative"> <div class="relative">
<pre <pre class="bg-gray-800 text-blue-300 p-2 text-sm rounded whitespace-pre-wrap">
class="bg-gray-800 text-blue-300 p-2 text-sm rounded whitespace-pre-wrap" <code
dangerouslySetInnerHTML={{ __html: highlighted }} dangerouslySetInnerHTML={{ __html: highlighted }}
/> />
</pre>
<button <button
onClick={onCopy} 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"} {copied ? "Copied!" : "Copy"}
</button> </button>
</code> </div>
</details> </details>
</div> </div>
); );
+1 -1
View File
@@ -27,7 +27,7 @@ export default function Footer({ children }: Props) {
]; ];
return ( 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-1">
<div class="flex items-center gap-1"> <div class="flex items-center gap-1">
<LemonIcon class="inline-block" /> <LemonIcon class="inline-block" />
+6 -4
View File
@@ -12,10 +12,12 @@ export default function Header({ active }: Props) {
]; ];
return ( return (
<div class="bg-white w-full max-w-screen-lg py-6 px-8 flex items-center justify-center"> <div class="bg-white w-full max-w-screen-lg py-6 px-8 flex flex-col md:flex-row gap-4">
<LemonIcon /> <div class="flex items-center flex-1">
<div class="text-2xl flex-1 ml-1 font-bold"> <LemonIcon />
Fresh <div class="text-2xl ml-1 font-bold">
Fresh
</div>
</div> </div>
<ul class="flex items-center gap-6"> <ul class="flex items-center gap-6">
{menus.map((menu) => ( {menus.map((menu) => (
+3 -3
View File
@@ -53,13 +53,13 @@ export default function ComponentGallery(props: ComponentGalleryProps) {
<Button> <Button>
Click me Click me
</Button> </Button>
<Button class="flex gap-1 ml-2"> <Button class="flex gap-1">
<IconHappy class="w-6 h-6 inline-block text-gray-500" /> <IconHappy class="w-6 h-6 inline-block text-gray-500" />
<div> <div>
With an Icon With an Icon
</div> </div>
</Button> </Button>
<Button disabled class="ml-2"> <Button disabled>
Disabled Disabled
</Button> </Button>
</Section> </Section>
@@ -89,7 +89,7 @@ export default function ComponentGallery(props: ComponentGalleryProps) {
source={props.sources.Input} source={props.sources.Input}
> >
<Input placeholder="Placeholder" /> <Input placeholder="Placeholder" />
<Input class="ml-2" placeholder="Disabled" disabled /> <Input placeholder="Disabled" disabled />
</Section> </Section>
<Section title="Header" source={props.sources.Header}> <Section title="Header" source={props.sources.Header}>