diff --git a/app/(home-pages)/home/Actions/Actions.tsx b/app/(home-pages)/home/Actions/Actions.tsx
index e711d40e..6720edc0 100644
--- a/app/(home-pages)/home/Actions/Actions.tsx
+++ b/app/(home-pages)/home/Actions/Actions.tsx
@@ -5,7 +5,6 @@ import { HelpButton } from "app/[leaflet_id]/actions/HelpButton";
import { AccountSettings } from "./AccountSettings";
import { useIdentityData } from "components/IdentityProvider";
import { useReplicache } from "src/replicache";
-import { LoginActionButton } from "components/LoginButton";
export const Actions = () => {
let { identity } = useIdentityData();
diff --git a/app/(home-pages)/home/LoggedOutWarning.tsx b/app/(home-pages)/home/LoggedOutWarning.tsx
deleted file mode 100644
index b4ca4955..00000000
--- a/app/(home-pages)/home/LoggedOutWarning.tsx
+++ /dev/null
@@ -1,25 +0,0 @@
-"use client";
-import { useIdentityData } from "components/IdentityProvider";
-import { LoginButton } from "components/LoginButton";
-
-export const LoggedOutWarning = (props: {}) => {
- let { identity } = useIdentityData();
- if (identity) return null;
- return (
-
diff --git a/components/LoginButton.tsx b/components/LoginButton.tsx
index f05eaad3..12b62d42 100644
--- a/components/LoginButton.tsx
+++ b/components/LoginButton.tsx
@@ -6,6 +6,11 @@ import { ButtonPrimary } from "./Buttons";
import { ActionButton } from "./ActionBar/ActionButton";
import { AccountSmall } from "./Icons/AccountSmall";
import { useIsMobile } from "src/hooks/isMobile";
+import { HandleInput } from "./Subscribe/HandleSubscribe";
+import { EmailInput } from "./Subscribe/EmailSubscribe";
+import { useState } from "react";
+import { GoToArrow } from "./Icons/GoToArrow";
+import { ToggleGroup } from "./ToggleGroup";
export function LoginButton() {
let identityData = useIdentityData();
@@ -28,16 +33,56 @@ export function LoginActionButton() {
let identityData = useIdentityData();
if (identityData.identity) return null;
let isMobile = useIsMobile();
+ let [state, setState] = useState<"log in" | "sign up" | "email log in">(
+ "log in",
+ );
return (
} label="Sign In" />
}
>
-
+
+ {state === "log in" ? (
+ <>
+
Atmospheric handle
+
+
+
+ >
+ ) : state === "email log in" ? (
+ <>
+
+
+
+ >
+ ) : (
+ <>heckin make a bluesky account yo>
+ )}
+ {/*
*/}
);
}
diff --git a/components/Subscribe/EmailSubscribe.tsx b/components/Subscribe/EmailSubscribe.tsx
index 2e7e6cf2..c8d9cc9d 100644
--- a/components/Subscribe/EmailSubscribe.tsx
+++ b/components/Subscribe/EmailSubscribe.tsx
@@ -5,30 +5,33 @@ import { ButtonPrimary } from "components/Buttons";
import { Input } from "components/Input";
import { Modal } from "components/Modal";
import { useState } from "react";
-import { HandleInputandOAuth, UniversalHandleInfo } from "./HandleSubscribe";
import { EmailSubscribeSuccess } from "./EmailSubscribeSuccess";
+import { GoToArrow } from "components/Icons/GoToArrow";
+import { useToaster } from "components/Toast";
-export const EmailSubscribe = (props: {
- link?: boolean;
+export const EmailInput = (props: {
+ action: "link" | "subscribe" | "login";
autoFocus?: boolean;
- user: {
+ user?: {
loggedIn: boolean;
email: string | undefined;
handle: string | undefined;
};
}) => {
let [value, setValue] = useState(
- props.user.loggedIn && props.user.email ? props.user.email : "",
+ props.user?.loggedIn && props.user?.email ? props.user?.email : "",
);
let [state, setState] = useState<"confirm" | "success">(
- props.user.loggedIn && props.user.email ? "success" : "confirm",
+ props.user?.loggedIn && props.user?.email ? "success" : "confirm",
);
+ let toaster = useToaster();
+
return (
-
- {props.link ? "Link" : "Subscribe"}
-
+
+ {props.action === "login" ? (
+
+ ) : (
+
+ {props.action === "link" ? "Link" : "Subscribe"}
+
+ )}
}
>
{state === "success" ? (
) : (
-
{
- setState("success");
+ props.action === "subscribe"
+ ? setState("success")
+ : props.action === "link"
+ ? toaster({
+ content: (
+ Linked your email!
+ ),
+ type: "success",
+ })
+ : toaster({
+ content: Welcome back!
,
+ type: "success",
+ });
}}
/>
)}
@@ -65,8 +84,8 @@ export const EmailSubscribe = (props: {
);
};
-const EmailSubscribeConfirm = (props: {
- emailInputValue: string;
+export const EmailConfirm = (props: {
+ emailValue: string;
onSubmit: () => void;
}) => {
let inputClassName = "input-with-border text-2xl w-8 h-12 text-center";
@@ -74,13 +93,12 @@ const EmailSubscribeConfirm = (props: {
Confirm your email
Enter the confirmation code sent to
-
{props.emailInputValue}
+
{props.emailValue}
{
props.onSubmit();
- console.log("hello?");
}}
>
diff --git a/components/Subscribe/EmailSubscribeSuccess.tsx b/components/Subscribe/EmailSubscribeSuccess.tsx
index 64169518..5dc339a8 100644
--- a/components/Subscribe/EmailSubscribeSuccess.tsx
+++ b/components/Subscribe/EmailSubscribeSuccess.tsx
@@ -20,3 +20,11 @@ export const EmailSubscribeSuccess = (props: {
);
};
+
+export const EmailLogInSuccess = (props: {}) => {
+ return (
+
+
Welcome!
+
+ );
+};
diff --git a/components/Subscribe/HandleSubscribe.tsx b/components/Subscribe/HandleSubscribe.tsx
index 8a7f7154..ea49bdee 100644
--- a/components/Subscribe/HandleSubscribe.tsx
+++ b/components/Subscribe/HandleSubscribe.tsx
@@ -14,6 +14,7 @@ import {
} from "./Logos";
import { Separator } from "components/Layout";
+import { GoToArrow } from "components/Icons/GoToArrow";
export const SubscribeWithHandle = (props: {
autoFocus?: boolean;
@@ -39,7 +40,7 @@ export const SubscribeWithHandle = (props: {
@@ -61,36 +62,50 @@ export const LinkHandle = (props: { compact?: boolean }) => {
to comment, recommend, and see what your friends are reading
-
+
);
};
-export const HandleInput = (props: { autoFocus?: boolean; link?: boolean }) => {
+export const HandleInput = (props: {
+ autoFocus?: boolean;
+ action?: "subscribe" | "link" | "login";
+ className?: string;
+}) => {
let [handleValue, setHandleValue] = useState("");
return (
-
-
+
+
@
setHandleValue(e.target.value)}
/>
-
- {props.link ? "Link" : "Subscribe"}
-
+ {props.action === "login" ? (
+
+ ) : (
+
+ {props.action === "link"
+ ? "Link"
+ : props.action === "subscribe"
+ ? "Subscribe"
+ : null}
+
+ )}
);
@@ -102,7 +117,7 @@ export const HandleInputandOAuth = (props: {
}) => {
return (
-
+
@@ -143,7 +158,7 @@ export const AtSubscribeSuccess = (props: {}) => {
);
};
-export const UniversalHandleInfo = (props: { trigger?: React.ReactNode }) => {
+export const AtmosphericHandleInfo = (props: { trigger?: React.ReactNode }) => {
return (
- Linked Handle {props.user.handle}
+ Linked Handle
+
+ {props.user.handle}
+
)}
@@ -65,7 +68,7 @@ export const ManageSubscription = (props: {
to get updates right to your inbox!
-
+
) : null}
{!props.user.handle ? (
diff --git a/components/Subscribe/SubscribeButton.tsx b/components/Subscribe/SubscribeButton.tsx
index d1f78b9a..253576f4 100644
--- a/components/Subscribe/SubscribeButton.tsx
+++ b/components/Subscribe/SubscribeButton.tsx
@@ -1,5 +1,5 @@
import { SubscribeWithHandle } from "./HandleSubscribe";
-import { EmailSubscribe } from "./EmailSubscribe";
+import { EmailInput } from "./EmailSubscribe";
import { Modal } from "components/Modal";
import { ButtonPrimary } from "components/Buttons";
import { PostPubInfo } from "app/lish/[did]/[publication]/[rkey]/PostPubInfo";
@@ -48,7 +48,13 @@ export const SubscribeInput = (props: {
return ;
}
if (props.newsletterMode) {
- return ;
+ return (
+
+ );
} else
return (
diff --git a/components/ToggleGroup.tsx b/components/ToggleGroup.tsx
index ebf786ae..f671f52c 100644
--- a/components/ToggleGroup.tsx
+++ b/components/ToggleGroup.tsx
@@ -9,15 +9,15 @@ export function ToggleGroup(props: {
}) {
return (
{props.options.map((option) => (