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
i18n.map('en', { | |
global: { | |
save: 'Save', | |
create: 'Create', | |
logout: 'Logout', | |
back: 'Back', | |
cancel: 'Cancel', | |
delete: 'Delete', | |
confirm: 'Confirm', | |
choose: 'Choose', |
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
var info = function(image) { | |
var colorInfo = Colibri.extractImageColors(image, 'hex'); | |
var width = image.naturalWidth; | |
var height = image.naturalHeight; | |
console.log(colorInfo); | |
return { | |
width: width, | |
height: height, |
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
const lag = true; | |
const waitingTime = 400; | |
Meteor.startup(function() { | |
if (!lag) return; | |
const rootUrl = process.env.ROOT_URL; | |
if (rootUrl !== 'http://localhost:3000/') { | |
return; | |
} 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
class Component extends React.Component { | |
render () { | |
if (this.props.isLoading) return <span/> | |
return ( | |
<div> | |
{this.props.item.name} | |
</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
import {Meteor} from 'meteor/meteor' | |
import {withData} from 'meteor/orionsoft:react-meteor-data' | |
import MyCollection from './my-collection' | |
@withData(({itemId}) => { | |
const handler = Meteor.subscribe('myPublication', itemId) | |
const isLoading = !handler.ready() | |
const item = MyCollection.findOne(itemId) | |
return {isLoading, item} | |
}) |
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
// with-post.js | |
import {withData} from 'meteor/orionsoft:react-meteor-data' | |
import {Meteor} from 'meteor/meteor' | |
import Posts from './posts' | |
export default withData(({postId}) => { | |
Meteor.subscribe('post', postId) | |
const post = Posts.findOne(postId) | |
return {post} | |
}) |
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' | |
export default class Component extends React.Component { | |
static propTypes = { | |
} | |
render () { | |
return ( |
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
/* Before */ | |
export default graphql(query, { | |
options: ({ avatarSize }) => ({ variables: { avatarSize } }) | |
})(Component) | |
/* After */ | |
export default withGraphQL(query)(Component) |
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
/* Before */ | |
@withMutation(gql`mutation save ($title: String, $description: String) { | |
saveData (title: $title, description: $description) { | |
title | |
description | |
} | |
}`) | |
class Save extends React.Component { | |
async save () { |
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
/* Before */ | |
class Profile extends React.Component { | |
render () { | |
return <div>{this.props.data.currentUser.login}</div> | |
} | |
} | |
/* After */ | |
class Profile extends React.Component { | |
render () { |
OlderNewer