Skip to content

Commit

Permalink
docs: avoid "Puckception" in demo
Browse files Browse the repository at this point in the history
This is caused by links in iframes
  • Loading branch information
chrisvxd committed Mar 26, 2024
1 parent bad4f27 commit 54fd993
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 23 deletions.
6 changes: 4 additions & 2 deletions apps/demo/config/components/Footer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ import { ReactNode } from "react";
import { Section } from "../Section";

const FooterLink = ({ children, href }: { children: string; href: string }) => {
const El = href ? "a" : "span";

return (
<li style={{ paddingBottom: 8 }}>
<a
<El
href={href}
style={{
textDecoration: "none",
Expand All @@ -13,7 +15,7 @@ const FooterLink = ({ children, href }: { children: string; href: string }) => {
}}
>
{children}
</a>
</El>
</li>
);
};
Expand Down
12 changes: 7 additions & 5 deletions apps/demo/config/components/Header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ const NavItem = ({ label, href }: { label: string; href: string }) => {

const isActive = navPath === (href.replace("/edit", "") || "/");

const El = href ? "a" : "span";

return (
<a
<El
href={href || "/"}
style={{
textDecoration: "none",
Expand All @@ -21,17 +23,17 @@ const NavItem = ({ label, href }: { label: string; href: string }) => {
}}
>
{label}
</a>
</El>
);
};

const Header = ({ editMode }) => (
<header className={getClassName()}>
<div className={getClassName("logo")}>LOGO</div>
<nav className={getClassName("items")}>
<NavItem label="Home" href={`${editMode ? "/edit" : ""}`} />
<NavItem label="Pricing" href={`/pricing${editMode ? "/edit" : ""}`} />
<NavItem label="About" href={`/about${editMode ? "/edit" : ""}`} />
<NavItem label="Home" href={`${editMode ? "" : "/"}`} />
<NavItem label="Pricing" href={editMode ? "" : "/pricing"} />
<NavItem label="About" href={editMode ? "" : "/about"} />
</nav>
</header>
);
Expand Down
32 changes: 16 additions & 16 deletions apps/demo/config/root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,28 @@ function Root({ children, editMode }: RootProps) {
{children}
<Footer>
<Footer.List title="Section">
<Footer.Link href="#">Label</Footer.Link>
<Footer.Link href="#">Label</Footer.Link>
<Footer.Link href="#">Label</Footer.Link>
<Footer.Link href="#">Label</Footer.Link>
<Footer.Link href="">Label</Footer.Link>
<Footer.Link href="">Label</Footer.Link>
<Footer.Link href="">Label</Footer.Link>
<Footer.Link href="">Label</Footer.Link>
</Footer.List>
<Footer.List title="Section">
<Footer.Link href="#">Label</Footer.Link>
<Footer.Link href="#">Label</Footer.Link>
<Footer.Link href="#">Label</Footer.Link>
<Footer.Link href="#">Label</Footer.Link>
<Footer.Link href="">Label</Footer.Link>
<Footer.Link href="">Label</Footer.Link>
<Footer.Link href="">Label</Footer.Link>
<Footer.Link href="">Label</Footer.Link>
</Footer.List>
<Footer.List title="Section">
<Footer.Link href="#">Label</Footer.Link>
<Footer.Link href="#">Label</Footer.Link>
<Footer.Link href="#">Label</Footer.Link>
<Footer.Link href="#">Label</Footer.Link>
<Footer.Link href="">Label</Footer.Link>
<Footer.Link href="">Label</Footer.Link>
<Footer.Link href="">Label</Footer.Link>
<Footer.Link href="">Label</Footer.Link>
</Footer.List>
<Footer.List title="Section">
<Footer.Link href="#">Label</Footer.Link>
<Footer.Link href="#">Label</Footer.Link>
<Footer.Link href="#">Label</Footer.Link>
<Footer.Link href="#">Label</Footer.Link>
<Footer.Link href="">Label</Footer.Link>
<Footer.Link href="">Label</Footer.Link>
<Footer.Link href="">Label</Footer.Link>
<Footer.Link href="">Label</Footer.Link>
</Footer.List>
</Footer>
</>
Expand Down

0 comments on commit 54fd993

Please sign in to comment.