Skip to content

Commit 1a7a736

Browse files
refactor: clean up imports and improve component structure; remove unused variables
1 parent 140f31a commit 1a7a736

File tree

11 files changed

+32
-21
lines changed

11 files changed

+32
-21
lines changed

src/components/button/Button.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,12 @@ import "./Button.css";
44
export default function Button({text, className = "", href, newTab = false}) {
55
return (
66
<div className={className}>
7-
<a className="main-button" href={href} target={newTab ? "_blank" : ""}>
7+
<a
8+
className="main-button"
9+
href={href}
10+
target={newTab ? "_blank" : ""}
11+
rel="noreferrer"
12+
>
813
{text}
914
</a>
1015
</div>

src/components/educationCard/EducationCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, {createRef, useContext, useRef} from "react";
1+
import React, {useContext, useRef} from "react";
22
import {Fade, Slide} from "react-awesome-reveal";
33
import "./EducationCard.css";
44
import StyleContext from "../../contexts/StyleContext";

src/components/experienceCard/ExperienceCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, {useState, createRef, useRef} from "react";
1+
import React, {useState, useRef} from "react";
22
import "./ExperienceCard.css";
33
import ColorThief from "colorthief";
44

src/components/githubProfileCard/GithubProfileCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import SocialMedia from "../socialMedia/SocialMedia";
44
import {contactInfo} from "../../portfolio";
55
import emoji from "react-easy-emoji";
66
import {Fade} from "react-awesome-reveal";
7-
import locationLogo from "../../assets/images/locationLogo.svg";
7+
// import locationLogo from "../../assets/images/locationLogo.svg";
88
export default function GithubProfileCard({prof}) {
99
if (prof.hireable !== null) {
1010
prof.hireable = "Yes";

src/components/header/Header.css

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@
7171

7272
.header .menu-icon {
7373
cursor: pointer;
74-
display: inline-block;
7574
float: right;
7675
padding: 28px 20px;
7776
position: relative;
@@ -162,6 +161,17 @@
162161
display: none;
163162
}
164163
}
164+
.toggle-switch-container {
165+
display: block;
166+
padding: 15px 20px;
167+
color: black;
168+
text-decoration: none;
169+
}
170+
171+
.dark-menu .toggle-switch-container {
172+
color: white;
173+
}
174+
165175
@media (max-width: 960px) and (min-width: 768px) {
166176
.header {
167177
font-size: 12px;

src/components/header/Header.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,9 @@ function Header() {
7979
<a href="#contact">Contact Me</a>
8080
</li>
8181
<li>
82-
<a>
82+
<div className="toggle-switch-container">
8383
<ToggleSwitch />
84-
</a>
84+
</div>
8585
</li>
8686
</ul>
8787
</header>

src/containers/Main.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import {StyleProvider} from "../contexts/StyleContext";
2020
import {useLocalStorage} from "../hooks/useLocalStorage";
2121
import "./Main.css";
2222
import {
23-
greeting,
2423
workExperiences,
2524
skillsSection,
2625
openSource,

src/containers/blogs/Blogs.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import hashnodeData from "../../data/hash-blogs.json";
99

1010
export default function Blogs() {
1111
const {isDark} = useContext<any>(StyleContext);
12-
const [mediumHashnodeBlogs, _] = useState([
12+
const [mediumHashnodeBlogs] = useState([
1313
...blogsData.items,
1414
...hashnodeData.items
1515
]);

src/containers/profile/Profile.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
import React, { useState, lazy, Suspense } from "react";
2-
import { openSource } from "../../portfolio";
1+
import React, {useState, lazy, Suspense} from "react";
2+
import {openSource} from "../../portfolio";
33
import Contact from "../contact/Contact";
44
import Loading from "../loading/Loading";
5-
import profileData from '../../data/profile.json';
5+
import profileData from "../../data/profile.json";
66

77
const renderLoader = () => <Loading />;
8-
const GithubProfileCard = lazy(() =>
9-
import("../../components/githubProfileCard/GithubProfileCard")
8+
const GithubProfileCard = lazy(
9+
() => import("../../components/githubProfileCard/GithubProfileCard")
1010
);
1111
export default function Profile() {
12-
const [prof, setrepo] = useState(profileData.data.user);
12+
const [prof] = useState(profileData.data.user);
1313
if (
1414
openSource.display &&
1515
openSource.showGithubProfile === "true" &&
@@ -23,4 +23,4 @@ export default function Profile() {
2323
} else {
2424
return <Contact />;
2525
}
26-
}
26+
}

src/containers/projects/Projects.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export default function Projects() {
1111
);
1212
const FailedLoading = () => null;
1313
const renderLoader = () => <Loading />;
14-
const [repo, setrepo] = useState(profileData.data.user.pinnedItems.edges);
14+
const [repo] = useState(profileData.data.user.pinnedItems.edges);
1515
// todo: remove useContex because is not supported
1616
const {isDark} = useContext<any>(StyleContext);
1717

0 commit comments

Comments
 (0)