Skip to content

Commit

Permalink
Iterate
Browse files Browse the repository at this point in the history
  • Loading branch information
serefyarar committed Aug 21, 2024
1 parent 00b9102 commit 11084a5
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 31 deletions.
7 changes: 2 additions & 5 deletions web-app/src/components/new/AppHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const AppHeader = () => {
<li>
<a
target="_blank"
href="https://mirror.xyz/indexnetwork.eth"
href="https://blog.index.network"
className="hover:underline"
>
BLOG
Expand Down Expand Up @@ -124,10 +124,7 @@ const AppHeader = () => {
</a>
</li>
<li>
<a
href="https://mirror.xyz/indexnetwork.eth"
className="hover:underline"
>
<a href="https://blog.index.network" className="hover:underline">
BLOG
</a>
</li>
Expand Down
3 changes: 3 additions & 0 deletions web-app/src/components/sections/landing/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ const FooterSection = () => {
<div className="flex flex-col gap-4">
<h3>Social</h3>
<ul className="flex flex-col gap-4 opacity-65">
<a href="https://blog.index.network">
<li>Blog</li>
</a>
<a href="https://twitter.com/indexnetwork_">
<li>Twitter</li>
</a>
Expand Down
15 changes: 1 addition & 14 deletions web-app/src/components/sections/landing/Hero.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import Button from "@/components/new/Button";
import { useAuth } from "@/context/AuthContext";
import useTypingAnimation from "@/hooks/useTypingAnimation";
import Image from "next/image";
import { useRouter, useSearchParams } from "next/navigation";
import { useMemo } from "react";
Expand All @@ -10,16 +9,6 @@ const HeroSection = () => {
const query = useSearchParams();
const { connect } = useAuth();

const words = [
"AI Agents",
"Web3 Builders",
"Networks",
"Ecosystems",
"Curious People",
"Communities",
];
const typingText = useTypingAnimation(words);

const allowed = useMemo(() => {
return query.get("allowed") === "true";
}, [query.get("allowed")]);
Expand All @@ -39,9 +28,7 @@ const HeroSection = () => {

<div className="lg:pt-32 font-secondary z-10 flex flex-col items-center justify-center gap-4 px-8 text-center lg:w-[575px] lg:items-start lg:px-0 lg:pr-6 ">
<h1 className="font-title text-center lg:text-start text-[1.9rem] leading-[2.25rem] md:text-4xl lg:text-5xl lg:leading-[3.6rem]">
The First <br />
Discovery Protocol <br /> for{" "}
<span className="text-highlightBlue">{typingText}|</span>
Discovery Protocol
</h1>

<p className="hidden text-start md:block text-base md:text-xl">
Expand Down
26 changes: 16 additions & 10 deletions web-app/src/components/sections/landing/Subscribe.tsx
Original file line number Diff line number Diff line change
@@ -1,42 +1,48 @@
import { useApi } from "@/context/APIContext";
import { useCallback, useState } from "react";
import { useCallback, useState, KeyboardEvent } from "react";
import { useRouter } from "next/navigation";
import toast from "react-hot-toast";

const SubscribeSection = () => {
const [email, setEmail] = useState("");
const { api } = useApi();
const router = useRouter();

const handleSubscribe = useCallback(async () => {
if (!api) return;

if (!email) {
toast.error("Please enter a valid email address");
return;
}
try {
await toast.promise(api!.subscribeToNewsletter(email), {
loading: "Subscribing...",
success: "Subscribed!",
error: (err) => `${err}`,
});
router.push(
`https://blog.index.network/subscribe?email=${email}&source_embed=true`,
);
} catch (error) {
return;
} finally {
setEmail("");
}
}, [api, email]);
}, [api, email, router]);

const handleKeyPress = (event: KeyboardEvent<HTMLInputElement>) => {
if (event.key === "Enter") {
handleSubscribe();
}
};

return (
<section>
<div className="flex flex-col items-center justify-center gap-8 py-16 text-center md:py-24">
<h2 className="font-title text-xl md:text-3xl">
<h2 className="font-title text-xl md:text-3xl">
Stay up to date with our newsletter
</h2>
<div className="rounded-sm border">
<input
className="bg-transparent px-4 py-2"
value={email}
onChange={(e: any) => setEmail(e.target.value)}
onChange={(e) => setEmail(e.target.value)}
onKeyDown={handleKeyPress}
placeholder="Email"
/>
<button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ const WaitBetaModalContent = ({
<div>
<Button
onClick={() => {
window.open("https://sjxy3b643r8.typeform.com/to/phuRF52O");
window.open("https://forms.gle/RDUuZrjUBhQ9SyCTA");
}}
theme="primary"
size="lg"
Expand Down
2 changes: 1 addition & 1 deletion web-app/src/components/site/modal/WaitBetaModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ const WaitBetaModal = ({
<Col pullRight>
<Button
onClick={() => {
window.open("https://sjxy3b643r8.typeform.com/to/phuRF52O");
window.open("https://forms.gle/RDUuZrjUBhQ9SyCTA");
}}
theme="primary"
size="lg"
Expand Down

0 comments on commit 11084a5

Please sign in to comment.