This file contains hidden or 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
import React, { Component } from 'react' | |
import withLoading from '../hocs/withLoading' | |
class CommentList extends Component { | |
render() { | |
return ( | |
<ul> | |
{ | |
this.props.comments.map(({ id, body }) => <li key={id}>{body}</li>) | |
} |
This file contains hidden or 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, { Component } from 'react' | |
import Loading from './Loading' | |
class CommentList extends Component { | |
render() { | |
const { isLoading, comments } = this.props | |
if (isLoading) return <Loading /> | |
return ( | |
<ul> |
This file contains hidden or 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 renderer from 'react-test-renderer' | |
import shallowRenderer from 'react-test-renderer/shallow' | |
import App from './App' | |
describe('Test app component', () => { | |
it('shallow snapshot', () => { | |
const renderer = new shallowRenderer | |
const snapshot = renderer.render(<App />) | |
expect(snapshot).toMatchSnapshot() |
This file contains hidden or 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
var AWS = require('aws-sdk') | |
var gm = require('gm').subClass({ imageMagick: true }) | |
var s3 = new AWS.S3() | |
exports.handler = function(event, context, callback) { | |
var prefix = 'resized-' | |
var srcBucket = event.Records[0].s3.bucket.name | |
var dstBucket = prefix + srcBucket | |
var srcKey = decodeURIComponent(event.Records[0].s3.object.key.replace(/\+/g, " ")) | |
var dstKey = prefix + srcKey |
NewerOlder