Skip to content

Commit 68ff0f1

Browse files
authored
improvement: share page google login support (#1085)
* add login with google from share page * Update Items.tsx * Update AuthOverlay.tsx
1 parent 1e13d80 commit 68ff0f1

File tree

3 files changed

+30
-2
lines changed

3 files changed

+30
-2
lines changed

apps/web/app/(org)/dashboard/_components/Navbar/Items.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,8 @@ const AdminNavItems = ({ toggleMobileNav }: Props) => {
204204
className="duration-200 size-3 text-gray-10"
205205
/>
206206
<p className="w-full text-[11px] flex-1 duration-200 truncate leading-0 text-gray-11">
207-
{activeOrg?.organization.customDomain
207+
{activeOrg?.organization.customDomain &&
208+
activeOrg?.organization.domainVerified
208209
? activeOrg?.organization.customDomain
209210
: "No custom domain set"}
210211
</p>

apps/web/app/(org)/login/form.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ const NormalLogin = ({
439439
</motion.div>
440440
<motion.p
441441
layout="position"
442-
className="mt-3 text-xs text-center text-gray-9"
442+
className="mt-3 mb-2 text-xs text-center text-gray-9"
443443
>
444444
Don't have an account?{" "}
445445
<Link

apps/web/app/s/[videoId]/_components/AuthOverlay.tsx

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,13 @@ import { Button, Dialog, DialogContent, Input, LogoBadge } from "@cap/ui";
33
import { faArrowLeft, faEnvelope } from "@fortawesome/free-solid-svg-icons";
44
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
55
import { AnimatePresence } from "framer-motion";
6+
import Image from "next/image";
67
import Link from "next/link";
8+
import { useParams } from "next/navigation";
79
import { signIn } from "next-auth/react";
810
import { useId, useState } from "react";
911
import { toast } from "sonner";
12+
import { trackEvent } from "@/app/utils/analytics";
1013
import OtpForm from "./OtpForm";
1114

1215
interface AuthOverlayProps {
@@ -133,6 +136,7 @@ const StepOne = ({
133136
setLastResendTime: (time: number | null) => void;
134137
emailId: string;
135138
}) => {
139+
const videoId = useParams().videoId;
136140
return (
137141
<form
138142
onSubmit={async (e) => {
@@ -192,6 +196,29 @@ const StepOne = ({
192196
: "Email sent to your inbox"
193197
: "Continue with Email"}
194198
</Button>
199+
<div className="flex gap-4 items-center">
200+
<span className="flex-1 h-px bg-gray-5" />
201+
<p className="text-sm text-center text-gray-10">OR</p>
202+
<span className="flex-1 h-px bg-gray-5" />
203+
</div>
204+
<Button
205+
variant="gray"
206+
type="button"
207+
className="flex gap-2 justify-center items-center my-1 w-full text-sm"
208+
onClick={() => {
209+
trackEvent("auth_started", { method: "google", is_signup: true });
210+
setLoading(true);
211+
signIn("google", {
212+
redirect: false,
213+
callbackUrl: `${window.location.origin}/s/${videoId}`,
214+
});
215+
setLoading(false);
216+
}}
217+
disabled={loading}
218+
>
219+
<Image src="/google.svg" alt="Google" width={16} height={16} />
220+
Login with Google
221+
</Button>
195222
</form>
196223
);
197224
};

0 commit comments

Comments
 (0)