Skip to content

Instantly share code, notes, and snippets.

View rohanBagchi's full-sized avatar

Rohan Bagchi rohanBagchi

View GitHub Profile
import React from 'react';
export default ChatBubble = props => {
return (
<div className='wrapper'>
<div className='header'>
<div className='sentBy'>
{props.sentBy}
</div>
<div className='avatar'>
import React from 'react';
export default ChatBubble = props => {
return (
<div className='wrapper'>
<Header {...props}/>
<div className='body'>
<div className='messageContent'>
{props.messageContent}
</div>
import React from 'react';
export default ChatBubble = props => {
return (
<div className='wrapper'>
<Header {...props}/>
<div className='body'>
{props.children}
</div>
<Footer {...props}/>
import ChatBubble from './ChatBubble';
import ImageGallery from 'some-custom-gallery';
...
<ChatBubble sentBy={message.sentBy} time={message.time}>
<div className="message-body-wrapper">
{message.images.length &&
<ImageGallery images=[message.images]/>
}
{message.messageText}
const defaultState = {
user: {}
};
export default function reducer(state, action) {
state = state || defaultState;
const { type, payload } = action;
switch (type) {
case 'SET_USER_DETAILS':
import React from 'react';
import { connect } from 'react-redux';
const User = props => (
<div>
{props.user.name}
</div>
);
function mapStateToProps(state) {
import { createAction } from 'redux-actions';
import keyMirror from 'keymirror';
export const default_state = {
data: {},
ui: {}
};
export const ArticleActionTypes = keyMirror({
SET_ARTICLES: null,
import { combineReducers } from 'redux';
import ArticleDucks from './ducks/ArticleDucks';
export default combineReducers({
articles_reducer: ArticleDucks,
});
import { createStore } from 'redux';
import rootReducer from './rootReducer.js';
const store = createStore(rootReducer);
export default store;
import React from 'react';
import ReactDOM from 'react-dom';
import { Provider } from 'react-redux';
import store from './store';
import './index.css';
import './lib/bootstrap.min.css';
import AppContainer from './AppContainer';
import registerServiceWorker from './registerServiceWorker';
ReactDOM.render(