From 35e5039dc5d06e018b64a1f96a9635c32724aa64 Mon Sep 17 00:00:00 2001 From: "Jyotirmoy Bandyopadhyaya [Bravo68]" Date: Sun, 23 Apr 2023 22:06:07 +0530 Subject: [PATCH] fix: build fixes --- .eslintrc.json | 2 +- components/main.jsx | 26 +++++++++++--------- components/skillComponents/github_events.jsx | 4 ++- components/skillComponents/github_trophy.jsx | 4 ++- components/tootCard.js | 2 +- components/{toots.js => toots.jsx} | 18 ++++++++++---- components/toots.style.jsx | 9 +++++++ handlers/sdk.js | 8 +++--- pages/_document.js | 1 - 9 files changed, 48 insertions(+), 26 deletions(-) rename components/{toots.js => toots.jsx} (77%) diff --git a/.eslintrc.json b/.eslintrc.json index 4d765f2..957cd15 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,3 +1,3 @@ { - "extends": ["next/core-web-vitals", "prettier"] + "extends": ["next/core-web-vitals"] } diff --git a/components/main.jsx b/components/main.jsx index 1b8aabe..36ff78e 100644 --- a/components/main.jsx +++ b/components/main.jsx @@ -1,4 +1,4 @@ -import React from "react"; +import React, { useEffect, useState } from "react"; import MainStyle from "./main.style"; import IconButton from "@mui/material/IconButton"; // import Button from "@mui/material/Button"; @@ -24,18 +24,20 @@ import { import DiscordActivity from "./discord-activity"; function Main() { - const animePic = document.getElementById('anime-pic'); - const profPic = document.getElementById('prof-pic'); + useEffect(() => { + const animePic = document.getElementById('anime-pic'); + const profPic = document.getElementById('prof-pic'); - animePic.addEventListener('mouseover', function() { - animePic.style.display = 'none'; - profPic.style.display = 'block'; - }); - - profPic.addEventListener('mouseout', function() { - animePic.style.display = 'block'; - profPic.style.display = 'none'; - }); + animePic.addEventListener('mouseover', function() { + animePic.style.display = 'none'; + profPic.style.display = 'block'; + }); + + profPic.addEventListener('mouseout', function() { + animePic.style.display = 'block'; + profPic.style.display = 'none'; + }); + },[]) return ( diff --git a/components/skillComponents/github_events.jsx b/components/skillComponents/github_events.jsx index 5442be6..e4ad585 100644 --- a/components/skillComponents/github_events.jsx +++ b/components/skillComponents/github_events.jsx @@ -1,7 +1,7 @@ import React from "react"; import SkillCard from "../skillCard"; -export default function ({ title, image, evt1, evt2, evt3, url }) { +function GitCommits({ title, image, evt1, evt2, evt3, url }) { let ghLogo = "/images/github_events/GitIcon.png"; [evt1, evt2, evt3].map((evt) => { @@ -85,3 +85,5 @@ export default function ({ title, image, evt1, evt2, evt3, url }) { ); } + +export default GitCommits \ No newline at end of file diff --git a/components/skillComponents/github_trophy.jsx b/components/skillComponents/github_trophy.jsx index 3fc2bcc..fab65e3 100644 --- a/components/skillComponents/github_trophy.jsx +++ b/components/skillComponents/github_trophy.jsx @@ -1,7 +1,7 @@ import React from "react"; import SkillCard from "../skillCard"; -export default function ({ title, image, bannerImage, url }) { +function GithubTrophySkillCard ({ title, image, bannerImage, url }) { return (
@@ -11,3 +11,5 @@ export default function ({ title, image, bannerImage, url }) {
); } + +export default GithubTrophySkillCard; \ No newline at end of file diff --git a/components/tootCard.js b/components/tootCard.js index 3e077f1..757dfb6 100644 --- a/components/tootCard.js +++ b/components/tootCard.js @@ -29,7 +29,7 @@ function SkillCard({ content, created_at, url, image }) { )} -
"{texts.join("\n")}"
+
"{texts.join("\n")}"
# {format(created_at, "DD MMM YYYY")}
diff --git a/components/toots.js b/components/toots.jsx similarity index 77% rename from components/toots.js rename to components/toots.jsx index 62696f7..dc056b2 100644 --- a/components/toots.js +++ b/components/toots.jsx @@ -1,12 +1,12 @@ import React, { useEffect, useState } from "react"; -import { ArtStyle } from "./toots.style"; +import { ArtStyle, ArtTitleStyle } from "./toots.style"; import SkillCard from "./tootCard"; import { APISDK } from "handlers/sdk"; import SkillsStyle from "./skills.style"; import Box from "@mui/material/Box"; import LinearProgress from "@mui/material/LinearProgress"; -export default function () { +function Toots () { const [skills, setSkills] = useState({}); const [loading, setLoading] = useState(true); @@ -15,7 +15,7 @@ export default function () { APISDK.data.logo = { masto: `https://cdn.fosstodon.org/accounts/avatars/000/028/400/original/324cba4cb379bd4e.png`, }; - setSkills(APISDK.data); + setSkills(APISDK.data.masto_status); setLoading(false); } @@ -34,13 +34,19 @@ export default function () { ); } else { + + console.log(skills.data); return ( <> + +
+ Fosstodon Status +
+
- Fosstodon Status {skills && ( - {skills?.masto_status?.data?.map((project, index) => { + {skills?.data?.map((project, index) => { project.image = image; return ( <> @@ -55,3 +61,5 @@ export default function () { ); } } + +export default Toots; \ No newline at end of file diff --git a/components/toots.style.jsx b/components/toots.style.jsx index ad72a59..389df9c 100644 --- a/components/toots.style.jsx +++ b/components/toots.style.jsx @@ -14,3 +14,12 @@ export const ArtStyle = styled.div` background-repeat: no-repeat; background-attachment: fixed; `; + +export const ArtTitleStyle = styled.div` + font-size: 2.5rem; + font-weight: 700; + color: #fff; + text-align: center; + margin-bottom: 18px; + padding-top: 90px; +` diff --git a/handlers/sdk.js b/handlers/sdk.js index 0e526b7..d289f5e 100644 --- a/handlers/sdk.js +++ b/handlers/sdk.js @@ -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 ); diff --git a/pages/_document.js b/pages/_document.js index a4f4e64..d43efd1 100644 --- a/pages/_document.js +++ b/pages/_document.js @@ -53,7 +53,6 @@ export default class MyDocument extends Document { rel="stylesheet" /> -