forked from Technigo/project-github-tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuserProfile.js
More file actions
41 lines (32 loc) · 1.27 KB
/
userProfile.js
File metadata and controls
41 lines (32 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import { createElement } from "../utility/createElem";
export default function UserProfileComp(
userProfileImage,
username,
email,
githubLink
) {
const aside = createElement("aside", "user-profile");
const profileContainer = createElement("div", "user-profile-container");
const userProfileImg = createElement("img", "user-profile-img");
userProfileImg.src = userProfileImage;
const userInfoContainer = createElement("div", "user-info");
const usernameElem = createElement("h1", "username");
usernameElem.innerText = username;
const emailElem = createElement("p", "email");
emailElem.innerText = email;
const canvasContainer = createElement("div", "canvas-container");
const canvas = createElement("canvas", "canvas");
canvas.id = "chart";
canvasContainer.appendChild(canvas);
userInfoContainer.appendChild(usernameElem);
userInfoContainer.appendChild(emailElem);
profileContainer.appendChild(userProfileImg);
profileContainer.appendChild(userInfoContainer);
const githubLinkElem = createElement("a", "go-to-github");
githubLinkElem.innerText = `Go to ${username}'s Github`;
githubLinkElem.href = githubLink;
aside.appendChild(profileContainer);
aside.appendChild(githubLinkElem);
aside.appendChild(canvasContainer);
return aside;
}