aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKumar Priyansh <[email protected]>2019-06-09 19:52:53 +0530
committerKumar Priyansh <[email protected]>2019-06-09 19:52:53 +0530
commit7485c7aca1e7135ccb74201a0e5e5cf75eecbdef (patch)
treed420c61a03e517792bed3a882101ed3f63b59cea
parentc6e8231b317c3104f49222b1628f2d7287de13a8 (diff)
downloadfirebase-ecommerce-7485c7aca1e7135ccb74201a0e5e5cf75eecbdef.tar.xz
firebase-ecommerce-7485c7aca1e7135ccb74201a0e5e5cf75eecbdef.zip
Updated Login and Logged in FunctionsHEADmaster
-rw-r--r--index.html9
-rw-r--r--shared/css/main.css6
-rw-r--r--shared/js/Dashboard.js16
3 files changed, 14 insertions, 17 deletions
diff --git a/index.html b/index.html
index d4b55d3..ef16db8 100644
--- a/index.html
+++ b/index.html
@@ -21,10 +21,9 @@
</div>
</form>
<span class="navbar-text">
- <a class="nav-link" href="#" id="sign" style="display: block; width: 100%; padding: .25rem 1.5rem; text-align: inherit;
- white-space: nowrap;">Sign In/ Register</a>
- <div class="nav-item dropdown">
- <a aria-expanded="false" aria-haspopup="true" class="nav-link dropdown-toggle" data-toggle="dropdown" href="#" id="navbarDropdown" role="button" style="display: none;">
+ <a class="nav-link" href="login/" id="sign" style="width: 100%; padding: .25rem 1.5rem; text-align: inherit; white-space: nowrap;">Sign In/ Register</a>
+ <div id="signed" class="nav-item dropdown">
+ <a aria-expanded="false" aria-haspopup="true" class="nav-link dropdown-toggle" data-toggle="dropdown" href="#" id="navbarDropdown" role="button">
My Account
</a>
<div
@@ -88,6 +87,6 @@
<script crossorigin="anonymous" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
<script src="https://www.gstatic.com/firebasejs/6.1.0/firebase.js"></script>
<script src="shared/js/firebaseConfig.js"></script>
- <script src="shared/js/LoginCheck.js"></script>
+ <script src="shared/js/Dashboard.js"></script>
</body>
</html>
diff --git a/shared/css/main.css b/shared/css/main.css
index 5b21812..831ec8a 100644
--- a/shared/css/main.css
+++ b/shared/css/main.css
@@ -68,4 +68,10 @@
}
.recents {
padding: 1.5rem;
+}
+#sign {
+ display: block;
+}
+#signed {
+ display: none;
} \ No newline at end of file
diff --git a/shared/js/Dashboard.js b/shared/js/Dashboard.js
index 2135fed..d67299d 100644
--- a/shared/js/Dashboard.js
+++ b/shared/js/Dashboard.js
@@ -1,14 +1,4 @@
$(document).ready(function(){
- function showAlert(message) {
- // Get the snackbar DIV
- var x = document.getElementById("snackbar");
- $('#snackbar').text(message)
- // Add the "show" class to DIV
- x.className = "show";
-
- // After 3 seconds, remove the show class from DIV
- setTimeout(function(){ x.className = x.className.replace("show", ""); }, 3000);
- }
$('#signout').click(function(){
firebase.auth().signOut().then(function() {
window.location.replace('../')
@@ -17,8 +7,10 @@ $(document).ready(function(){
});
})
firebase.auth().onAuthStateChanged(function(user) {
- if (!user) {
- window.location.replace('../')
+ if (user) {
+ console.log(user)
+ $("#sign").hide()
+ $("#signed").show()
}
});
// var url = window.location.href;