import React from 'react';
import { connect } from 'react-redux';
import { i18nActions } from 'redux-react-i18n';


const mapStateToProps = ( {i18n: { currentLanguage }}, ownProps ) => ({
    currentLanguage
});

const mapDispatchToProps = ( dispatch ) => ({
    switchLanguage: ( code ) => dispatch( i18nActions.setCurrent( code ) )
});

const LanguageSwitcher = ( {currentLanguage, switchLanguage} ) => {
    return (
        <div style={{margin: '20px 0px 20px 0px'}}>
            <button className="btn btn-default" disabled={ currentLanguage === 'en-US' } type="button" onClick={ () => switchLanguage( 'en-US' ) }>English</button>
            <button className="btn btn-default" disabled={ currentLanguage === 'ru-RU' } type="button" onClick={ () => switchLanguage( 'ru-RU' ) }>Русский</button>
            <button className="btn btn-default" disabled={ currentLanguage === 'pl' } type="button" onClick={ () => switchLanguage( 'pl' ) }>Polish</button>
            <button className="btn btn-default" disabled={ currentLanguage === 'fr' } type="button" onClick={ () => switchLanguage( 'fr' ) }>French</button>
            <button className="btn btn-default" disabled={ currentLanguage === 'be' } type="button" onClick={ () => switchLanguage( 'be' ) }>Белорусский</button>
        </div>);
};

export default connect( mapStateToProps, mapDispatchToProps )( LanguageSwitcher );

@@ -18,17 +18,16 @@
  'react'
-;
 %0Aimport 
@@ -56,17 +56,16 @@
 t-redux'
-;
 %0Aimport 
@@ -107,12 +107,10 @@
 18n'
-;
 %0A%0A
-%0A
 cons
@@ -132,16 +132,17 @@
 ps = ( %7B
+ 
 i18n: %7B 
@@ -158,16 +158,17 @@
 nguage %7D
+ 
 %7D, ownPr
@@ -173,24 +173,25 @@
 Props ) =%3E (
+ 
 %7B%0A    curren
@@ -201,18 +201,18 @@
 nguage%0A%7D
+ 
 )
-;
 %0A%0Aconst 
@@ -249,16 +249,17 @@
 h ) =%3E (
+ 
 %7B%0A    sw
@@ -328,18 +328,18 @@
 de ) )%0A%7D
+ 
 )
-;
 %0A%0Aconst 
@@ -1288,12 +1288,10 @@
 iv%3E)
-;
 %0A%7D
-;
 %0A%0Aex
@@ -1373,6 +1373,5 @@
 er )
-;
 %0A

Update LanguageSwitcher.js