Skip to content

Instantly share code, notes, and snippets.

View spac3unit's full-sized avatar

Denis spac3unit

View GitHub Profile
import React from 'react';
import ModalWrapper from '../ModalWrapper.jsx';
const SignIn = props => {
const signIn = provider => {
props.hideModal();
props.signIn(provider);
};
/* ---------------------- */
/* ---- Neat Imports ---- */
/* ---------------------- */
/* -- webpack.config.shared.js -- */
export const sharedConfig = {
alias: {
'Utils': path.resolve(__dirname, '../src/app/utils/'),
},
};
import React from 'react';
const {PropTypes} = React;
const ModalWrapper = props => {
const handleBackgroundClick = e => {
if (e.target === e.currentTarget) props.hideModal();
};
const onOk = () => {
props.onOk();
/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain)
*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
function makeElement(type, props, text) {
const el = document.createElement(type);
Object.keys(props).forEach(prop => {
el[prop] = props[prop];
});
const textNode = document.createTextNode(text);
el.appendChild(textNode);
/* -- webpack.config.shared.js -- */
export const sharedConfig = {
alias: {
'Utils': path.resolve(__dirname, '../src/app/utils/'),
'Components': path.resolve(__dirname, '../src/app/components/'),
},
};
/* -- webpack.config.dev.js -- */
this.externalWindow = window.open(/* ... */);
copyStyles(document, this.externalWindow.document);
function copyStyles(sourceDoc, targetDoc) {
Array.from(sourceDoc.styleSheets).forEach(styleSheet => {
if (styleSheet.cssRules) { // for <style> elements
const newStyleEl = sourceDoc.createElement('style');
Array.from(styleSheet.cssRules).forEach(cssRule => {
// write the text of each rule into the body of the style element
newStyleEl.appendChild(sourceDoc.createTextNode(cssRule.cssText));
});
ease({
startValue: window.scrollY,
endValue: 0,
onStep: value => window.scroll(0, value),
onComplete: () => {
document.querySelector('#search').focus();
}
});
ease({
startValue: window.scrollY,
endValue: 0,
onStep: value => window.scroll(0, value),
});