-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: move new hompeage to /new slug
- Loading branch information
Showing
4 changed files
with
261 additions
and
82 deletions.
There are no files selected for viewing
175 changes: 115 additions & 60 deletions
175
packages/paste-website/src/components/homepage/HomeHero.tsx
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
76 changes: 76 additions & 0 deletions
76
packages/paste-website/src/components/homepage/NewHomeHero.tsx
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 |
---|---|---|
@@ -0,0 +1,76 @@ | ||
import { Box } from "@twilio-paste/box"; | ||
import { DisplayHeading } from "@twilio-paste/display-heading"; | ||
import { Text } from "@twilio-paste/text"; | ||
import { useTheme } from "@twilio-paste/theme"; | ||
|
||
import { SITE_CONTENT_MAX_WIDTH } from "../../constants"; | ||
import CircleIcon from "../icons/CircleIcon"; | ||
import { BouncyAnchor } from "./BouncyAnchor"; | ||
import { SearchBox } from "./SearchBox"; | ||
import { ComponentShowcase } from "./component-showcase"; | ||
|
||
const NewHomeHero = (): JSX.Element => { | ||
const theme = useTheme(); | ||
return ( | ||
<Box element="HOME_HERO_WRAPPER"> | ||
<Box | ||
paddingX={["space90", "space180"]} | ||
position="relative" | ||
display="grid" | ||
gridTemplateColumns="600px min-content" | ||
maxWidth={SITE_CONTENT_MAX_WIDTH} | ||
marginLeft="auto" | ||
marginRight="auto" | ||
overflow="hidden" | ||
element="HOME_HERO" | ||
> | ||
<Box | ||
display="flex" | ||
flexDirection="column" | ||
rowGap="space130" | ||
paddingTop="space200" | ||
paddingRight="space130" | ||
alignSelf="center" | ||
element="HEADER" | ||
> | ||
<Box display="flex" flexDirection="column" rowGap="space50"> | ||
<DisplayHeading as="h1" variant="displayHeading10" marginBottom="space0"> | ||
Paste | ||
</DisplayHeading> | ||
<Text | ||
as="div" | ||
fontSize="fontSize90" | ||
lineHeight="lineHeight90" | ||
fontWeight="fontWeightSemibold" | ||
letterSpacing="-2%" | ||
> | ||
Build inclusive, delightful customer experiences with Twilio’s open-source design system. | ||
</Text> | ||
</Box> | ||
<SearchBox /> | ||
<Box | ||
display="flex" | ||
flexDirection="column" | ||
rowGap="space50" | ||
fontWeight="fontWeightBold" | ||
fontSize="fontSize60" | ||
lineHeight="lineHeight60" | ||
> | ||
<BouncyAnchor text="Get started for developers" href="/introduction/for-engineers/quickstart" /> | ||
<BouncyAnchor text="Get started for designers" href="/introduction/for-designers/design-guidelines" /> | ||
</Box> | ||
</Box> | ||
<ComponentShowcase /> | ||
</Box> | ||
<Box zIndex="zIndex0" position="absolute" top="50rem" left="40%"> | ||
<CircleIcon | ||
css={{ height: theme.heights.size30, width: theme.widths.size30 }} | ||
color={theme.backgroundColors.colorBackgroundBrandHighlight} | ||
decorative | ||
/> | ||
</Box> | ||
</Box> | ||
); | ||
}; | ||
|
||
export { NewHomeHero }; |
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
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 |
---|---|---|
@@ -0,0 +1,64 @@ | ||
import { Box } from "@twilio-paste/box"; | ||
import type { GetStaticProps, InferGetStaticPropsType } from "next"; | ||
import Head from "next/head"; | ||
import * as React from "react"; | ||
import VisibilitySensor from "react-visibility-sensor"; | ||
|
||
import { Accessibility } from "../../components/homepage/Accessibility"; | ||
import { CommunityOfBuilders } from "../../components/homepage/CommunityOfBuilders"; | ||
import { DesignEfficiency } from "../../components/homepage/DesignEfficiency"; | ||
import { ForTwilioCustomers } from "../../components/homepage/ForTwilioCustomers"; | ||
import { NewHomeHero } from "../../components/homepage/NewHomeHero"; | ||
import { NewSection } from "../../components/homepage/NewSection"; | ||
import { Templates } from "../../components/homepage/Templates"; | ||
import { Themeable } from "../../components/homepage/Themeable"; | ||
import { WeDoTheThinking } from "../../components/homepage/WeDoTheThinking"; | ||
import { SiteWrapper } from "../../components/site-wrapper"; | ||
import { SiteMetaDefaults } from "../../constants"; | ||
import { getNavigationData } from "../../utils/api"; | ||
import type { Feature } from "../../utils/api"; | ||
|
||
const NewHomePage = ({ navigationData }: InferGetStaticPropsType<typeof getStaticProps>): React.ReactElement => { | ||
/* | ||
* Only load the Experiment section iframe when the user scrolls down to | ||
* the Popular section (the section prior) | ||
*/ | ||
const [showIframe, setShowIframe] = React.useState(false); | ||
function handleVisibilityChange(isVisible: boolean): void { | ||
if (!showIframe) { | ||
setShowIframe(isVisible); | ||
} | ||
} | ||
return ( | ||
<SiteWrapper navigationData={navigationData}> | ||
<Head> | ||
<title>{SiteMetaDefaults.TITLE}</title> | ||
<link rel="canonical" href="https://paste.twilio.design/customization" /> | ||
<meta key="description" name="description" content="" /> | ||
</Head> | ||
<NewHomeHero /> | ||
<NewSection /> | ||
<Themeable /> | ||
<ForTwilioCustomers /> | ||
<Templates /> | ||
<DesignEfficiency /> | ||
<CommunityOfBuilders /> | ||
<WeDoTheThinking /> | ||
<Accessibility /> | ||
<VisibilitySensor onChange={handleVisibilityChange} partialVisibility minTopValue={50}> | ||
<Box /> | ||
</VisibilitySensor> | ||
</SiteWrapper> | ||
); | ||
}; | ||
|
||
export const getStaticProps: GetStaticProps<{ navigationData: Feature[] }> = async () => { | ||
const navigationData = await getNavigationData(); | ||
return { | ||
props: { | ||
navigationData, | ||
}, | ||
}; | ||
}; | ||
|
||
export default NewHomePage; |