manifold/web/pages/account.tsx

42 lines
1.1 KiB
TypeScript
Raw Normal View History

2021-12-16 02:11:29 +00:00
import React from 'react'
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'
function SignInCard() {
return (
<div className="card glass sm:card-side text-neutral-content mx-4 my-12 max-w-sm bg-green-600 shadow-xl transition-all hover:bg-green-600 hover:shadow-xl sm:mx-auto">
2021-12-14 01:29:02 +00:00
<div className="p-4">
<img
src="/logo-bg-white.png"
className="h-20 w-20 rounded-lg shadow-lg"
/>
2021-12-14 01:29:02 +00:00
</div>
<div className="card-body max-w-md">
<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>
)
}
export default function Account() {
const user = useUser()
2021-12-19 01:23:34 +00:00
return user ? (
<UserPage user={user} currentUser={user} />
) : (
<Page>
2021-12-19 01:23:34 +00:00
<SignInCard />
</Page>
2021-12-19 01:23:34 +00:00
)
}