manifold/web/pages/account.tsx

42 lines
1.2 KiB
TypeScript
Raw Normal View History

2021-12-16 02:11:29 +00:00
import React from 'react'
import { Page } from 'web/components/page'
import { UserPage } from 'web/components/user-page'
import { useUser } from 'web/hooks/use-user'
import { firebaseLogin } from 'web/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
)
}