aboutsummaryrefslogtreecommitdiff
path: root/frontend/src/pages/Profile.tsx
diff options
context:
space:
mode:
authorWolfboy248 <georgejvindkarlsen@gmail.com>2024-10-29 10:09:17 +0100
committerWolfboy248 <georgejvindkarlsen@gmail.com>2024-10-29 10:09:17 +0100
commit35946dbb2feb7f9d1cbab16fb0602ce0303562e9 (patch)
tree3ba530c1b3f5a1742ec41dfee5b74b43353619e2 /frontend/src/pages/Profile.tsx
parentMerge branch 'typescript' of https://github.com/pektezol/LeastPortalsHub into... (diff)
downloadlphub-35946dbb2feb7f9d1cbab16fb0602ce0303562e9.tar.gz
lphub-35946dbb2feb7f9d1cbab16fb0602ce0303562e9.tar.bz2
lphub-35946dbb2feb7f9d1cbab16fb0602ce0303562e9.zip
refactor: upload run dialog, useMessage update, added loader spinner
Diffstat (limited to 'frontend/src/pages/Profile.tsx')
-rw-r--r--frontend/src/pages/Profile.tsx15
1 files changed, 9 insertions, 6 deletions
diff --git a/frontend/src/pages/Profile.tsx b/frontend/src/pages/Profile.tsx
index 5d1c75d..3dba3ae 100644
--- a/frontend/src/pages/Profile.tsx
+++ b/frontend/src/pages/Profile.tsx
@@ -103,10 +103,12 @@ const Profile: React.FC<ProfileProps> = ({ profile, token, gameData, onDeleteRec
103 }; 103 };
104 104
105 return ( 105 return (
106 <main> 106 <div>
107 {ConfirmDialogComponent} 107 {MessageDialogComponent}
108 {MessageDialogComponent} 108 {ConfirmDialogComponent}
109 <section id='section1' className='profile'> 109
110 <main>
111 <section id='section1' className='profile'>
110 112
111 {profile.profile 113 {profile.profile
112 ? ( 114 ? (
@@ -266,7 +268,7 @@ const Profile: React.FC<ProfileProps> = ({ profile, token, gameData, onDeleteRec
266 <span>{e.date.split("T")[0]}</span> 268 <span>{e.date.split("T")[0]}</span>
267 <span style={{ flexDirection: "row-reverse" }}> 269 <span style={{ flexDirection: "row-reverse" }}>
268 270
269 <button style={{ marginRight: "10px" }} onClick={() => { window.alert(`Demo ID: ${e.demo_id}`) }}><img src={ThreedotIcon} alt="demo_id" /></button> 271 <button style={{ marginRight: "10px" }} onClick={() => { message("Demo information", `Demo ID: ${e.demo_id}`) }}><img src={ThreedotIcon} alt="demo_id" /></button>
270 <button onClick={() => { _delete_submission(r.map_id, e.record_id) }}><img src={DeleteIcon}></img></button> 272 <button onClick={() => { _delete_submission(r.map_id, e.record_id) }}><img src={DeleteIcon}></img></button>
271 <button onClick={() => window.location.href = `/api/v1/demos?uuid=${e.demo_id}`}><img src={DownloadIcon} alt="download" /></button> 273 <button onClick={() => window.location.href = `/api/v1/demos?uuid=${e.demo_id}`}><img src={DownloadIcon} alt="download" /></button>
272 {i === 0 && r.scores.length > 1 ? <button onClick={() => { 274 {i === 0 && r.scores.length > 1 ? <button onClick={() => {
@@ -312,7 +314,7 @@ const Profile: React.FC<ProfileProps> = ({ profile, token, gameData, onDeleteRec
312 <span>{record!.scores[i].date.split("T")[0]}</span> 314 <span>{record!.scores[i].date.split("T")[0]}</span>
313 <span style={{ flexDirection: "row-reverse" }}> 315 <span style={{ flexDirection: "row-reverse" }}>
314 316
315 <button onClick={() => { window.alert(`Demo ID: ${e.demo_id}`) }}><img src={ThreedotIcon} alt="demo_id" /></button> 317 <button onClick={() => { message("Demo information", `Demo ID: ${e.demo_id}`) }}><img src={ThreedotIcon} alt="demo_id" /></button>
316 <button onClick={() => { _delete_submission(r.id, e.record_id) }}><img src={DeleteIcon}></img></button> 318 <button onClick={() => { _delete_submission(r.id, e.record_id) }}><img src={DeleteIcon}></img></button>
317 <button onClick={() => window.location.href = `/api/v1/demos?uuid=${e.demo_id}`}><img src={DownloadIcon} alt="download" /></button> 319 <button onClick={() => window.location.href = `/api/v1/demos?uuid=${e.demo_id}`}><img src={DownloadIcon} alt="download" /></button>
318 {i === 0 && record!.scores.length > 1 ? <button onClick={() => { 320 {i === 0 && record!.scores.length > 1 ? <button onClick={() => {
@@ -333,6 +335,7 @@ const Profile: React.FC<ProfileProps> = ({ profile, token, gameData, onDeleteRec
333 </div> 335 </div>
334 </section> 336 </section>
335 </main> 337 </main>
338 </div>
336 ); 339 );
337}; 340};
338 341