mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
feat: additional changes
This commit is contained in:
parent
2ae8dbeba5
commit
25ac82f4ad
4 changed files with 30 additions and 15 deletions
|
|
@ -10,11 +10,11 @@ import * as Form from '@radix-ui/react-form'
|
||||||
import { useFormik } from 'formik'
|
import { useFormik } from 'formik'
|
||||||
import { getOrgLogoMediaDirectory } from '@services/media/media'
|
import { getOrgLogoMediaDirectory } from '@services/media/media'
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { AlertTriangle } from 'lucide-react'
|
import { AlertTriangle, UserRoundPlus } from 'lucide-react'
|
||||||
import { useRouter } from 'next/navigation'
|
import { useRouter } from 'next/navigation'
|
||||||
import Link from 'next/link'
|
import Link from 'next/link'
|
||||||
import { signIn } from "next-auth/react"
|
import { signIn } from "next-auth/react"
|
||||||
import { getUriWithOrg } from '@services/config/config'
|
import { getUriWithOrg, getUriWithoutOrg } from '@services/config/config'
|
||||||
import { useLHSession } from '@components/Contexts/LHSessionContext'
|
import { useLHSession } from '@components/Contexts/LHSessionContext'
|
||||||
|
|
||||||
interface LoginClientProps {
|
interface LoginClientProps {
|
||||||
|
|
@ -176,11 +176,18 @@ const LoginClient = (props: LoginClientProps) => {
|
||||||
</Form.Submit>
|
</Form.Submit>
|
||||||
</div>
|
</div>
|
||||||
</FormLayout>
|
</FormLayout>
|
||||||
<div className='flex h-0.5 rounded-2xl bg-slate-100 mt-5 mb-5 mx-10'></div>
|
<div className='flex h-0.5 rounded-2xl bg-slate-100 mt-5 mx-10'></div>
|
||||||
<button onClick={() => signIn('google', { callbackUrl: '/redirect_from_auth' })} className="flex justify-center py-3 text-md w-full bg-white text-slate-600 space-x-3 font-semibold text-center p-2 rounded-md shadow hover:cursor-pointer">
|
<div className='flex justify-center py-5 mx-auto'>OR </div>
|
||||||
<img src="https://fonts.gstatic.com/s/i/productlogos/googleg/v6/24px.svg" alt="" />
|
<div className='flex flex-col space-y-4'>
|
||||||
<span>Sign in with Google</span>
|
<Link href={{ pathname: getUriWithoutOrg('/signup'), query: props.org.slug ? { orgslug: props.org.slug } : null }} className="flex justify-center items-center py-3 text-md w-full bg-gray-800 text-gray-300 space-x-3 font-semibold text-center p-2 rounded-md shadow hover:cursor-pointer">
|
||||||
</button>
|
<UserRoundPlus size={17} />
|
||||||
|
<span>Sign up</span>
|
||||||
|
</Link>
|
||||||
|
<button onClick={() => signIn('google', { callbackUrl: '/redirect_from_auth' })} className="flex justify-center py-3 text-md w-full bg-white text-slate-600 space-x-3 font-semibold text-center p-2 rounded-md shadow hover:cursor-pointer">
|
||||||
|
<img src="https://fonts.gstatic.com/s/i/productlogos/googleg/v6/24px.svg" alt="" />
|
||||||
|
<span>Sign in with Google</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@ import { AlertTriangle, Check, User } from 'lucide-react'
|
||||||
import Link from 'next/link'
|
import Link from 'next/link'
|
||||||
import { signUpWithInviteCode } from '@services/auth/auth'
|
import { signUpWithInviteCode } from '@services/auth/auth'
|
||||||
import { useOrg } from '@components/Contexts/OrgContext'
|
import { useOrg } from '@components/Contexts/OrgContext'
|
||||||
|
import { signIn } from 'next-auth/react'
|
||||||
|
|
||||||
const validate = (values: any) => {
|
const validate = (values: any) => {
|
||||||
const errors: any = {}
|
const errors: any = {}
|
||||||
|
|
@ -92,7 +93,7 @@ function InviteOnlySignUpComponent(props: InviteOnlySignUpProps) {
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
useEffect(() => {}, [org])
|
useEffect(() => { }, [org])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="login-form m-auto w-72">
|
<div className="login-form m-auto w-72">
|
||||||
|
|
@ -180,6 +181,13 @@ function InviteOnlySignUpComponent(props: InviteOnlySignUpProps) {
|
||||||
</Form.Submit>
|
</Form.Submit>
|
||||||
</div>
|
</div>
|
||||||
</FormLayout>
|
</FormLayout>
|
||||||
|
<div>
|
||||||
|
<div className='flex h-0.5 rounded-2xl bg-slate-100 mt-5 mb-5 mx-10'></div>
|
||||||
|
<button onClick={() => signIn('google')} className="flex justify-center py-3 text-md w-full bg-white text-slate-600 space-x-3 font-semibold text-center p-2 rounded-md shadow hover:cursor-pointer">
|
||||||
|
<img src="https://fonts.gstatic.com/s/i/productlogos/googleg/v6/24px.svg" alt="" />
|
||||||
|
<span>Sign in with Google</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -89,7 +89,7 @@ function OpenSignUpComponent() {
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
useEffect(() => {}, [org])
|
useEffect(() => { }, [org])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="login-form m-auto w-72">
|
<div className="login-form m-auto w-72">
|
||||||
|
|
@ -178,11 +178,11 @@ function OpenSignUpComponent() {
|
||||||
</div>
|
</div>
|
||||||
</FormLayout>
|
</FormLayout>
|
||||||
<div>
|
<div>
|
||||||
<div className='flex h-0.5 rounded-2xl bg-slate-100 mt-5 mb-5 mx-10'></div>
|
<div className='flex h-0.5 rounded-2xl bg-slate-100 mt-5 mb-5 mx-10'></div>
|
||||||
<button onClick={() => signIn('google')} className="flex justify-center py-3 text-md w-full bg-white text-slate-600 space-x-3 font-semibold text-center p-2 rounded-md shadow hover:cursor-pointer">
|
<button onClick={() => signIn('google')} className="flex justify-center py-3 text-md w-full bg-white text-slate-600 space-x-3 font-semibold text-center p-2 rounded-md shadow hover:cursor-pointer">
|
||||||
<img src="https://fonts.gstatic.com/s/i/productlogos/googleg/v6/24px.svg" alt="" />
|
<img src="https://fonts.gstatic.com/s/i/productlogos/googleg/v6/24px.svg" alt="" />
|
||||||
<span>Sign in with Google</span>
|
<span>Sign in with Google</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ export function OrgProvider({ children, orgslug }: { children: React.ReactNode,
|
||||||
return (
|
return (
|
||||||
<InfoUI
|
<InfoUI
|
||||||
href={getUriWithoutOrg(`/signup?orgslug=${orgslug}`)}
|
href={getUriWithoutOrg(`/signup?orgslug=${orgslug}`)}
|
||||||
message='You are not part of this Organization'
|
message='You are not part of this Organization yet'
|
||||||
cta={`Join ${org?.name}`}
|
cta={`Join ${org?.name}`}
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue