1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-07-03 23:50:33 +02:00

Started moving components to own file

This commit is contained in:
Laurent Cozic
2017-05-09 19:17:58 +00:00
parent b6cf34450f
commit 61ea8f2963
7 changed files with 42 additions and 33 deletions

View File

@ -0,0 +1,29 @@
import React, { Component } from 'react';
import { connect } from 'react-redux'
import { Button } from 'react-native';
import { _ } from 'src/locale.js';
class LoginButtonComponent extends Component {
render() {
return <Button onPress={this.props.onPress} title={_(this.props.label)} />
}
}
const LoginButton = connect(
(state) => {
return { label: state.myButtonLabel };
},
(dispatch) => {
return {
onPress: function() {
dispatch({
type: 'INC_COUNTER'
});
}
}
}
)(LoginButtonComponent)
export { LoginButton };

View File

@ -0,0 +1,7 @@
// This function does nothing for now, but later will return
// a different string depending on the language.
function _(s) {
return s;
}
export { _ };