Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update header and footer #600

Merged
merged 1 commit into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"@astrojs/mdx": "^2.3.1",
"@astrojs/react": "^3.3.0",
"@astrojs/sitemap": "^3.1.4",
"@chromatic-com/tetra": "1.19.2",
"@chromatic-com/tetra": "^2.0.4",
"@docsearch/css": "^3.5.2",
"@radix-ui/react-collapsible": "^1.0.3",
"@radix-ui/react-dropdown-menu": "2.0.5",
Expand Down
886 changes: 722 additions & 164 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

9 changes: 1 addition & 8 deletions src/components/Footer/MarketingFooter.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
import { Footer } from "@chromatic-com/tetra";

import { footerColumns, footerSocialLinks, homeLink } from "./footerData";

interface MarketingFooterProps {
theme?: "dark" | "light";
}

export const MarketingFooter = ({ theme = "light" }: MarketingFooterProps) => (
<Footer
theme={theme}
columns={footerColumns}
socialLinks={footerSocialLinks}
homeLink={homeLink}
/>
<Footer theme={theme} LinkWrapper={undefined as any} />
);
99 changes: 0 additions & 99 deletions src/components/Footer/footerData.ts

This file was deleted.

82 changes: 21 additions & 61 deletions src/components/Header/MarketingHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,80 +1,40 @@
import {
Button,
fontWeight,
Header,
Link,
spacing,
typography,
} from "@chromatic-com/tetra";
import { styled } from "@storybook/theming";
import { Header } from "@chromatic-com/tetra";
import type { FC } from "react";

import { desktopData, mobileData } from "./headerData";
import { links } from "./headerData";
import { styled } from "@storybook/theming";

interface Props {
theme?: "dark" | "light";
}

const MobileButtons = styled.div`
display: flex;
flex-direction: column;
gap: ${spacing[3]};
const Wrapper = styled.span`
display: contents;
`;

const HeaderCTAButton = styled(Button)`
height: ${spacing[8]};
${typography.body14};
font-weight: ${fontWeight.bold};
`;
// Used for tracking sign up links and log which page the conversion happened
export const TrackSignUp = ({ children }: { children: React.ReactNode }) => {
return (
<Wrapper
onClick={() => {
if (window.plausible) {
window.plausible("sign_up");
}
}}
>
{children}
</Wrapper>
);
};

export const MarketingHeader: FC<Props> = ({ theme = "light" }) => {
return (
<Header
fullWidth
desktopActiveId="docs"
theme={theme}
desktopData={desktopData}
mobileData={mobileData}
desktopRight={
<>
<Link
size="md"
weight="bold"
color={theme === "dark" ? "white" : "blue500"}
href="https://www.chromatic.com/start"
>
Sign in
</Link>
<HeaderCTAButton
size="sm"
variant="outline"
color={theme === "dark" ? "white" : "blue"}
href="https://www.chromatic.com/start?startWithSignup=true"
>
Sign up
</HeaderCTAButton>
</>
}
mobileBottom={
<MobileButtons>
<Button
size="sm"
variant="outline"
color="blue"
href="https://www.chromatic.com/start"
>
Sign in
</Button>
<Button
size="sm"
variant="solid"
color="blue"
href="https://www.chromatic.com/start?startWithSignup=true"
>
Sign up
</Button>
</MobileButtons>
}
links={links}
TrackSignUp={TrackSignUp}
/>
);
};
Loading
Loading