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

running prettier on big gatsby files #9358

Merged
merged 1 commit into from
Dec 18, 2024
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
54 changes: 29 additions & 25 deletions gatsby-browser.js
Original file line number Diff line number Diff line change
@@ -1,53 +1,57 @@
import React from "react"
import { location, globalHistory } from "@reach/router"
import React from 'react';
import { location, globalHistory } from '@reach/router';

// Import PDS Global wrapper for applying global context providers.
import { GlobalWrapper } from "@pantheon-systems/pds-toolkit-react"
import { MOBILE_MENU_BREAKPOINT } from './src/vars/responsive'
import { GlobalWrapper } from '@pantheon-systems/pds-toolkit-react';
import { MOBILE_MENU_BREAKPOINT } from './src/vars/responsive';

// Import PDS core styles.
import "./node_modules/@pantheon-systems/pds-toolkit-react/_dist/css/pds-core.css"
import "./node_modules/@pantheon-systems/pds-toolkit-react/_dist/css/pds-layouts.css"
import "./node_modules/@pantheon-systems/pds-toolkit-react/_dist/css/pds-components.css"
import './node_modules/@pantheon-systems/pds-toolkit-react/_dist/css/pds-core.css';
import './node_modules/@pantheon-systems/pds-toolkit-react/_dist/css/pds-layouts.css';
import './node_modules/@pantheon-systems/pds-toolkit-react/_dist/css/pds-components.css';

// Global styles
import "./src/styles/main.css"
import "./src/styles/custom-glyphicons.css"
import "./src/styles/pds-additions.css"
import './src/styles/main.css';
import './src/styles/custom-glyphicons.css';
import './src/styles/pds-additions.css';

// custom typefaces
import "prismjs/themes/prism-okaidia.css"
import 'prismjs/themes/prism-okaidia.css';

// Code block line numbering
import "prismjs/plugins/line-numbers/prism-line-numbers.css"
import 'prismjs/plugins/line-numbers/prism-line-numbers.css';

// Code block shell prompt
import "./src/styles/codeBlocks.css"
import './src/styles/codeBlocks.css';

// TOC generator
import "tocbot/dist/tocbot.css"
import "tocbot/dist/tocbot.min.js"
import 'tocbot/dist/tocbot.css';
import 'tocbot/dist/tocbot.min.js';

//Segment
export const onRouteUpdate = () => {
window.locations = window.locations || [document.referrer]
locations.push(window.location.href)
window.previousPath = locations[locations.length - 2]
window.locations = window.locations || [document.referrer];
locations.push(window.location.href);
window.previousPath = locations[locations.length - 2];
window.analytics &&
window.analytics.page({
url: window.location.href,
referrer: window.previousPath,
title: document.title,
})
});
//console.log("Title: ", document.title) //For debugging
}
};

// Trigger resize event once rendered
export const onInitialClientRender = () => {
window.dispatchEvent(new Event("resize"))
}
window.dispatchEvent(new Event('resize'));
};

// Global context providers
// Global context providers.
export const wrapRootElement = ({ element }) => {
return <GlobalWrapper mobileMenuMaxWidth={MOBILE_MENU_BREAKPOINT}>{element}</GlobalWrapper>
}
return (
<GlobalWrapper mobileMenuMaxWidth={MOBILE_MENU_BREAKPOINT}>
{element}
</GlobalWrapper>
);
};
Loading
Loading