oh la la
This commit is contained in:
parent
34e5527244
commit
77a6d7fa6c
3 changed files with 15 additions and 7 deletions
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
import $ from "jquery";
|
||||
import { getPixelInfo } from "./index";
|
||||
import { getStudent } from "../../students";
|
||||
|
||||
const canvasContainer = $("#canvas-container")?.[0];
|
||||
const canvas = $("#canvas")?.[0];
|
||||
|
|
@ -74,6 +75,7 @@ export const toggleTooltip = async (state = false) => {
|
|||
date.toLocaleDateString();
|
||||
document.getElementById("tooltip-time").innerText =
|
||||
date.toLocaleTimeString();
|
||||
getStudent(response.placedByUid);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import { authedAPIRequest } from "../utils/auth";
|
||||
import { displayStudentProfile } from "./utils";
|
||||
|
||||
//get a student from the API by its uid or login
|
||||
async function getStudent(login) {
|
||||
|
|
@ -27,8 +28,7 @@ async function getStudent(login) {
|
|||
console.debug(res);
|
||||
|
||||
// Update HTML
|
||||
// const roomNameElt = document.getElementById("room-name");
|
||||
// roomNameElt.innerText = res.metadata.name
|
||||
displayStudentProfile(res.avatarURL, res.login, res.guild, res.quote);
|
||||
}
|
||||
|
||||
//// get the user's uid from the token in local storage
|
||||
|
|
|
|||
|
|
@ -1,5 +1,11 @@
|
|||
// FIXME: This file should handle the students DOM manipulation
|
||||
// Link buttons to their respective functions
|
||||
// Functions may include:
|
||||
// - displayStudentProfile (display the student's profile in the DOM)
|
||||
// - showModal (add a form modal to the DOM)
|
||||
// display the student's profile in the DOM
|
||||
function displayStudentProfile(picture, login, guild, quote) {
|
||||
document.getElementById("tooltip-info-avatar").src = picture;
|
||||
document.getElementById("tooltip-info-login").innerText = login;
|
||||
document.getElementById("tooltip-info-guild").innerText = guild;
|
||||
document.getElementById("tooltip-info-quote").innerText = quote;
|
||||
}
|
||||
// add a form modal to the DOM
|
||||
function showModal() {}
|
||||
|
||||
export { displayStudentProfile, showModal };
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue