-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #600 from chromaui/header-footer-updates
update header and footer
- Loading branch information
Showing
7 changed files
with
794 additions
and
624 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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} /> | ||
); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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} | ||
/> | ||
); | ||
}; |
Oops, something went wrong.