File tree 1 file changed +9
-2
lines changed
1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 129
129
</ div >
130
130
</ nav >
131
131
132
- < h1 style ="text-align:center; "> < b > Coding Hut</ b > </ h1 >
132
+ < h1 id =" user " style ="text-align:center; "> < b > Coding Hut</ b > </ h1 >
133
133
< h2 style ="text-align:center; "> Welcome to your dashboard</ h2 >
134
- < p style ="text-align:center; "> COMING SOON</ p >
134
+ < p id =" data " style ="text-align:center; "> COMING SOON</ p >
135
135
136
136
< script >
137
+ const username = localStorage . getItem ( 'username' ) ;
138
+ if ( username ) {
139
+ document . getElementById ( 'user' ) . textContent = username ;
140
+ const res = await fetch ( 'scratch-coding-hut-data.onrender.com' )
141
+ if ( res . json ( ) ) {
142
+ document . getElementById ( 'data' ) . textContent = res . json ( )
143
+ }
137
144
function toggleMenu ( ) {
138
145
var menu = document . querySelector ( '.menu' ) ;
139
146
menu . style . display = menu . style . display === 'flex' ? 'none' : 'flex' ;
You can’t perform that action at this time.
0 commit comments