2021-12-16 02:11:29 +00:00
|
|
|
import React from 'react'
|
2021-12-20 04:06:30 +00:00
|
|
|
import { Page } from '../components/page'
|
2021-12-16 02:11:29 +00:00
|
|
|
import { UserPage } from '../components/user-page'
|
2021-12-09 23:37:26 +00:00
|
|
|
import { useUser } from '../hooks/use-user'
|
2021-12-16 02:11:29 +00:00
|
|
|
import { firebaseLogin } from '../lib/firebase/users'
|
2021-12-13 18:20:31 +00:00
|
|
|
|
|
|
|
function SignInCard() {
|
|
|
|
return (
|
2021-12-18 23:40:39 +00:00
|
|
|
<div className="card glass sm:card-side shadow-xl hover:shadow-xl text-neutral-content bg-green-600 hover:bg-green-600 transition-all max-w-sm mx-4 sm:mx-auto my-12">
|
2021-12-14 01:29:02 +00:00
|
|
|
<div className="p-4">
|
2021-12-13 18:20:31 +00:00
|
|
|
<img
|
2022-01-11 06:16:58 +00:00
|
|
|
src="/logo-bg-white.png"
|
2021-12-13 18:20:31 +00:00
|
|
|
className="rounded-lg shadow-lg w-20 h-20"
|
|
|
|
/>
|
2021-12-14 01:29:02 +00:00
|
|
|
</div>
|
2021-12-13 18:20:31 +00:00
|
|
|
<div className="max-w-md card-body">
|
|
|
|
<h2 className="card-title font-major-mono">Welcome!</h2>
|
|
|
|
<p>Sign in to get started</p>
|
|
|
|
<div className="card-actions">
|
|
|
|
<button
|
|
|
|
className="btn glass rounded-full hover:bg-green-500"
|
|
|
|
onClick={firebaseLogin}
|
|
|
|
>
|
|
|
|
Sign in with Google
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2021-12-16 01:34:36 +00:00
|
|
|
export default function Account() {
|
|
|
|
const user = useUser()
|
2021-12-19 01:23:34 +00:00
|
|
|
return user ? (
|
|
|
|
<UserPage user={user} currentUser={user} />
|
|
|
|
) : (
|
2021-12-20 04:06:30 +00:00
|
|
|
<Page>
|
2021-12-19 01:23:34 +00:00
|
|
|
<SignInCard />
|
2021-12-20 04:06:30 +00:00
|
|
|
</Page>
|
2021-12-19 01:23:34 +00:00
|
|
|
)
|
2021-12-16 01:34:36 +00:00
|
|
|
}
|