-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding user api functions and display confirm message behavior
- Loading branch information
Showing
6 changed files
with
80 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { doc, getDoc, updateDoc } from 'firebase/firestore'; | ||
import { db } from '@/app/firebase'; | ||
|
||
export function updateUser(uid) { | ||
const userDocRef = doc(db, 'authUsers', uid); | ||
updateDoc(userDocRef, { | ||
closedConfirmationMessage: true, | ||
}); | ||
} | ||
|
||
export function getUser(uid) { | ||
const userDocRef = doc(db, 'authUsers', uid); | ||
return getDoc(userDocRef) | ||
.then((userDocSnapshot) => { | ||
// Extract the custom fields from the document data | ||
const userData = userDocSnapshot.data(); | ||
console.log(userData); | ||
return userData; | ||
}) | ||
.catch((error) => { | ||
console.error('Error getting user data:', error); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
export default function ConfirmationMessage({ | ||
userDisplayName, | ||
hideConfirmationMessage, | ||
}) { | ||
return ( | ||
<div className=' border border-black'> | ||
<h1>Welcome {userDisplayName} </h1> | ||
<p> | ||
You can now start logging your reflections. Let’s get started with your | ||
first one! | ||
</p> | ||
<p>Select your current career emotion from the icons on our homepage.</p> | ||
<p>Explore prompts and content tailored to your chosen emotion.</p> | ||
<p> | ||
Gain clarity on your goals and identify areas for focus through these | ||
exercises. | ||
</p> | ||
<button onClick={hideConfirmationMessage}>Get started</button> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters