Skip to content

Commit 7a71f79

Browse files
authored
Update account-dashboard.html
1 parent 2d0d314 commit 7a71f79

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

account-dashboard.html

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,18 @@
129129
</div>
130130
</nav>
131131

132-
<h1 style="text-align:center;"><b>Coding Hut</b></h1>
132+
<h1 id="user" style="text-align:center;"><b>Coding Hut</b></h1>
133133
<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>
135135

136136
<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+
}
137144
function toggleMenu() {
138145
var menu = document.querySelector('.menu');
139146
menu.style.display = menu.style.display === 'flex' ? 'none' : 'flex';

0 commit comments

Comments
 (0)