Skip to content

Commit 9f09d4e

Browse files
committed
add LoginPage to Edit Profile
1 parent 15fa4fb commit 9f09d4e

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

components/EditProfilePage/EditProfilePage.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ import { TestimoniesTab } from "./TestimoniesTab"
2727
import { useFlags } from "components/featureFlags"
2828
import { PendingUpgradeBanner } from "components/PendingUpgradeBanner"
2929

30+
import LoginPage from "components/Login/login"
31+
3032
const tabTitle = ["about-you", "testimonies", "following"] as const
3133
export type TabTitles = (typeof tabTitle)[number]
3234

@@ -39,14 +41,22 @@ export default function EditProfile({
3941
const uid = user?.uid
4042
const result = useProfile()
4143

42-
if (result.loading) {
44+
if (result.loading && uid) {
4345
return (
4446
<Row>
4547
<Spinner animation="border" className="mx-auto" />
4648
</Row>
4749
)
4850
}
4951

52+
if (result.loading) {
53+
return (
54+
<Row>
55+
<LoginPage />
56+
</Row>
57+
)
58+
}
59+
5060
if (result?.profile && uid) {
5161
return (
5262
<EditProfileForm

pages/edit-profile/[[...docName]].tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@ const Query = z.object({
1414

1515
export default createPage({
1616
title: "Edit Profile",
17-
Page: requireAuth(({ user }) => {
17+
Page: () => {
18+
// Page: requireAuth(({ user }) => {
1819
const tabTitle = Query.parse(useRouter().query).docName?.[0] || "about-you"
1920
return <EditProfile tabTitle={tabTitle as TabTitles} />
20-
})
21+
}
2122
})
2223

2324
export const getStaticPaths: GetStaticPaths = async ctx => {

0 commit comments

Comments
 (0)