Skip to content

Instantly share code, notes, and snippets.

View zrod's full-sized avatar
💻
Refactoring https://donating.io

Rodrigo zrod

💻
Refactoring https://donating.io
View GitHub Profile
@zrod
zrod / App.jsx
Last active February 1, 2018 02:10
// ...
export class App extends React.Component
{
static propTypes = {
auth: PropTypes.object.isRequired
};
render() {
// ...
@zrod
zrod / authReducer.js
Created December 2, 2017 17:21
spread operator mess
import authType from './authType';
import { LIKE_POST_SUCCESS } from '../actions/actionTypes';
export default function authReducer(state = authType, action) {
switch (action.type) {
// ...
case types.LIKE_POST_SUCCESS:
return {
...state,
...{
import React, { Component } from 'react';
import { render } from 'react-dom';
import { BrowserRouter as Router , Route, Link } from 'react-router-dom';
import SuperAgent from 'superagent';
class Home extends Component {
render(){
return (
<div className="page-content">TEST
</div>);
@zrod
zrod / Pousada.js
Last active November 2, 2017 02:11
ng-4 - Cannot read property 'title' of undefined
export class Pousada {
slug: string;
title: string;
location: string;
lat: string;
long: string;
images: {
main: string
};
}
// object structure
{
id: '57dce89f84bec9ff038b456d',
slug: 'toronto',
country: {
id: '564e85d284bec915048b4568'
},
views: 14,
comments: [
{
import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { Link } from 'react-router';
import moment from 'moment';
import { Button, Comment, Form, Header, Message, Divider } from 'semantic-ui-react';
import { sprintf } from 'sprintf-js';
import * as validationRules from '../../../resources/ValidationRules';
import I18n from '../../../helpers/I18n';
<div>
<h1>{{pousada.title}}</h1>
<small>{{pousada.location}}</small>
<iframe
width="600"
height="450"
frameborder="0" style="border:0"
src="https://www.google.com/maps/embed/v1/place?key={{googleMapsKey}}
&q=Space+Needle,Seattle+WA" allowfullscreen
import { Component } from '@angular/core'
@Component({
selector: 'app',
template: `
<div>
<h2>Hello {{name}}</h2>
</div>
`,
})
import React, { PropTypes } from 'react';
import { Message } from 'semantic-ui-react';
import I18n from '../../helpers/I18n';
const ErrorBlock = ({errors}) => {
let errorList = [];
for (let error in errors) {
errorList.push(errors[error]);
}
import React, {PropTypes} from 'react';
import {Form} from 'semantic-ui-react';
import I18n from '../../helpers/I18n';
const AdForm = ({ad, onChange}) => {
return (
<Form>
<h1>{i18n.ad.new}</h1>
<Form.Input