diff --git a/_data/pages/home.yml b/_data/pages/home.yml index 46344751d8..32192abe62 100644 --- a/_data/pages/home.yml +++ b/_data/pages/home.yml @@ -11,7 +11,8 @@ blocks: blocks: - type: page_header title: What do Ethereum + Starknet unlock? - description: "Together the networks unlock Ethereum’s vision for a fairer and + description: + "Together the networks unlock Ethereum’s vision for a fairer and more open internet. Decentralised financial systems. Digital assets. Trustless systems. " withMarginBottom: true @@ -32,7 +33,8 @@ blocks: vertical1: img: /assets/superior-ux.png title: Superior UX - description: "Starknet offers efficient and user-friendly experiences by + description: + "Starknet offers efficient and user-friendly experiences by employing Native Account Abstraction. All accounts are smart accounts: their behavior is determined by their developers rather than at the protocol level. This means unparalleled flexibility in @@ -45,7 +47,8 @@ blocks: vertical2: img: /assets/thriving-ecosystem.png title: Thriving Ecosystem - description: Starknet's meteoric rise as a blockchain ecosystem is fueled by its + description: + Starknet's meteoric rise as a blockchain ecosystem is fueled by its passionate community of developers, users, and partners. With the Starknet Stack evolving at an astounding pace, this vibrant collective has developed the most decentralized Rollup Stack, @@ -72,43 +75,48 @@ blocks: - type: icon_link_card img: /assets/build-tutorials.svg title: Read the Docs - description: Read the official Starknet documentation to build your first + description: + Read the official Starknet documentation to build your first contracts and dapps. linkText: View -> - linkUrl: /tutorials/ + linkUrl: https://docs.starknet.io/ color: red - type: icon_link_card img: /assets/build_read_the_docs.svg title: Read the Starknet Book - description: Developed by the Starknet community, the Starknet book teaches + description: + Developed by the Starknet community, the Starknet book teaches Cairo programming and Starknet development. Start reading and conquer the Ethereum world. linkText: View -> - linkUrl: /documentation/ + linkUrl: https://book.starknet.io/ color: green - type: icon_link_card img: /assets/build_tools_resources.svg title: Set-up a Local Environment - description: Learn how to get your dev environment up and running so you can + description: + Learn how to get your dev environment up and running so you can start building. linkText: View -> - linkUrl: /developers/tools-and-resources/ + linkUrl: https://docs.starknet.io/documentation/getting_started/environment_setup/ color: blue heading_variant: h2 base: 1 md: 3 type: flex_layout lg: 3 - description: "Together the networks unlock Ethereum’s vision for a fairer and + description: + "Together the networks unlock Ethereum’s vision for a fairer and more open internet. Decentralised financial systems. Digital assets. Trustless systems. " - type: ecosystem_block title: Projects exploring new ideas ctaText: Check out all the projects -> - ctakUrl: /ecosystem/dapps/ + ctaUrl: /ecosystem/dapps/ - type: social_block title: Join the biggest community of developers, enthusiasts and explorers - description: Join a community of developers, enthusiasts and explorers, working + description: + Join a community of developers, enthusiasts and explorers, working together to build Starknet and scale Ethereum. - type: flex_layout heading_variant: h2 @@ -116,16 +124,17 @@ blocks: blocks: - type: icon_link_card title: Starknet blog & media - description: Stay up to date with the latest thinking on all things Starknet via + description: + Stay up to date with the latest thinking on all things Starknet via articles, podcasts, and videos. linkText: Learn more -> - linkUrl: "#" + linkUrl: "/posts" img: /assets/blogandmedia.svg - type: icon_link_card title: Community Hub description: Explore opportunities with teams building in the ecosystem. linkText: Learn more -> - linkUrl: "#" + linkUrl: "/community" img: /assets/community-2-.svg dark_img: /assets/community-dark.svg base: 1 @@ -139,19 +148,19 @@ blocks: - type: pattern_card title: View all questions pattern: viewallquestions - link: /learn/frequently-asked-questions + linkUrl: /learn/frequently-asked-questions - type: pattern_card title: What is Starknet? - link: /learn/what-is-starknet + linkUrl: /learn/what-is-starknet pattern: whatisstarknet - type: pattern_card title: How does Starknet work? pattern: howdoesitwork - link: "#" + linkUrl: "/education" - type: pattern_card title: What is Starkex? pattern: whatisstarkex - link: "#" + linkUrl: "https://starkware.co/starkex/" base: 1 md: 2 lg: 4 diff --git a/workspaces/cms-config/src/blocks.ts b/workspaces/cms-config/src/blocks.ts index 51a7bbcbf0..5f8785e476 100644 --- a/workspaces/cms-config/src/blocks.ts +++ b/workspaces/cms-config/src/blocks.ts @@ -456,7 +456,7 @@ export const blocks = [ crowdin: true, }, { - name: "link", + name: "linkUrl", widget: "string", label: "Link url", crowdin: true, @@ -554,7 +554,7 @@ export const blocks = [ crowdin: true, }, { - name: "ctakUrl", + name: "ctaUrl", label: "CTA url", widget: "string", crowdin: true, diff --git a/workspaces/cms-data/src/pages.ts b/workspaces/cms-data/src/pages.ts index 74abe93861..98034ecbfc 100644 --- a/workspaces/cms-data/src/pages.ts +++ b/workspaces/cms-data/src/pages.ts @@ -117,7 +117,7 @@ export interface StatCardsBlock { export interface PatternCardBlock { readonly type: "pattern_card"; readonly title: string; - readonly link: string; + readonly linkUrl: string; readonly pattern: | "viewallquestions" | "howdoesitwork" diff --git a/workspaces/website/src/blocks/EcosystemHomepageBlock.tsx b/workspaces/website/src/blocks/EcosystemHomepageBlock.tsx index ed484313ec..ddd5c055bc 100644 --- a/workspaces/website/src/blocks/EcosystemHomepageBlock.tsx +++ b/workspaces/website/src/blocks/EcosystemHomepageBlock.tsx @@ -5,6 +5,7 @@ import "./OutlineCardsStyle.css"; import { Button } from "@ui/Button"; import { Heading } from "@ui/Typography/Heading"; import { EcosystemBlock as EcosystemBlockType } from "@starknet-io/cms-data/src/pages"; +import { useCMSLink } from "src/utils/useCMSLink"; type Project = { name: string; @@ -83,6 +84,7 @@ interface EcosystemBlockProps extends EcosystemBlockType {} const EcosystemBlock = ({ title, ctaText, ctaUrl }: EcosystemBlockProps) => { const [projects, setProjects] = useState([]); + const { isAbsolute, href } = useCMSLink(ctaUrl); useEffect(() => { const fetchData = async () => { @@ -127,7 +129,7 @@ const EcosystemBlock = ({ title, ctaText, ctaUrl }: EcosystemBlockProps) => { backgroundImage: "url(/assets/outline-bg.svg)", backgroundSize: "130%", backgroundPosition: "center", - marginTop: { base: 0, lg: -100 } + marginTop: { base: 0, lg: -100 }, }} > { variant="outline" mt="140px" bg="brand-secondary-comet-green-3" - href={ctaUrl} + href={href} + isExternal={isAbsolute} > {ctaText} diff --git a/workspaces/website/src/blocks/IconLinkCardBlock.tsx b/workspaces/website/src/blocks/IconLinkCardBlock.tsx index 54f0a069fe..c4ed450ff1 100644 --- a/workspaces/website/src/blocks/IconLinkCardBlock.tsx +++ b/workspaces/website/src/blocks/IconLinkCardBlock.tsx @@ -3,11 +3,13 @@ import { IconLinkCardBlock as IconLinkCardBlockType } from "@starknet-io/cms-dat import { Card, CardBody, CardLink } from "@ui/Card/Card"; import { Heading } from "@ui/Typography/Heading"; import { Text } from "@ui/Typography/Text"; +import { useCMSLink } from "src/utils/useCMSLink"; interface Props extends IconLinkCardBlockType, Omit {} export const IconLinkCardBlock = (props: Props) => { const { img, dark_img, title, description, linkText, linkUrl, color } = props; + const { href, isAbsolute } = useCMSLink(linkUrl || ""); const renderColorValues = (color: string) => { switch (color) { case "red": @@ -34,7 +36,7 @@ export const IconLinkCardBlock = (props: Props) => { }; const colorValues = renderColorValues(color as string); const { colorMode, toggleColorMode } = useColorMode(); - const IconSrc = colorMode === 'light' ? img : dark_img ? dark_img : img; + const IconSrc = colorMode === "light" ? img : dark_img ? dark_img : img; return ( { > - {img ? : null} + {img ? ( + + ) : null} { {linkText ? ( {linkText} diff --git a/workspaces/website/src/blocks/StatCardsBlock.tsx b/workspaces/website/src/blocks/StatCardsBlock.tsx index 15cc268771..0293777dfd 100644 --- a/workspaces/website/src/blocks/StatCardsBlock.tsx +++ b/workspaces/website/src/blocks/StatCardsBlock.tsx @@ -2,6 +2,28 @@ import { Grid, Box } from "@chakra-ui/react"; import { StatCardsBlock as StatCardsBlockType } from "@starknet-io/cms-data/src/pages"; import { StatsCard } from "@ui/Card/StatsCard"; +const statData = [ + { + title: "TPS", + stat: "2.76", + tooltip: "TPS", + }, + { + title: "Cumulative new addresses ", + stat: "67,505", + tooltip: "Cumulative new addresses ", + }, + { + title: "Average block time", + stat: "2min", + tooltip: "Average block time", + }, + { + title: "Value locked in bridge", + stat: "70.4M+", + tooltip: "Value locked in bridge", + }, +]; export const StatCardsBlock = (_: StatCardsBlockType) => { return ( { width="100%" m="0 auto" > - - - - + {statData.map((stat) => ( + + ))} diff --git a/workspaces/website/src/components/Card/AnalyticsCard.tsx b/workspaces/website/src/components/Card/AnalyticsCard.tsx index ee9a05d43d..06759a0f83 100644 --- a/workspaces/website/src/components/Card/AnalyticsCard.tsx +++ b/workspaces/website/src/components/Card/AnalyticsCard.tsx @@ -1,4 +1,10 @@ -import { Box, useBreakpointValue } from "@chakra-ui/react"; +import { + Box, + Link, + LinkBox, + LinkOverlay, + useBreakpointValue, +} from "@chakra-ui/react"; import { Heading } from "@ui/Typography/Heading"; import { CardGradientBorder } from "./components/CardGradientBorder"; import { useAsync } from "react-streaming"; @@ -26,27 +32,38 @@ export const AnalyticsCard = ({ return ( - window.open(type === "twitter" ? "https://twitter.com/Starknet/" : "https://discord.com/invite/qypnmzkhbc", "_blank")}> + - {type === "twitter" && ( - - )} - {type === "discord" && ( - - )} + {type === "twitter" && } + {type === "discord" && } - + ); }; diff --git a/workspaces/website/src/components/Card/PatternCard.tsx b/workspaces/website/src/components/Card/PatternCard.tsx index 35684ec548..41a443cf32 100644 --- a/workspaces/website/src/components/Card/PatternCard.tsx +++ b/workspaces/website/src/components/Card/PatternCard.tsx @@ -3,13 +3,16 @@ import { Heading } from "@ui/Typography/Heading"; import { HiOutlineArrowRight } from "react-icons/hi2"; import { CardGradientBorder } from "./components/CardGradientBorder"; import { PatternCardBlock as PatternCardBlockType } from "@starknet-io/cms-data/src/pages"; +import { useCMSLink } from "src/utils/useCMSLink"; interface PatternCardProps extends PatternCardBlockType {} export const PatternCard = ({ title, - link, + linkUrl, pattern = "viewallquestions", }: PatternCardProps) => { + const { isAbsolute, href } = useCMSLink(linkUrl); + return ( { > {hit.name} - + Learn more{" "} { + const href = link.trim(); + const isAbsolute = isAbsoluteURL(href); + const pageContext = usePageContext(); + const locale = pageContext.locale; + + if (isAbsolute) { + return { + href, + isAbsolute: true, + }; + } + + return { + href: href.startsWith("/") ? `/${locale}${href}` : `/${locale}/${href}`, + isAbsolute: false, + }; +};