This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
const https = require("https"); | |
// These UAs receive the special page for OpenGraph | |
const opengraphUAs = [ | |
'facebookexternalhit/1.1', | |
'Twitterbot', | |
'Googlebot', | |
'Slack', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// React icon component | |
import React, { useMemo } from 'react' | |
import PropTypes from 'prop-types' | |
import classNames from 'classnames' | |
import Actions from '~images/icons/actions.inline.svg' | |
import ArrowUp from '~images/icons/arrow-up.inline.svg' | |
import ArrowRight from '~images/icons/arrow-right.inline.svg' | |
import Beaker from '~images/icons/beaker.inline.svg' | |
import Comment from '~images/icons/comment.inline.svg' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Inside each componenent, I defined navigation targets inline on the respective `<template>` elements: | |
<input | |
v-bind:value="value" | |
type="text" | |
rel="search-input" | |
:key-navigation-selectable="JSON.stringify(setSearchTargets())" | |
/> | |
// Potential targets are mapped out in a method below: | |
setSearchTargets: function(idx) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useEffect } from 'react' | |
import PropTypes from 'prop-types' | |
import { useHistory } from "react-router-dom" | |
/** | |
* If the user navigates by way of anything but the back button, scroll to the top. | |
* Otherwise, retrieve the previous scroll position when back is pressed, if a value | |
* has been previously stored. | |
* @param {String} key Internal react-router key provided by history listener |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
// `/.babelrc` | |
{ | |
"plugins": ["@babel/plugin-proposal-optional-chaining"] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// import { createUseStyles } from 'react-jss' | |
export const breakpoints = { | |
'xs': 480, | |
'sm': 720, | |
'md': 1280, | |
'lg': 1440, | |
'xl': 1920 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState, useEffect, ChangeEvent } from 'react'; | |
type DebouncedInputHookProps = { | |
delay: number; | |
callback: (value: string) => void; | |
}; | |
type DebouncedInputHookResult = { | |
debouncedValue: string; | |
handleChange: (event: ChangeEvent<HTMLInputElement>) => void; |