From 6806b9178e93fd6ff57df0854345eb609bfe60e4 Mon Sep 17 00:00:00 2001 From: KMKoushik Date: Sat, 18 May 2024 18:18:28 +1000 Subject: [PATCH] Update landing page --- apps/marketing/src/app/IntegrationCode.tsx | 120 +++++++++++ apps/marketing/src/app/page.tsx | 186 ++---------------- .../marketing/src/components/landind-page.tsx | 65 ++++++ 3 files changed, 203 insertions(+), 168 deletions(-) create mode 100644 apps/marketing/src/app/IntegrationCode.tsx create mode 100644 apps/marketing/src/components/landind-page.tsx diff --git a/apps/marketing/src/app/IntegrationCode.tsx b/apps/marketing/src/app/IntegrationCode.tsx new file mode 100644 index 0000000..39359ee --- /dev/null +++ b/apps/marketing/src/app/IntegrationCode.tsx @@ -0,0 +1,120 @@ +"use client"; + +import { Code } from "@unsend/ui/src/code"; + +const jsCode = `const requestOptions = { + method: "POST", + headers: { + "Accept": "application/json", + "Content-Type": "application/json", + "Authorization": "Bearer us_1a2b3c4d5e6f7f8g" + }, + body: JSON.stringify({ + "to": "test@company.com", + "from": "hello@unsend.dev", + "subject": "Unsend email", + "html": "

Unsend is the best open source product to send emails

" + }), +}; + +fetch("http://unsend.dev/api/v1/emails", requestOptions) + .then(response => response.text()) + .then(result => console.log(result)) + .catch(error => console.error(error)); +`; + +const pythonCode = `import requests +import json + +url = "http://unsend.dev/api/v1/emails" + +payload = json.dumps({ + "to": "test@company.com", + "from": "hello@unsend.dev", + "subject": "Unsend email", + "html": "

Unsend is the best open source product to send emails

" +}) +headers = { + 'Accept': 'application/json', + 'Content-Type': 'application/json', + 'Authorization': 'Bearer us_1a2b3c4d5e6f7f8g' +} + +response = requests.request("POST", url, headers=headers, data=payload) + +print(response.text)`; + +const rubyCode = `require 'uri' +require 'net/http' +require 'json' + +url = URI("http://unsend.dev/api/v1/emails") + +http = Net::HTTP.new(url.host, url.port) +request = Net::HTTP::Post.new(url) +request["Accept"] = 'application/json' +request["Content-Type"] = 'application/json' +request["Authorization"] = 'Bearer us_1a2b3c4d5e6f7f8g' +request.body = JSON.dump({ + "to" => "test@company.com", + "from" => "hello@unsend.dev", + "subject" => "Unsend email", + "html" => "

Unsend is the best open source product to send emails

" +}) + +response = http.request(request) +puts response.read_body`; + +const phpCode = `$url = "http://unsend.dev/api/v1/emails"; + +$payload = json_encode(array( + "to" => "test@company.com", + "from" => "hello@unsend.dev", + "subject" => "Unsend email", + "html" => "

Unsend is the best open source product to send emails

" +)); + +$headers = array( + "Accept: application/json", + "Content-Type: application/json", + "Authorization: Bearer us_1a2b3c4d5e6f7f8g" +); + +$ch = curl_init($url); +curl_setopt($ch, CURLOPT_POST, true); +curl_setopt($ch, CURLOPT_POSTFIELDS, $payload); +curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); +curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + +$response = curl_exec($ch); +if (curl_errno($ch)) { + echo 'Error:' . curl_error($ch); +} else { + echo $response; +}`; + +const cUrl = `curl --location 'https://unsend.dev/v1/emails' \\ +--header 'Accept: application/json' \\ +--header 'Content-Type: application/json' \\ +--header 'Authorization: Bearer us_44c1071bd30058322f89a09805522d7341a47b5e' \\ +--data-raw '{ + "to": "test@company.com", + "from": "hello@unsend.dev", + "subject": "Unsend email", + "html": "

Unsend is the best open source product to send emails

", +}'`; + +export default function IntegrationCode() { + return ( + + ); +} diff --git a/apps/marketing/src/app/page.tsx b/apps/marketing/src/app/page.tsx index 450f997..7d170c4 100644 --- a/apps/marketing/src/app/page.tsx +++ b/apps/marketing/src/app/page.tsx @@ -1,11 +1,7 @@ -"use client"; - -import { motion } from "framer-motion"; import { RocketLaunchIcon, EnvelopeIcon, MegaphoneIcon, - DevicePhoneMobileIcon, } from "@heroicons/react/24/solid"; import { Heading1, @@ -19,112 +15,15 @@ import { ListOrdered, } from "lucide-react"; import { formatDate } from "date-fns"; -import { Code } from "@unsend/ui/src/code"; import { TextWithCopyButton } from "@unsend/ui/src/text-with-copy"; import Link from "next/link"; import Image from "next/image"; - -const jsCode = `const requestOptions = { - method: "POST", - headers: { - "Accept": "application/json", - "Content-Type": "application/json", - "Authorization": "Bearer us_1a2b3c4d5e6f7f8g" - }, - body: JSON.stringify({ - "to": "test@company.com", - "from": "hello@unsend.dev", - "subject": "Unsend email", - "html": "

Unsend is the best open source product to send emails

" - }), -}; - -fetch("http://unsend.dev/api/v1/emails", requestOptions) - .then(response => response.text()) - .then(result => console.log(result)) - .catch(error => console.error(error)); -`; - -const pythonCode = `import requests -import json - -url = "http://unsend.dev/api/v1/emails" - -payload = json.dumps({ - "to": "test@company.com", - "from": "hello@unsend.dev", - "subject": "Unsend email", - "html": "

Unsend is the best open source product to send emails

" -}) -headers = { - 'Accept': 'application/json', - 'Content-Type': 'application/json', - 'Authorization': 'Bearer us_1a2b3c4d5e6f7f8g' -} - -response = requests.request("POST", url, headers=headers, data=payload) - -print(response.text)`; - -const rubyCode = `require 'uri' -require 'net/http' -require 'json' - -url = URI("http://unsend.dev/api/v1/emails") - -http = Net::HTTP.new(url.host, url.port) -request = Net::HTTP::Post.new(url) -request["Accept"] = 'application/json' -request["Content-Type"] = 'application/json' -request["Authorization"] = 'Bearer us_1a2b3c4d5e6f7f8g' -request.body = JSON.dump({ - "to" => "test@company.com", - "from" => "hello@unsend.dev", - "subject" => "Unsend email", - "html" => "

Unsend is the best open source product to send emails

" -}) - -response = http.request(request) -puts response.read_body`; - -const phpCode = `$url = "http://unsend.dev/api/v1/emails"; - -$payload = json_encode(array( - "to" => "test@company.com", - "from" => "hello@unsend.dev", - "subject" => "Unsend email", - "html" => "

Unsend is the best open source product to send emails

" -)); - -$headers = array( - "Accept: application/json", - "Content-Type: application/json", - "Authorization: Bearer us_1a2b3c4d5e6f7f8g" -); - -$ch = curl_init($url); -curl_setopt($ch, CURLOPT_POST, true); -curl_setopt($ch, CURLOPT_POSTFIELDS, $payload); -curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); -curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - -$response = curl_exec($ch); -if (curl_errno($ch)) { - echo 'Error:' . curl_error($ch); -} else { - echo $response; -}`; - -const cUrl = `curl --location 'https://unsend.dev/v1/emails' \\ ---header 'Accept: application/json' \\ ---header 'Content-Type: application/json' \\ ---header 'Authorization: Bearer us_44c1071bd30058322f89a09805522d7341a47b5e' \\ ---data-raw '{ - "to": "test@company.com", - "from": "hello@unsend.dev", - "subject": "Unsend email", - "html": "

Unsend is the best open source product to send emails

", -}'`; +import IntegrationCode from "./IntegrationCode"; +import { + GithubStarButton, + HeroImage, + JoinWaitlist, +} from "~/components/landind-page"; export default function Home() { return ( @@ -135,7 +34,7 @@ export default function Home() { Unsend
- {/* + - */} + -
- - - Join the waitlist - +
+ +
-
- - App - + +
{/* */} @@ -316,7 +188,7 @@ export default function Home() {
-
+
@@ -376,40 +248,18 @@ export default function Home() { }} > */}
- +
{/* */}
-
-
- - - Join the waitlist - -
-
+
- {/* + - */} + + + Join the waitlist + + ); +} + +export async function GithubStarButton() { + return ( + + + + + Star us on github + + ); +} + +export async function HeroImage() { + return ( + + + + ); +}