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

cta button #205

Merged
merged 1 commit into from
Aug 22, 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 packages/react-app/src/components/Account.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export default function Account({
const isAnonymous = userRole === USER_ROLES.anonymous;

const connectWallet = (
<Button colorScheme="green" key="loginbutton" onClick={loadWeb3Modal}>
<Button colorScheme="green" key="loginbutton" onClick={loadWeb3Modal} variant="outline">
{connectText || "connect"}
</Button>
);
Expand Down
17 changes: 16 additions & 1 deletion packages/react-app/src/views/HomeView.jsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import React, { useMemo } from "react";
import { Container, Box, Text, Center, useColorModeValue } from "@chakra-ui/react";
import { Container, Box, Text, Center, useColorModeValue, Button } from "@chakra-ui/react";
import ChallengeExpandedCard from "../components/ChallengeExpandedCard";
import { challengeInfo } from "../data/challenges";
import useCustomColorModes from "../hooks/useCustomColorModes";
import HeroLogo from "../components/icons/HeroLogo";
import HeroDiamond from "../components/icons/HeroDiamond";
import { useHistory } from "react-router-dom";

export default function HomeView({ connectedBuilder, userProvider }) {
const history = useHistory();
const { primaryFontColor, bgColor } = useCustomColorModes();
const cardBgColor = useColorModeValue("sre.cardBackground", "sreDark.cardBackground");

Expand All @@ -20,6 +22,16 @@ export default function HomeView({ connectedBuilder, userProvider }) {
);
}, [connectedBuilder]);

const handleCtaClick = () => {
if (window.plausible) {
window.plausible("cta");
}

setTimeout(() => {
history.push(`/challenge/${Object.keys(challengeInfo)[0]}`);
}, 100);
};

return (
<Box>
<Box
Expand Down Expand Up @@ -56,6 +68,9 @@ export default function HomeView({ connectedBuilder, userProvider }) {
>
<HeroLogo maxW="600px" height="auto" />
</Center>
<Button onClick={handleCtaClick} colorScheme="green" mt={4} size="lg">
Start Building on Ethereum
</Button>
</Container>
<Box
bgImg="/assets/header_platform.svg"
Expand Down
Loading