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
[{ | |
id: 1234, | |
title: 'test', | |
view: 'two-column' | |
}, | |
{ | |
id: 1234, | |
title: 'test', | |
view: 'image-only' | |
}] |
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
// @flow | |
import React from 'react' | |
import classnames from 'classnames' | |
import type { ButtonT } from './ButtonT' | |
const Button = ({ className, type = 'button', text, tabIndex, onClick = () => {}, disabled = false }: ButtonT) => ( | |
<button | |
className={classnames('button', className)} | |
type={type} |
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
componentWillReceiveProps (nextProps) { | |
// see if new content was found by the service worker | |
if (nextProps.serviceWorker.serviceWorkerUpdated) { | |
this.setState({ | |
notifications: this.state.notifications.concat({ | |
'The app has been updated! Hooray! Refresh your browser to enjoy the latest and greatest', | |
'some unique key', | |
action: 'Dismiss', | |
dismissAfter: 4000, | |
onClick: this.removeNotification |
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 from 'react'; | |
import ReactDOM from 'react-dom'; | |
import { Provider } from 'react-redux'; | |
import { updateServiceworker } from 'service-worker-redux' | |
import configureStore from 'store/configure-store' | |
import './index.css'; | |
import App from './App'; | |
import registerServiceWorker from './registerServiceWorker'; | |
const store = configureStore() |
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 { createSelector } from 'reselect' | |
// CONSTANTS | |
export const UPDATE_SERVICEWORKER = 'UPDATE_SERVICEWORKER' | |
export function updateServiceworker () { | |
return { | |
type: UPDATE_SERVICEWORKER | |
} | |
} |
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
deployment: | |
prod: | |
branch: master | |
commands: | |
- NODE_ENV=production yarn run build | |
- ./bin/s3Sync.sh [s3 bucket name] | |
staging: | |
branch: staging | |
commands: |
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
{ | |
"Version": "2012-10-17", | |
"Id": "Policy1489770524467", | |
"Statement": [ | |
{ | |
"Sid": "Stmt1489770487230", | |
"Effect": "Allow", | |
"Principal": { | |
"AWS": "[arn of iam user you created for circleci]" | |
}, |
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
function isJson (response) { | |
const contentType = response.headers.get('content-type') | |
return contentType && contentType.indexOf('application/json') !== -1 | |
} | |
export function handleResponse (response) { | |
if (response.ok) { | |
if (isJson(response)) { | |
return response.json() | |
} else { |
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
<% if (process.env.NODE_ENV !== 'development') { %> | |
<script> | |
var _rollbarConfig = { | |
accessToken: '%REACT_APP_ROLLBAR_TOKEN%', | |
captureUncaught: true, | |
captureUnhandledRejections: true, | |
payload: { | |
environment: '%NODE_ENV%', | |
client: { | |
javascript: { |
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
deployment: | |
prod: | |
branch: master | |
commands: | |
- NODE_ENV=production REACT_APP_GIT_SHA=$CIRCLE_SHA1 REACT_APP_ROLLBAR_TOKEN=$ROLLBAR_TOKEN yarn run build |