REMOVE: mastodon status/fixes stats page bug

This commit is contained in:
Jyotirmoy Bandyopadhayaya 2023-03-09 11:01:32 +05:30
parent ea1d2c2c96
commit db08e1001e
Signed by: bravo68web
GPG Key ID: F5671FD7BCB9917A
5 changed files with 59 additions and 58 deletions

View File

@ -3,111 +3,112 @@ import SkillCard from "../skillCard";
export default function ({ title, image, evt1, evt2, evt3, url }) {
let ghLogo = "/images/github_events/GitIcon.png";
console.log(title,image,evt1,evt2,evt3,url)
// Evt1
if (evt1.type === "PushEvent") {
if (evt1?.type === "PushEvent") {
evt1.entTypeLogo = "/images/github_events/github_push_event_logo.png";
evt1.commitMsg = evt1.payload.commits[0].message;
} else if (evt1.type === "WatchEvent") {
} else if (evt1?.type === "WatchEvent") {
evt1.entTypeLogo = "/images/github_events/github_watch_event_logo.png";
} else if (evt1.type === "IssuesEvent") {
} else if (evt1?.type === "IssuesEvent") {
evt1.entTypeLogo = "/images/github_events/github_issues_event_logo.png";
if (evt1.payload.action === "opened") {
if (evt1?.payload.action === "opened") {
evt1.commitMsg = "Opened " + evt1.payload.issue.title;
} else if (evt1.payload.action === "closed") {
} else if (evt1?.payload.action === "closed") {
evt1.commitMsg = "Closed " + evt1.payload.issue.title;
}
} else if (evt1.type === "DeleteEvent") {
} else if (evt1?.type === "DeleteEvent") {
evt1.entTypeLogo = "/images/github_events/github_delete_event_logo.png";
evt1.commitMsg =
evt1.payload.ref_type + " " + evt1.payload.ref + " deleted";
} else if (evt1.type === "IssueCommentEvent") {
} else if (evt1?.type === "IssueCommentEvent") {
evt1.entTypeLogo =
"/images/github_events/github_issue_comment_event_logo.png";
evt1.commitMsg = evt1.payload.comment.body;
} else if (evt1.type === "CreateEvent") {
} else if (evt1?.type === "CreateEvent") {
evt1.entTypeLogo = "/images/github_events/github_create_event_logo.png";
evt1.commitMsg = evt1.payload.ref_type;
} else if (evt1.type === "PullRequestEvent") {
} else if (evt1?.type === "PullRequestEvent") {
evt1.entTypeLogo =
"/images/github_events/github_pull_request_event_logo.png";
if (evt1.payload.action === "opened") {
if (evt1?.payload.action === "opened") {
evt1.commitMsg = "Opened " + evt1.payload.pull_request.title;
} else if (evt1.payload.action === "closed") {
} else if (evt1?.payload.action === "closed") {
evt1.commitMsg = "Closed " + evt1.payload.pull_request.title;
}
} else if (evt1.type === "ForkEvent") {
} else if (evt1?.type === "ForkEvent") {
evt1.entTypeLogo = "/images/github_events/github_fork_event_logo.png";
evt1.commitMsg = "Forked " + evt1.payload.forkee.full_name;
}
// Evt2
if (evt2.type === "PushEvent") {
if (evt2?.type === "PushEvent") {
evt2.entTypeLogo = "/images/github_events/github_push_event_logo.png";
evt2.commitMsg = evt2.payload.commits[0].message;
} else if (evt2.type === "WatchEvent") {
} else if (evt2?.type === "WatchEvent") {
evt2.entTypeLogo = "/images/github_events/github_watch_event_logo.png";
} else if (evt2.type === "IssuesEvent") {
} else if (evt2?.type === "IssuesEvent") {
evt2.entTypeLogo = "/images/github_events/github_issues_event_logo.png";
if (evt2.payload.action === "opened") {
if (evt2?.payload.action === "opened") {
evt2.commitMsg = "Opened " + evt2.payload.issue.title;
} else if (evt2.payload.action === "closed") {
} else if (evt2?.payload.action === "closed") {
evt2.commitMsg = "Closed " + evt2.payload.issue.title;
}
} else if (evt2.type === "DeleteEvent") {
} else if (evt2?.type === "DeleteEvent") {
evt2.entTypeLogo = "/images/github_events/github_delete_event_logo.png";
evt2.commitMsg =
evt2.payload.ref_type + " " + evt2.payload.ref + " deleted";
} else if (evt2.type === "IssueCommentEvent") {
} else if (evt2?.type === "IssueCommentEvent") {
evt2.entTypeLogo =
"/images/github_events/github_issue_comment_event_logo.png";
evt2.commitMsg = evt2.payload.comment.body;
} else if (evt2.type === "CreateEvent") {
} else if (evt2?.type === "CreateEvent") {
evt2.entTypeLogo = "/images/github_events/github_create_event_logo.png";
evt2.commitMsg = evt2.payload.ref_type;
} else if (evt2.type === "PullRequestEvent") {
} else if (evt2?.type === "PullRequestEvent") {
evt2.entTypeLogo =
"/images/github_events/github_pull_request_event_logo.png";
if (evt2.payload.action === "opened") {
if (evt2?.payload.action === "opened") {
evt2.commitMsg = "Opened " + evt2.payload.pull_request.title;
} else if (evt2.payload.action === "closed") {
} else if (evt2?.payload.action === "closed") {
evt2.commitMsg = "Closed " + evt2.payload.pull_request.title;
}
} else if (evt2.type === "ForkEvent") {
} else if (evt2?.type === "ForkEvent") {
evt2.entTypeLogo = "/images/github_events/github_fork_event_logo.png";
evt2.commitMsg = "Forked " + evt2.payload.forkee.full_name;
}
// Evt3
if (evt3.type === "PushEvent") {
if (evt3?.type === "PushEvent") {
evt3.entTypeLogo = "/images/github_events/github_push_event_logo.png";
evt3.commitMsg = evt3.payload.commits[0].message;
} else if (evt3.type === "WatchEvent") {
} else if (evt3?.type === "WatchEvent") {
evt3.entTypeLogo = "/images/github_events/github_watch_event_logo.png";
} else if (evt3.type === "IssuesEvent") {
} else if (evt3?.type === "IssuesEvent") {
evt3.entTypeLogo = "/images/github_events/github_issues_event_logo.png";
if (evt3.payload.action === "opened") {
if (evt3?.payload.action === "opened") {
evt3.commitMsg = "Opened " + evt3.payload.issue.title;
} else if (evt3.payload.action === "closed") {
} else if (evt3?.payload.action === "closed") {
evt3.commitMsg = "Closed " + evt3.payload.issue.title;
}
} else if (evt3.type === "DeleteEvent") {
} else if (evt3?.type === "DeleteEvent") {
evt3.entTypeLogo = "/images/github_events/github_delete_event_logo.png";
evt3.commitMsg =
evt3.payload.ref_type + " " + evt3.payload.ref + " deleted";
} else if (evt3.type === "IssueCommentEvent") {
} else if (evt3?.type === "IssueCommentEvent") {
evt3.entTypeLogo =
"/images/github_events/github_issue_comment_event_logo.png";
evt3.commitMsg = evt3.payload.comment.body;
} else if (evt3.type === "CreateEvent") {
} else if (evt3?.type === "CreateEvent") {
evt3.entTypeLogo = "/images/github_events/github_create_event_logo.png";
evt3.commitMsg = evt3.payload.ref_type;
} else if (evt3.type === "PullRequestEvent") {
} else if (evt3?.type === "PullRequestEvent") {
evt3.entTypeLogo =
"/images/github_events/github_pull_request_event_logo.png";
if (evt3.payload.action === "opened") {
if (evt3?.payload.action === "opened") {
evt3.commitMsg = "Opened " + evt3.payload.pull_request.title;
} else if (evt3.payload.action === "closed") {
} else if (evt3?.payload.action === "closed") {
evt3.commitMsg = "Closed " + evt3.payload.pull_request.title;
}
} else if (evt3.type === "ForkEvent") {
} else if (evt3?.type === "ForkEvent") {
evt3.entTypeLogo = "/images/github_events/github_fork_event_logo.png";
evt3.commitMsg = "Forked " + evt3.payload.forkee.full_name;
}
@ -117,9 +118,9 @@ export default function ({ title, image, evt1, evt2, evt3, url }) {
<div className="gh-cards">
<div className="description gh-act-icons">
<img src={ghLogo} width="20px" />{" "}
<img src={evt1.entTypeLogo} height="20px" />
<img src={evt1?.entTypeLogo} height="20px" />
<br />
{evt1.repo.name}
{evt1?.repo?.name}
</div>
<div className="description commit-msg">
{evt1?.commitMsg?.slice(0, 50)}
@ -130,9 +131,9 @@ export default function ({ title, image, evt1, evt2, evt3, url }) {
<div className="gh-cards">
<div className="description gh-act-icons">
<img src={ghLogo} width="20px" />{" "}
<img src={evt2.entTypeLogo} height="20px" />
<img src={evt2?.entTypeLogo} height="20px" />
<br />
{evt2.repo.name}
{evt2?.repo?.name}
</div>
<div className="description commit-msg">
{evt2?.commitMsg?.slice(0, 50)}
@ -143,9 +144,9 @@ export default function ({ title, image, evt1, evt2, evt3, url }) {
<div className="gh-cards">
<div className="description gh-act-icons">
<img src={ghLogo} width="20px" />{" "}
<img src={evt3.entTypeLogo} height="20px" />
<img src={evt3?.entTypeLogo} height="20px" />
<br />
{evt3.repo.name}
{evt3?.repo?.name}
</div>
<div className="description commit-msg">
{evt3?.commitMsg?.slice(0, 50)}

View File

@ -27,7 +27,7 @@ function OsuUserSkillCard({
<div className="description">Global Rank :- #{pp_rank}</div>
<div className="description">Max Combo :- {maximum_combo}</div>
<div className="description">
Total Score :- {total_score.toLocaleString()}
Total Score :- {total_score?.toLocaleString()}
</div>
<div className="description">
Joined on : {format(join_date, "DD MMM YYYY")}

View File

@ -15,8 +15,8 @@ function TwitterTweetsSkillCard({
<div className="skill-card-content">
Latest Tweet
<div className="skill-card-content-inner">
<a href={"https://twitter.com/Bravo68web/status/" + tweets1.id}>
<div>{tweets1.text}</div>
<a href={"https://twitter.com/Bravo68web/status/" + tweets1?.id}>
<div>{tweets1?.text}</div>
</a>
</div>
</div>
@ -24,16 +24,16 @@ function TwitterTweetsSkillCard({
<div className="skill-card-content">
Previous Tweets
<div className="skill-card-content-inner">
<a href={"https://twitter.com/Bravo68web/status/" + tweets2.id}>
{tweets2.text}
<a href={"https://twitter.com/Bravo68web/status/" + tweets2?.id}>
{tweets2?.text}
</a>
</div>
</div>
<br />
<div className="skill-card-content">
<div className="skill-card-content-inner">
<a href={"https://twitter.com/Bravo68web/status/" + tweets3.id}>
{tweets3.text}
<a href={"https://twitter.com/Bravo68web/status/" + tweets3?.id}>
{tweets3?.text}
</a>
</div>
</div>

View File

@ -16,19 +16,19 @@ function WakatimeTopLangSkillCard({
return (
<SkillCard title={title} image={image} url={url}>
<div className="description">
{topLang1.name} :- {topLang1.percent}%
{topLang1?.name} :- {topLang1?.percent}%
</div>
<div className="description">
{topLang2.name} :- {topLang2.percent}%
{topLang2?.name} :- {topLang2?.percent}%
</div>
<div className="description">
{topLang3.name} :- {topLang3.percent}%
{topLang3?.name} :- {topLang3?.percent}%
</div>
<div className="description">
{topLang4.name} :- {topLang4.percent}%
{topLang4?.name} :- {topLang4?.percent}%
</div>
<div className="description">
{topLang5.name} :- {topLang5.percent}%
{topLang5?.name} :- {topLang5?.percent}%
</div>
</SkillCard>
);

View File

@ -61,10 +61,10 @@ export const APISDK = {
endpoint: "/me/vscode/",
name: "vscode",
},
{
endpoint: "/me/mastodon/statuses",
name: "masto_status",
},
// {
// endpoint: "/me/mastodon/statuses",
// name: "masto_status",
// },
],
this.data
);