From 23e02d6615284f614af410fc924f8aa089766590 Mon Sep 17 00:00:00 2001 From: Aamir Azad Date: Tue, 25 Jun 2024 10:22:14 +0530 Subject: [PATCH] Userdata passing works, simplifyed clerk call as well --- bun.lockb | Bin 223716 -> 223748 bytes package.json | 1 + src/app/settings/page.tsx | 64 ++++++++++++++++---------------------- 3 files changed, 28 insertions(+), 37 deletions(-) diff --git a/bun.lockb b/bun.lockb index 1a4a325f05432b246e7c0b5908a66a8c49614891..6ebb93f278a80db9f1f21c121179fdc931b218da 100755 GIT binary patch delta 23760 zcmeHvcYGDq*7nRKhh*r4NH~O&&`U^9PD087DWMp8JA@V>KqQSM(lrMV1rZTO-G(Bf zB1NTR;DQak3U;nu6_BgZtDq=FxhkUgKF{oZASn3a{eACWAM?vI&t7}4S$plZ%e0gE z_j|SOe81NHef831{koK`H#Dujrg`7jG_3|W%3sq$z^lNu!Q)Fxa!ST)T4Tu6D=I80 zMV_|Jp=q@s@AlKQ>fnOxg2LPhnzjB$QO}MduJ3E=adxYP0K0M z+6QV{GZch@X($Lx#mU(vh0_Z(Z33*ZqE`cCc~S1fnKZl|axn5gQwBc-vjJ}^&MoOU zDX(yxmV->%-H&|oamci{*_H=s-r}0l<8j5=<8w+h?JLMsjDi*&nG0r%o=^sSEnE(n z`T04;lX7A;%~$cAR;3=|>|RI4s~Q>)gWiE)WO+-idPcLdruC%lPr>-}W*5xN&n_K5 zx#YI-#n~k}nt@QWaYebs*`;tQe-@jpX_d%lBTFae6fh14mHa-KjXE17?b$7d{+63$ z^n)76;{qg?d8bd#9X}Zgxg|L>a=_&%pnG}fdm1XrE}h(QO3utDV1O0o=N9A^WtWu1 zHk6HCiF`Kx1Y{nU=9CRuuJS*C%x*sjroH`*r2d28>RK5LhRP_9Lk8n>5i-Z!_h44o zTJiD5(m-Mpseh%RKicsfU(i%KMed zR+39g@^Z(af}-|P{uudm=pSH?@(CTJd=N4nm-D-qTo$+*IqnwB3S4;%xJX?Rjj zZi(Gu)q)5xdpavpI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IZqCVr&5QXOZH!qu#WztA6#i?A8k06pJMoA;StoBQiEH7+f{Kli2~o)56?_10hh zWZL8pE@f7JR`##)(>U?<47lrhV#?I3n#%d&)KoOTO4KXEhH{@sErax^7+Hp!iY;O` zBy-Dn`Bl04Vr`kx&uBS8bgw`WTg32kqpj#zVfZUe6&2EKqP&xAU327<8M~T)fyK&8 zD0rb(VsZIz4cm8$0phE2!yzjYE5gc+z{{{4 zCfDfvXS>%W*MH>+H&^J>FU_>8UZPhvraa2k&aEqY9yN8O=lSbXr(E1siHDduVsE99 z*c_iB=9fgZZf7eRHmJ0g89FZf#i>f8n~`Iyv=lvWHCE_1iwQHa)1JN62v!M+qVG)D zkqH--@11GP`OU3yfPU*Fc|Vvb;%+l0$Qc(Ty3aIx#Z$LkG-;O=EPlQX7i4eNrq43I z^TNeapV^q=KDE zX?!7{JJr2D*0tDf>05}mhWN~s%W zc`c4d{k#LkCnH65E&Nx6*s>iH;Ie|nhtFWK$JgS4xXg4>+a9zeRfmv2xT&bqfFv<= zhtb7+im#Ay91wTyF#0va3siSO;q-#yNdw0IPy5r+TRWtQV>{5VX+qy=geBzp%R8UL zBWFH3dSjcQGRVC3o*g){@h<^gKDr&UALM=ACfw+{<+_6jrtpW5i_Keg!7AGe9sJMsO$Z_}mqc`3>N&}TIM*?!NB z$~LS0ekVM2ZTv2yf40~X>J?P4XHH>m*_1f((J7;is6Ao$iGPQBbrRD;y}H%5YVFlw YaDxoKgv2qTz)Qph8sVa}!0W#M1G~67k^lez diff --git a/package.json b/package.json index 95f2f46..c782b3b 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ "dependencies": { "@clerk/nextjs": "^5.1.5", "@clerk/themes": "^2.1.9", + "@clerk/types": "^4.6.1", "@hookform/resolvers": "^3.6.0", "@radix-ui/react-alert-dialog": "^1.0.5", "@radix-ui/react-dropdown-menu": "^2.0.6", diff --git a/src/app/settings/page.tsx b/src/app/settings/page.tsx index 24ab60e..ace6ec4 100644 --- a/src/app/settings/page.tsx +++ b/src/app/settings/page.tsx @@ -30,15 +30,14 @@ import { import { EyeIcon, EyeOffIcon } from "lucide-react"; import type { UsersTableType } from "@/server/db/schema"; -function PaperlessURL({ - setActiveTab, - userData, -}: { +const queryClient = new QueryClient(); + +interface FormProps { setActiveTab: Dispatch>; userData: UsersTableType; -}) { - const { user, isLoaded } = useUser(); - const pathname = usePathname(); +} + +function PaperlessURL({ setActiveTab, userData }: FormProps) { const [isAutofilled, setIsAutofilled] = useState(false); const formSchema = z.object({ URL: z.string(), @@ -51,17 +50,11 @@ function PaperlessURL({ }, }); - if (!isLoaded) { - return Loading...; - } else if (userData.paperlessURL && !isAutofilled) { + if (userData.paperlessURL && !isAutofilled) { form.setValue("URL", userData.paperlessURL); setIsAutofilled(true); } - if (!user) { - return redirect("/sign-in?redirect=" + pathname); - } - async function onSubmit(values: z.infer) { if (values.URL == "") { setActiveTab((prevTab) => prevTab + 2); // Skip api key form @@ -108,15 +101,7 @@ function PaperlessURL({ ); } -function PaperlessToken({ - setActiveTab, - userData, -}: { - setActiveTab: Dispatch>; - userData: UsersTableType; -}) { - const { user, isLoaded } = useUser(); - const pathname = usePathname(); +function PaperlessToken({ setActiveTab, userData }: FormProps) { const [isAutofilled, setIsAutofilled] = useState(false); const [isHidden, setIsHidden] = useState(false); const formSchema = z.object({ @@ -129,17 +114,11 @@ function PaperlessToken({ }, }); - if (!isLoaded) { - return Loading...; - } else if (userData.paperlessToken && !isAutofilled) { + if (userData.paperlessToken && !isAutofilled) { form.setValue("token", userData.paperlessToken); setIsAutofilled(true); } - if (!user) { - return redirect("/sign-in?redirect=" + pathname); - } - async function onSubmit(values: z.infer) { setActiveTab((prevTab) => prevTab + 1); // Increment activeTab @@ -218,10 +197,11 @@ const ProgressIndicator: React.FC = ({ ); }; -const queryClient = new QueryClient(); - -export default function SettingsPage() { +export function Forms() { const [activeTab, setActiveTab] = useState(0); + const { user: clerkUser, isLoaded } = useUser(); + const pathname = usePathname(); + const { data: userData, isLoading } = useQuery({ queryKey: ["userData"], queryFn: async () => { @@ -230,8 +210,10 @@ export default function SettingsPage() { }, }); - if (!userData || isLoading) { + if (!userData || isLoading || !isLoaded) { return Loading...; + } else if (!clerkUser) { + return redirect("/sign-in?redirect=" + pathname); } const formElements = [ @@ -248,14 +230,22 @@ export default function SettingsPage() { ]; return ( <> - - {formElements[activeTab]} - + {formElements[activeTab]} + + ); +} + +export default function SettingsPage() { + return ( + <> + + + );