Skip to content

Commit

Permalink
running prettier on big gatsby files (#9358)
Browse files Browse the repository at this point in the history
  • Loading branch information
stevector authored Dec 18, 2024
1 parent 6387e86 commit 603eedb
Show file tree
Hide file tree
Showing 3 changed files with 215 additions and 193 deletions.
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

0 comments on commit 603eedb

Please sign in to comment.