web: profile js...?
This commit is contained in:
parent
2dcc1d7381
commit
814f24c5d4
4 changed files with 69 additions and 15 deletions
8
Web/public/.idea/indexLayout.xml
generated
Normal file
8
Web/public/.idea/indexLayout.xml
generated
Normal file
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="UserContentModel">
|
||||
<attachedFolders />
|
||||
<explicitIncludes />
|
||||
<explicitExcludes />
|
||||
</component>
|
||||
</project>
|
6
Web/public/.idea/vcs.xml
generated
Normal file
6
Web/public/.idea/vcs.xml
generated
Normal file
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$/../.." vcs="Git" />
|
||||
</component>
|
||||
</project>
|
33
Web/public/.idea/workspace.xml
generated
33
Web/public/.idea/workspace.xml
generated
|
@ -4,7 +4,9 @@
|
|||
<option name="autoReloadType" value="SELECTIVE" />
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="894f9b22-d5a1-46d5-9153-c8d0f3e9f4e5" name="Changes" comment="" />
|
||||
<list default="true" id="894f9b22-d5a1-46d5-9153-c8d0f3e9f4e5" name="Changes" comment="">
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
||||
|
@ -13,26 +15,26 @@
|
|||
<component name="Git.Settings">
|
||||
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$/../.." />
|
||||
</component>
|
||||
<component name="ProjectColorInfo"><![CDATA[{
|
||||
"associatedIndex": 6
|
||||
}]]></component>
|
||||
<component name="ProjectColorInfo">{
|
||||
"associatedIndex": 6
|
||||
}</component>
|
||||
<component name="ProjectId" id="2t878h0xAZRJsRYk3bMOLhmfKE8" />
|
||||
<component name="ProjectViewState">
|
||||
<option name="hideEmptyMiddlePackages" value="true" />
|
||||
<option name="showLibraryContents" value="true" />
|
||||
</component>
|
||||
<component name="PropertiesComponent"><![CDATA[{
|
||||
"keyToString": {
|
||||
"RunOnceActivity.ShowReadmeOnStart": "true",
|
||||
"git-widget-placeholder": "main",
|
||||
"node.js.detected.package.eslint": "true",
|
||||
"node.js.detected.package.tslint": "true",
|
||||
"node.js.selected.package.eslint": "(autodetect)",
|
||||
"node.js.selected.package.tslint": "(autodetect)",
|
||||
"nodejs_package_manager_path": "npm",
|
||||
"vue.rearranger.settings.migration": "true"
|
||||
<component name="PropertiesComponent">{
|
||||
"keyToString": {
|
||||
"RunOnceActivity.ShowReadmeOnStart": "true",
|
||||
"git-widget-placeholder": "main",
|
||||
"node.js.detected.package.eslint": "true",
|
||||
"node.js.detected.package.tslint": "true",
|
||||
"node.js.selected.package.eslint": "(autodetect)",
|
||||
"node.js.selected.package.tslint": "(autodetect)",
|
||||
"nodejs_package_manager_path": "npm",
|
||||
"vue.rearranger.settings.migration": "true"
|
||||
}
|
||||
}]]></component>
|
||||
}</component>
|
||||
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
|
||||
<component name="TaskManager">
|
||||
<task active="true" id="Default" summary="Default task">
|
||||
|
@ -42,6 +44,7 @@
|
|||
<option name="presentableId" value="Default" />
|
||||
<updated>1739721691032</updated>
|
||||
<workItem from="1739721692659" duration="470000" />
|
||||
<workItem from="1739724799443" duration="617000" />
|
||||
</task>
|
||||
<servers />
|
||||
</component>
|
||||
|
|
37
Web/public/js/profile.reza.js
Normal file
37
Web/public/js/profile.reza.js
Normal file
|
@ -0,0 +1,37 @@
|
|||
// i literally dk what im doing :,)
|
||||
const loadProfile = () => {
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
const uid = urlParams.get("uid");
|
||||
|
||||
const usernameText = document.getElementById("name");
|
||||
const emailText = document.getElementById("email");
|
||||
|
||||
if (uid) {
|
||||
console.log("Fetching user info", uid);
|
||||
|
||||
firebase.firestore().collection("users").doc(uid).get()
|
||||
.then((doc) => {
|
||||
if (doc.exists) {
|
||||
// If the user data exists
|
||||
const userData = doc.data();
|
||||
|
||||
usernameText.innerHTML = userData.displayName
|
||||
emailText.innerHTML = userData.email
|
||||
|
||||
} else {
|
||||
// If no user is found
|
||||
console.error("User not found!");
|
||||
usernameText.innerHTML = "User not found.";
|
||||
emailText.innerHTML = "No user data available.";
|
||||
}
|
||||
})
|
||||
|
||||
} else {
|
||||
// If no UID is found in the URL
|
||||
console.error("No UID found");
|
||||
usernameText.innerHTML = "Whoops!";
|
||||
emailText.innerHTML = "No user to display.";
|
||||
}
|
||||
};
|
||||
|
||||
window.onload = loadProfile;
|
Loading…
Add table
Reference in a new issue