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, { PureComponent } from 'react' | |
import { connect } from 'react-redux' | |
import { getUser } from 'user/selectors' | |
class UserView extends PureComponent { | |
render() { | |
let { user } = this.props | |
return ( | |
<div> |
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
// don't make a specific component just to add a style, don't do | |
let BlueButton = ({children}) => <button style={{color: 'blue'}}>{children}</button> | |
let MyPage = () => <div> | |
<BlueButton>Add item</BlueButton> | |
</div> | |
// in this case just use the default html button tag, just do | |
let MyPage = () => <div> | |
<button style={{color: 'blue'}}>Add item</button> | |
</div> |
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
// don't do | |
let AddItemToCartButton = ({icon, title}) => <button>{!!icon && <i className={'fa fa-' + icon}/>}{title}</button> | |
// this forces you to add a prop | |
<AddItemToCartButton title=”Add item to cart” /> | |
// and with icon | |
<AddItemToCartButton title=”Add item to cart” icon="plus"/> | |
//do | |
let AddItemToCartButton = ({children}) => <button>{children}</button> | |
//this is more explicit |
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' | |
import React, { PropTypes, Component } from 'react' | |
let Fill = ({ | |
start, end, | |
getPositionFromValue | |
}) => | |
<div | |
className='rangeslider__fill' | |
style={{ | |
left: (getPositionFromValue(start) + 10 )+ 'px', |
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
// Publish it as a Google App Script Web App to forward email from the contact form to your email using SendGrid | |
// This is intended for use with https://github.com/misterfresh/react-drive-cms | |
var sendGridApiKey = | |
'YOUR-SENDGRID-API-KEY' | |
var sendGridVerifiedSenderEmail = 'YOUR-SENDGRID-VERIFIED-SENDER-EMAIL' | |
var sendGridVerifiedSenderName = 'YOUR-SENDGRID-VERIFIED-SENDER-NAME' | |
var contactEmail = 'YOUR-CONTACT-EMAIL' | |
var contactName = 'YOUR-CONTACT-NAME' | |
var visitorsSpreadsheetName = 'Visitors' |
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
// This script is intended for use with https://github.com/misterfresh/react-drive-cms | |
// Add it as a bound script to the Dashboard Sheet file | |
function onOpen() { | |
var dashboard = SpreadsheetApp.getActiveSpreadsheet(); | |
var updateDashboard = [{name: "Update Dashboard", functionName: "prepareSheets"}]; | |
dashboard.addMenu("Update", updateDashboard); | |
} | |
function prepareSheets() { | |
var Preparator = { |