Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

console-err-msg #430

Merged
merged 8 commits into from
Oct 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/components/achievementCard/AchievementCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ import React from "react";
import "./AchievementCard.scss";

export default function AchievementCard({cardInfo, isDark}) {
function openUrlInNewTab(url) {
function openUrlInNewTab(url, name) {
if (!url) {
console.log(`URL for ${name} not found`);
return;
}
var win = window.open(url, "_blank");
Expand Down Expand Up @@ -31,7 +32,7 @@ export default function AchievementCard({cardInfo, isDark}) {
className={
isDark ? "dark-mode certificate-tag" : "certificate-tag"
}
onClick={() => openUrlInNewTab(v.url)}
onClick={() => openUrlInNewTab(v.url, v.name)}
>
{v.name}
</span>
Expand Down
5 changes: 3 additions & 2 deletions src/components/blogCard/BlogCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@ import React from "react";
import "./BlogCard.scss";

export default function BlogCard({blog, isDark}) {
function openUrlInNewTab(url) {
function openUrlInNewTab(url, name) {
if (!url) {
console.log(`URL for ${name} not found`);
return;
}
var win = window.open(url, "_blank");
win.focus();
}

return (
<div onClick={() => openUrlInNewTab(blog.url)}>
<div onClick={() => openUrlInNewTab(blog.url, blog.title)}>
<div className={isDark ? "blog-container dark-mode" : "blog-container"}>
<a
className={
Expand Down
3 changes: 3 additions & 0 deletions src/components/educationCard/EducationCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ export default function EducationCard({school}) {
: null;
};
const {isDark} = useContext(StyleContext);

if (!school.logo)
console.error(`Image of ${school.name} is missing in education section`);
return (
<div>
<Fade left duration={1000}>
Expand Down
5 changes: 3 additions & 2 deletions src/components/githubRepoCard/GithubRepoCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ import "./GithubRepoCard.scss";
import {Fade} from "react-reveal";

export default function GithubRepoCard({repo, isDark}) {
function openUrlInNewTab(url) {
function openUrlInNewTab(url, name) {
if (!url) {
console.log(`URL in ${name} is undefined`);
return;
}
var win = window.open(url, "_blank");
Expand All @@ -17,7 +18,7 @@ export default function GithubRepoCard({repo, isDark}) {
<div
className={isDark ? "dark-card-mode repo-card-div" : "repo-card-div"}
key={repo.node.id}
onClick={() => openUrlInNewTab(repo.node.url)}
onClick={() => openUrlInNewTab(repo.node.url, repo.node.name)}
>
<div className="repo-name-div">
<svg
Expand Down
9 changes: 9 additions & 0 deletions src/containers/podcast/Podcast.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ import StyleContext from "../../contexts/StyleContext";

export default function Podcast() {
const {isDark} = useContext(StyleContext);

if (!podcastSection)
console.error("podcastSection object for Podcast section is missing");

if (!podcastSection.display) {
return null;
}
Expand All @@ -26,6 +30,11 @@ export default function Podcast() {
</div>
<div className="podcast-main-div">
{podcastSection.podcast.map((podcastLink, i) => {
if (!podcastLink) {
console.log(
`Podcast link for ${podcastSection.title} is missing`
);
}
return (
<div key={i}>
<iframe
Expand Down
3 changes: 1 addition & 2 deletions src/containers/profile/Profile.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ export default function Profile() {
if (result.ok) {
return result.json();
}
console.error(result);
})
.then(response => {
setProfileFunction(response.data.user);
Expand All @@ -31,8 +30,8 @@ export default function Profile() {
console.log(
"Because of this error, contact section has reverted to default"
);
console.error(error);
openSource.showGithubProfile = "false";
console.error(error);
});
};
getProfileData();
Expand Down
5 changes: 5 additions & 0 deletions src/containers/projects/Projects.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ export default function Projects() {
<h1 className="project-title">Open Source Projects</h1>
<div className="repo-cards-div-main">
{repo.map((v, i) => {
if (!v) {
console.error(
`Github Object for repository number : ${i} is undefined`
);
}
return (
<GithubRepoCard repo={v} key={v.node.id} isDark={isDark} />
);
Expand Down
3 changes: 3 additions & 0 deletions src/containers/twitter-embed/twitter.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ export default function Twitter() {
if (!twitterDetails.display) {
return null;
}
if (!twitterDetails.userName) {
console.error("Twitter username for twitter section is missing");
}
if (twitterDetails.userName) {
return (
<Suspense fallback={renderLoader()}>
Expand Down