Skip to content

Commit

Permalink
Trunk fix, fix esx imports, useTransitions api change
Browse files Browse the repository at this point in the history
  • Loading branch information
machariamuguku committed Sep 16, 2024
1 parent 66cb464 commit dd0f218
Show file tree
Hide file tree
Showing 13 changed files with 22 additions and 60 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/gatsby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jobs:
run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }}
- name: Build with Gatsby
env:
PREFIX_PATHS: 'true'
PREFIX_PATHS: "true"
GATSBY_PORTFOLIO_GITHUB_TOKEN: ${{ secrets.GATSBY_PORTFOLIO_GITHUB_TOKEN }}
run: ${{ steps.detect-package-manager.outputs.manager }} run build
- name: Upload artifact
Expand Down
4 changes: 2 additions & 2 deletions jest.setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ beforeAll(() => {
// https://jestjs.io/docs/manual-mocks#mocking-methods-which-are-not-implemented-in-jsdom
Object.defineProperty(window, "matchMedia", {
writable: true,
value: jest.fn().mockImplementation(query => ({
value: jest.fn().mockImplementation((query) => ({
matches: false,
media: query,
onchange: null,
addListener: jest.fn(), // Deprecated
removeListener: jest.fn(), // Deprecated
addEventListener: jest.fn(),
removeEventListener: jest.fn(),
dispatchEvent: jest.fn(),
dispatchEvent: jest.fn()
}))
});
});
Expand Down
2 changes: 1 addition & 1 deletion src/components/NotSocialLinks.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { faLinkedinIn, faMedium } from "@fortawesome/free-brands-svg-icons";
import { MarkGithubIcon, MailIcon } from "@primer/octicons-react";

// react tooltip
import ReactTooltip from "react-tooltip";
import { Tooltip as ReactTooltip } from "react-tooltip";
// copy to clipboard
import { CopyToClipboard } from "react-copy-to-clipboard";
import styled from "styled-components";
Expand Down
8 changes: 3 additions & 5 deletions src/components/blog.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ const BottomContainer = styled.div`
`;

export function Blog() {
const data = useStaticQuery(
graphql`
const data = useStaticQuery(graphql`
{
allMediumPost(
limit: 3
Expand All @@ -83,9 +82,8 @@ export function Blog() {
}
}
}
}
`
);
}
`);
return (
<MainContainer>
<Container>
Expand Down
13 changes: 6 additions & 7 deletions src/components/header.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { MenuContext } from "./menuContext";
import { useMediaQuery } from "./customHooks/useMediaQuery";

// stylesheet
import styles from "./header.module.css";
import * as styles from "./header.module.css";

const allTabs = ["Home", "About", "Projects", "Blog", "Contact"];
const homeTabs = ["Home", "About", "Contact"];
Expand All @@ -29,9 +29,8 @@ export const Header = ({
blogRef
}) => {
// context consumer
const { activeMenuAndComponent, dispatchActiveMenuAndComponent } = useContext(
MenuContext
);
const { activeMenuAndComponent, dispatchActiveMenuAndComponent } =
useContext(MenuContext);

// internal state
const [toggleMobileNav, setToggleMobileNav] = useState(false);
Expand All @@ -40,7 +39,7 @@ export const Header = ({
const isMobileOrTablet = useMediaQuery("(max-width: 48rem)");

// react-spring animation
const transitions = useTransition(toggleMobileNav, null, {
const transitions = useTransition(toggleMobileNav, {
from: { transform: "translate3d(0,-60vh,0)" },
enter: { transform: "translate3d(0,0,0)" },
leave: { transform: "translate3d(0,-60vh,0)" }
Expand Down Expand Up @@ -96,8 +95,8 @@ export const Header = ({
{isMobileOrTablet ? (
<div>
{/* react-spring animation */}
{transitions.map(
({ item, key, props }) =>
{transitions(
(props, item, key) =>
item && (
<animated.div key={key} style={props} className={styles.item}>
{/* page links */}
Expand Down
5 changes: 2 additions & 3 deletions src/components/homeAboutContact/carets.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@ import { faCaretLeft, faCaretRight } from "@fortawesome/free-solid-svg-icons";
const navigationItems = ["Home", "About", "Contact"];

export function Carets({ direction }) {
const { activeMenuAndComponent, dispatchActiveMenuAndComponent } = useContext(
MenuContext
);
const { activeMenuAndComponent, dispatchActiveMenuAndComponent } =
useContext(MenuContext);

// dispatcher
const dispatchComponent = (payload) => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/homeAboutContact/contact.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { MailIcon } from "@primer/octicons-react";
// copy to clipboard
import { CopyToClipboard } from "react-copy-to-clipboard";
// react tooltip
import ReactTooltip from "react-tooltip";
import { Tooltip as ReactTooltip } from "react-tooltip";

const VerticalContainer = styled.div`
display: flex;
Expand Down
4 changes: 2 additions & 2 deletions src/components/homeAboutContact/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const MainContainer = styled.div`
export function HomeAboutContact() {
const { activeMenuAndComponent } = useContext(MenuContext);

const transition = useTransition(activeMenuAndComponent.Component, null, {
const transitions = useTransition(activeMenuAndComponent.Component, {
from: {
display: "flex",
textAlign: "center",
Expand All @@ -45,7 +45,7 @@ export function HomeAboutContact() {

return (
<MainContainer>
{transition.map(({ item, key, props }) => (
{transitions((props, item, key) => (
<animated.div key={key} style={props}>
{item === "Home" ? (
<Unified bracketLeft="{" bracketRight="}">
Expand Down
5 changes: 2 additions & 3 deletions src/components/navigationCircles.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@ const Item = styled.a`
`;

export function NavigationCircles() {
const { activeMenuAndComponent, dispatchActiveMenuAndComponent } = useContext(
MenuContext
);
const { activeMenuAndComponent, dispatchActiveMenuAndComponent } =
useContext(MenuContext);

// dispatcher
const dispatchComponent = (payload) => {
Expand Down
Binary file modified src/images/512x512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 1 addition & 34 deletions src/images/Gatsby_Logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/images/backUp.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/images/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit dd0f218

Please sign in to comment.