You've already forked joplin
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:
29
ReactNativeClient/src/components/login-button.js
Normal file
29
ReactNativeClient/src/components/login-button.js
Normal 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 };
|
7
ReactNativeClient/src/locale.js
Normal file
7
ReactNativeClient/src/locale.js
Normal 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 { _ };
|
Reference in New Issue
Block a user