Skip to content

Commit

Permalink
Clean leftover comments and TODOs
Browse files Browse the repository at this point in the history
  • Loading branch information
Chalarangelo committed Nov 22, 2019
1 parent 2284f46 commit 7b1afdc
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 33 deletions.
22 changes: 8 additions & 14 deletions gatsby-browser.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,13 @@
/* eslint-disable */
/**
* Implement Gatsby's Browser APIs in this file.
*
* See: https://www.gatsbyjs.org/docs/browser-apis/
*/

// You can delete this file if you're not using it

/*
Gatsby Browser API
*/
let locationScrollTops = [];

const sendPageView = () => {
const pagePath = location
? location.pathname + location.search + location.hash
: undefined
window.gtag(`event`, `page_view`, { page_path: pagePath })
: undefined;
window.gtag(`event`, `page_view`, { page_path: pagePath });
};

const onPreRouteUpdate = ({ location, prevLocation }) => {
Expand All @@ -33,11 +27,11 @@ const onRouteUpdate = ({ location, prevLocation }) => {
if (process.env.NODE_ENV === `production` && typeof gtag === `function`) {
if (`requestAnimationFrame` in window) {
requestAnimationFrame(() => {
requestAnimationFrame(sendPageView)
})
requestAnimationFrame(sendPageView);
});
} else {
// simulate 2 requestAnimationFrame calls
setTimeout(sendPageView, 32)
setTimeout(sendPageView, 32);
}
}
};
Expand Down
10 changes: 3 additions & 7 deletions gatsby-ssr.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
/**
* Implement Gatsby's SSR (Server Side Rendering) APIs in this file.
*
* See: https://www.gatsbyjs.org/docs/ssr-apis/
*/

// You can delete this file if you're not using it
/*
Gatsby SSR API
*/
export { default as wrapRootElement } from 'state/ReduxWrapper';
7 changes: 1 addition & 6 deletions src/atoms/meta/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const Meta = ({
logoSrc,
structuredData,
}) => {
const _l = _(locale); // IDEA: Pass this to all components below or use it in Redux store to be able to localize the website in the future
const _l = _(locale);
const metaDescription = description || _l('site.pageDescription');

// Load scripts
Expand Down Expand Up @@ -97,7 +97,6 @@ const Meta = ({
} }
title={ title ? title : _l('site.title') }
titleTemplate={ title ? `%s - ${_l('site.title')}` : '%s' }
// IDEA: generalize the meta, extract a constant or config somewhere
meta={ [
{
name: `description`,
Expand Down Expand Up @@ -125,10 +124,6 @@ const Meta = ({
},
].concat(meta) }
script={ scripts }
// IDEA: See if we need to deal with this later
// bodyAttributes={{
// class: ''
// }}
>
<link
rel="preconnect dns-prefetch"
Expand Down
2 changes: 0 additions & 2 deletions src/functions/build/sourceNodes.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ const sourceNodes = (requirables, reducers) => ({ actions, createNodeId, createC
snippetNodes[rec.snippetKey].recommendationRanking = rec.recommendationRanking;
});

// debugger;

Object.entries(snippetNodes).forEach(([id, sNode]) => {
let mNode = markdownNodes.find(mN => mN.fileAbsolutePath.includes(`${id}.md`));
let reducer = reducers[sNode.reducer];
Expand Down
2 changes: 1 addition & 1 deletion src/organisms/snippetList/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const SnippetList = ({
)) }
<Paginator paginator={ paginator } />
</>
) : null; // IDEA: Show a loader or a message
) : null;
};

SnippetList.propTypes = {
Expand Down
3 changes: 2 additions & 1 deletion src/state/navigation.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Defalt state
// Default state
const initialState = {
lastPageTitle: 'Home',
lastPageUrl: '/',
Expand Down Expand Up @@ -26,6 +26,7 @@ export default (state = initialState, action) => {
}
};

// Persistence configuration
export const persistConfig = {
key: 'navigation',
blacklist: [''],
Expand Down
3 changes: 2 additions & 1 deletion src/state/search.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { searchIndexingEngine as tokenize } from 'engines';

// Defalt state
// Default state
const initialState = {
initialized: false,
searchQuery: '',
Expand Down Expand Up @@ -83,6 +83,7 @@ export default (state = initialState, action) => {
}
};

// Persistence configuration
export const persistConfig = {
key: 'search',
blacklist: ['initialized'],
Expand Down
3 changes: 2 additions & 1 deletion src/state/shell.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import cacheKey from '../../.build/cacheKey';

// Defalt state
// Default state
const initialState = {
isDarkMode: undefined,
cacheKey,
Expand Down Expand Up @@ -45,6 +45,7 @@ export default (state = initialState, action) => {
}
};

// Persistence configuration
export const persistConfig = {
key: 'shell',
blacklist: ['newCacheKey'],
Expand Down

0 comments on commit 7b1afdc

Please sign in to comment.