mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-18 23:55:16 +00:00
redeem flow fix
This commit is contained in:
1 parent
e593855367
commit
1fb01ffc11
3 files changed
+36
-12
No files matched your search
@@ -1,10 +1,7 @@
|
||||
import { Button, Container, Label, Panel, TempInput } from "components/common";
|
||||
import React, { useEffect, useState } from "react";
|
||||
import "./BetaKey.scss";
|
||||
import {
|
||||
faKey,
|
||||
faPersonWalkingArrowLoopLeft,
|
||||
} from "@fortawesome/pro-solid-svg-icons";
|
||||
import { faArrowLeft, faKey } from "@fortawesome/pro-solid-svg-icons";
|
||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||
import { RedeemBetaKey } from "@storyteller/components/src/api/beta_key/RedeemBetaKey";
|
||||
import { Link, useHistory, useParams } from "react-router-dom";
|
||||
@@ -226,9 +223,22 @@ export default function RedeemBetaKeyPage() {
|
||||
/>
|
||||
</div>
|
||||
</Panel>
|
||||
{/* <p className="fs-9 mt-3">
|
||||
Don't have a beta key? Join the
|
||||
<span
|
||||
onClick={openModal}
|
||||
className="text-red"
|
||||
style={{ cursor: "pointer" }}
|
||||
>
|
||||
{" "}
|
||||
waitlist
|
||||
</span>{" "}
|
||||
now!
|
||||
</p> */}
|
||||
<p>
|
||||
<Link to="/">
|
||||
<FontAwesomeIcon icon={faPersonWalkingArrowLoopLeft} /> Back Home
|
||||
<FontAwesomeIcon icon={faArrowLeft} className="me-2" />
|
||||
Back Home
|
||||
</Link>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
+9
-4
@@ -1,4 +1,4 @@
|
||||
import React, { useState } from "react";
|
||||
import React, { useCallback, useState } from "react";
|
||||
import { Widget } from "@typeform/embed-react";
|
||||
import ModalHeader from "components/modals/ModalHeader";
|
||||
import { set } from "local-storage";
|
||||
@@ -9,13 +9,16 @@ interface EmailSignUpProps {
|
||||
handleClose?: any;
|
||||
}
|
||||
|
||||
export default function EmailSignUp({
|
||||
export function EmailSignUp({
|
||||
mobile,
|
||||
showHanashi = true,
|
||||
handleClose,
|
||||
}: EmailSignUpProps) {
|
||||
const [isHanashiHovered, setIsHanashiHovered] = useState(false);
|
||||
|
||||
const handleMouseEnter = useCallback(() => setIsHanashiHovered(true), []);
|
||||
const handleMouseLeave = useCallback(() => setIsHanashiHovered(false), []);
|
||||
|
||||
return (
|
||||
<div>
|
||||
{handleClose && (
|
||||
@@ -43,8 +46,8 @@ export default function EmailSignUp({
|
||||
: "/images/landing/hanashi-demo-1.webp"
|
||||
}
|
||||
alt="Hanashi Demo"
|
||||
onMouseEnter={() => setIsHanashiHovered(true)}
|
||||
onMouseLeave={() => setIsHanashiHovered(false)}
|
||||
onMouseEnter={handleMouseEnter}
|
||||
onMouseLeave={handleMouseLeave}
|
||||
draggable="false"
|
||||
style={{
|
||||
top: "-49%",
|
||||
@@ -67,3 +70,5 @@ export default function EmailSignUp({
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default React.memo(EmailSignUp);
|
||||
@@ -262,15 +262,24 @@ function SignupPage(props: Props) {
|
||||
};
|
||||
|
||||
const redirectLink = queryParams.get("redirect");
|
||||
const redirectSignUpLink = "/beta-key/redeem?redirect=signup";
|
||||
|
||||
const afterSignupRedirect = async () => {
|
||||
const maybeInternalPlanKey = parsedQueryString["sub"] as string | undefined;
|
||||
|
||||
if (maybeInternalPlanKey !== undefined) {
|
||||
return await BeginStripeCheckoutFlow(maybeInternalPlanKey);
|
||||
if (domain.titlePart === "FakeYou") {
|
||||
if (maybeInternalPlanKey !== undefined) {
|
||||
return await BeginStripeCheckoutFlow(maybeInternalPlanKey);
|
||||
}
|
||||
}
|
||||
|
||||
let redirectUrl = redirectLink || WebUrl.pricingPageWithReferer("signup");
|
||||
let redirectUrl = redirectLink || "/";
|
||||
if (domain.titlePart === "Storyteller AI") {
|
||||
redirectUrl = redirectSignUpLink;
|
||||
if (redirectUrl === redirectSignUpLink) {
|
||||
sessionStorage.setItem("redirected", "true");
|
||||
}
|
||||
}
|
||||
history.push(redirectUrl);
|
||||
|
||||
return true;
|
||||
|
||||
Reference in new issue
Block a user