From 6197b2f98e7087ae6a46810aa2d94c23e0290779 Mon Sep 17 00:00:00 2001 From: Fricoben Date: Mon, 2 Dec 2024 12:50:21 +0800 Subject: [PATCH] ref: delete mail subscribe --- components/discount/freeRenewalCheckout.tsx | 14 -------------- components/domains/autorenewal.tsx | 17 +---------------- components/domains/registerV3.tsx | 3 --- components/domains/renewalV2.tsx | 6 +----- components/domains/steps/checkoutCard.tsx | 12 ------------ pages/freerenewal.tsx | 4 ---- pages/register/[domainToRegister].tsx | 4 ---- pages/renewal.tsx | 6 +----- pages/subscription.tsx | 6 +----- 9 files changed, 4 insertions(+), 68 deletions(-) diff --git a/components/discount/freeRenewalCheckout.tsx b/components/discount/freeRenewalCheckout.tsx index 0ea6d7b4..87fa8c36 100644 --- a/components/discount/freeRenewalCheckout.tsx +++ b/components/discount/freeRenewalCheckout.tsx @@ -2,7 +2,6 @@ import React from "react"; import { FunctionComponent, useEffect, useState } from "react"; import Button from "../UI/button"; import { useAccount, useSendTransaction } from "@starknet-react/core"; -import { formatHexString } from "../../utils/stringService"; import { applyRateToBigInt } from "../../utils/feltService"; import styles from "../../styles/components/registerV2.module.css"; import SwissForm from "../domains/swissForm"; @@ -32,13 +31,11 @@ import { areArraysEqual } from "@/utils/arrayService"; import { useFreeRenewalTxPrep } from "@/hooks/checkout/useFreeRenewalTxPrep"; type FreeRenewalCheckoutProps = { - groups: string[]; goBack: () => void; offer: Discount; }; const FreeRenewalCheckout: FunctionComponent = ({ - groups, offer, goBack, }) => { @@ -105,17 +102,6 @@ const FreeRenewalCheckout: FunctionComponent = ({ .catch((err) => console.log("Error on sending metadata:", err)); } - // Subscribe to auto renewal mailing list if renewal box is checked - fetch(`${process.env.NEXT_PUBLIC_SALES_SERVER_LINK}/mail_subscribe`, { - method: "POST", - headers: { "Content-Type": "application/json" }, - body: JSON.stringify({ - tx_hash: formatHexString(renewData.transaction_hash), - groups, - }), - }) - .then((res) => res.json()) - .catch((err) => console.log("Error on registering to email:", err)); addTransaction({ timestamp: Date.now(), diff --git a/components/domains/autorenewal.tsx b/components/domains/autorenewal.tsx index 78df79dd..dc5c2047 100644 --- a/components/domains/autorenewal.tsx +++ b/components/domains/autorenewal.tsx @@ -3,7 +3,6 @@ import { FunctionComponent, useEffect, useState } from "react"; import Button from "../UI/button"; import { useAccount, useSendTransaction } from "@starknet-react/core"; import { - formatHexString, selectedDomainsToArray, } from "../../utils/stringService"; import { applyRateToBigInt } from "../../utils/feltService"; @@ -46,11 +45,8 @@ import useNeedSubscription from "@/hooks/useNeedSubscription"; import AutoRenewalDomainsBox from "./autoRenewalDomainsBox"; import Notification from "../UI/notification"; -type SubscriptionProps = { - groups: string[]; -}; -const Subscription: FunctionComponent = ({ groups }) => { +const Subscription: FunctionComponent = () => { const [isSwissResident, setIsSwissResident] = useState(false); const [salesTaxRate, setSalesTaxRate] = useState(0); const [salesTaxAmount, setSalesTaxAmount] = useState(BigInt(0)); @@ -124,17 +120,6 @@ const Subscription: FunctionComponent = ({ groups }) => { }); } - // Subscribe to auto renewal mailing list if renewal box is checked - fetch(`${process.env.NEXT_PUBLIC_SALES_SERVER_LINK}/mail_subscribe`, { - method: "POST", - headers: { "Content-Type": "application/json" }, - body: JSON.stringify({ - tx_hash: formatHexString(autorenewData.transaction_hash), - groups, - }), - }) - .then((res) => res.json()) - .catch((err) => console.log("Error on registering to email:", err)); addTransaction({ timestamp: Date.now(), diff --git a/components/domains/registerV3.tsx b/components/domains/registerV3.tsx index 7218231f..7b81ea1e 100644 --- a/components/domains/registerV3.tsx +++ b/components/domains/registerV3.tsx @@ -12,14 +12,12 @@ import evergreenDiscounts from "@/utils/discounts/evergreen"; type RegisterV3Props = { domain: string; - groups: string[]; setDomain: (domain: string) => void; }; const RegisterV3: FunctionComponent = ({ domain, setDomain, - groups, }) => { const { address } = useAccount(); const [currentStep, setCurrentStep] = useState(1); @@ -85,7 +83,6 @@ const RegisterV3: FunctionComponent = ({ {currentStep === 3 && ( )} diff --git a/components/domains/renewalV2.tsx b/components/domains/renewalV2.tsx index 2550e06c..b77cf097 100644 --- a/components/domains/renewalV2.tsx +++ b/components/domains/renewalV2.tsx @@ -10,11 +10,8 @@ import SelectPfp from "./steps/selectPfp"; import { StarknetIdJsContext } from "@/context/StarknetIdJsProvider"; import evergreenDiscounts from "@/utils/discounts/evergreen"; -type RenewalProps = { - groups: string[]; -}; -const RenewalV2: FunctionComponent = ({ groups }) => { +const RenewalV2: FunctionComponent = () => { const { address } = useAccount(); const [currentStep, setCurrentStep] = useState(1); const { updateFormState, userNfts, isLoadingNfts } = useContext(FormContext); @@ -95,7 +92,6 @@ const RenewalV2: FunctionComponent = ({ groups }) => { {currentStep === 3 && ( )} diff --git a/components/domains/steps/checkoutCard.tsx b/components/domains/steps/checkoutCard.tsx index 66586ea3..c7935cce 100644 --- a/components/domains/steps/checkoutCard.tsx +++ b/components/domains/steps/checkoutCard.tsx @@ -37,14 +37,12 @@ import { useRenewalTxPrep } from "@/hooks/checkout/useRenewalTxPrep"; type CheckoutCardProps = { type: FormType; - groups: string[]; discount: Upsell; }; const CheckoutCard: FunctionComponent = ({ type, discount, - groups, }) => { const router = useRouter(); const { account, address } = useAccount(); @@ -175,16 +173,6 @@ const CheckoutCard: FunctionComponent = ({ .catch((err) => console.log("Error on sending metadata:", err)); } - fetch(`${process.env.NEXT_PUBLIC_SALES_SERVER_LINK}/mail_subscribe`, { - method: "POST", - headers: { "Content-Type": "application/json" }, - body: JSON.stringify({ - tx_hash: formatHexString(checkoutData.transaction_hash), - groups: renewalBox ? groups : [groups[0]], - }), - }) - .then((res) => res.json()) - .catch((err) => console.log("Error on registering to email:", err)); addTransaction({ timestamp: Date.now(), diff --git a/pages/freerenewal.tsx b/pages/freerenewal.tsx index d63c2a84..9649c108 100644 --- a/pages/freerenewal.tsx +++ b/pages/freerenewal.tsx @@ -44,10 +44,6 @@ const FreeRenewalPage: NextPage = () => { {screen === 2 ? (
diff --git a/pages/register/[domainToRegister].tsx b/pages/register/[domainToRegister].tsx index 03821815..60c58884 100644 --- a/pages/register/[domainToRegister].tsx +++ b/pages/register/[domainToRegister].tsx @@ -31,10 +31,6 @@ const RegistrationPage: NextPage = () => {
diff --git a/pages/renewal.tsx b/pages/renewal.tsx index 651b8024..f5141039 100644 --- a/pages/renewal.tsx +++ b/pages/renewal.tsx @@ -10,11 +10,7 @@ const RenewalPage: NextPage = () => {
- +
diff --git a/pages/subscription.tsx b/pages/subscription.tsx index 9382cde8..9d054b81 100644 --- a/pages/subscription.tsx +++ b/pages/subscription.tsx @@ -8,11 +8,7 @@ const AutoRenewalPage: NextPage = () => { return (
- +
);