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'; | |
export default ChatBubble = props => { | |
return ( | |
<div className='wrapper'> | |
<div className='header'> | |
<div className='sentBy'> | |
{props.sentBy} | |
</div> | |
<div className='avatar'> |
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'; | |
export default ChatBubble = props => { | |
return ( | |
<div className='wrapper'> | |
<Header {...props}/> | |
<div className='body'> | |
<div className='messageContent'> | |
{props.messageContent} | |
</div> |
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'; | |
export default ChatBubble = props => { | |
return ( | |
<div className='wrapper'> | |
<Header {...props}/> | |
<div className='body'> | |
{props.children} | |
</div> | |
<Footer {...props}/> |
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 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} |
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
const defaultState = { | |
user: {} | |
}; | |
export default function reducer(state, action) { | |
state = state || defaultState; | |
const { type, payload } = action; | |
switch (type) { | |
case 'SET_USER_DETAILS': |
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 { connect } from 'react-redux'; | |
const User = props => ( | |
<div> | |
{props.user.name} | |
</div> | |
); | |
function mapStateToProps(state) { |
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 { createAction } from 'redux-actions'; | |
import keyMirror from 'keymirror'; | |
export const default_state = { | |
data: {}, | |
ui: {} | |
}; | |
export const ArticleActionTypes = keyMirror({ | |
SET_ARTICLES: null, |
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 { combineReducers } from 'redux'; | |
import ArticleDucks from './ducks/ArticleDucks'; | |
export default combineReducers({ | |
articles_reducer: ArticleDucks, | |
}); |
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 { createStore } from 'redux'; | |
import rootReducer from './rootReducer.js'; | |
const store = createStore(rootReducer); | |
export default store; |
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 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( |