Skip to content

Instantly share code, notes, and snippets.

View mcallegari10's full-sized avatar
🎮

Martín Callegari mcallegari10

🎮
  • Buenos Aires, Argentina
View GitHub Profile
@mcallegari10
mcallegari10 / App.js
Last active September 7, 2017 21:22
React Chat Widget 1
import React, { Component } from 'react';
import { Widget } from 'react-chat-widget';
class App extends Component {
render() {
return (
<div className="App">
<Widget />
</div>
);
@mcallegari10
mcallegari10 / App.js
Last active September 7, 2017 21:27
React Chat Widget 2
import React, { Component } from 'react';
import { Widget } from 'react-chat-widget';
class App extends Component {
handleNewUserMessage = (newMessage) => {
console.log(`New message incomig! ${newMessage}`);
// Now send the message throught the backend API
}
render() {
@mcallegari10
mcallegari10 / App.js
Last active February 6, 2018 15:07
React Chat Widget 3
import React, { Component } from 'react';
import { Widget, addResponseMessage, addLinkSnippet, addUserMessage } from 'react-chat-widget';
import logo from './logo.svg';
class App extends Component {
componentDidMount() {
addResponseMessage("Welcome to this awesome chat!");
}
handleNewUserMessage = (newMessage) => {
@mcallegari10
mcallegari10 / App.js
Created September 7, 2017 21:34
React Chat Widget 4
import React, { Component } from 'react';
import { Widget, addResponseMessage } from 'react-chat-widget';
class App extends Component {
componentDidMount() {
addResponseMessage("Welcome to this awesome chat!");
}
handleNewUserMessage = (newMessage) => {
console.log(`New message incomig! ${newMessage}`);
@mcallegari10
mcallegari10 / styles.css
Created September 20, 2017 21:58
Styles overriding examples
.conversation-container > .header {
background-color: red;
}
.message > .response {
background-color: black;
color: white;
}
@mcallegari10
mcallegari10 / sass-setup.md
Created December 18, 2017 01:16
Ruby and SASS quick setup

Ruby

For the sole purpose to use SASS, you need to install Ruby the right way. That is with either RBENV or RVM. If you are not going to do the Ruby on Rails training, I highly encorage you to do it with RVM.

Installation

Run the following commands in your terminal:

import React from 'react';
// We can use react-loadable to cover the most possibles outcomes of the code splitting
import Loadable from 'react-loadable';
// My Loader component
import Loader from '@components/Loader';
// Create the async route
const AsyncRoute = Loadable({
loader: () => import('./index'),
import { RouterModule, Routes, PreloadAllModules } from @angular/router;
// You can say to Angular the route is async with the hash at the end of the import
export const ROUTES: Routes = [
{ path: '', pathMatch: 'full', redirectTo: 'dashboard' },
{ path: 'dashboard', loadChildren: '../dashboard/dashboard.module#DashboardModule' },
{ path: 'settings', loadChildren: '../settings/settings.module#SettingsModule' },
{ path: 'reports', loadChildren: '../reports/reports.module#ReportsModule' }
];
import Vue from 'vue'
import Navbar from '../../components/Navbar'
const AsyncComponent = () => import('../../components/AsyncComponent')
const vm = new Vue({
el: '#app',
// ... all attributes necessary for your instance
components: { Navbar, AsyncComponent }
cons AsyncRoute = () => import('./screens/AsyncRoute.vue')
const router = new VueRouter({
routes: [
{ path: '/async', component: AsyncRoute }
]
})