Further improved minimization of Language and fixed an overflow-x bug
This commit is contained in:
@ -28,7 +28,7 @@ import { CSSTransition, TransitionGroup } from 'react-transition-group';
|
||||
|
||||
import Styles from './Modal.scss';
|
||||
|
||||
import Language from '@public/language/Language';
|
||||
import { withLanguage } from '@public/language/Language';
|
||||
import { openModal, closeModal } from '@public/actions/ModalActions';
|
||||
import Keyboard from '@public/keyboard/Keyboard';
|
||||
|
||||
@ -55,14 +55,14 @@ class Modal extends React.Component {
|
||||
|
||||
render() {
|
||||
let newProps = {...this.props};
|
||||
let { buttons, closeModal, close, title, children, large, modal } = newProps;
|
||||
let { buttons, closeModal, close, title, children, large, modal, lang } = newProps;
|
||||
["onExited"].forEach(e => delete newProps[e]);
|
||||
|
||||
//Add necessary buttons
|
||||
buttons = buttons || [];
|
||||
if(!Array.isArray(buttons)) buttons = [ buttons ];
|
||||
|
||||
if(close) buttons = [...buttons,<Button key="close" onClick={closeModal} children={Language.get("modal.close")} />];
|
||||
if(close) buttons = [...buttons, <Button key="close" onClick={closeModal} children={ lang.modal.close } />];
|
||||
|
||||
//Inner divs
|
||||
let heading,body,footer;
|
||||
@ -111,8 +111,7 @@ class Modal extends React.Component {
|
||||
|
||||
const mapStateToProps = (state) => {
|
||||
return {
|
||||
modal: state.modal,
|
||||
language: state.language
|
||||
modal: state.modal
|
||||
};
|
||||
}
|
||||
|
||||
@ -123,4 +122,4 @@ const mapDispatchToProps = (dispatch) => {
|
||||
},dispatch);
|
||||
}
|
||||
|
||||
export default connect(mapStateToProps, mapDispatchToProps)(Modal);
|
||||
export default connect(mapStateToProps, mapDispatchToProps)(withLanguage(Modal));
|
||||
|
@ -22,33 +22,33 @@
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
import React from 'react';
|
||||
import { connect } from 'react-redux';
|
||||
import Frame from './Frame';
|
||||
import Language from './../../language/Language';
|
||||
import { withLanguage } from '@public/language/Language';
|
||||
|
||||
class AddressBar extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
}
|
||||
|
||||
onChange() {
|
||||
|
||||
onChange(e) {
|
||||
if(this.props.onChange) this.props.onChange(e);
|
||||
}
|
||||
|
||||
render() {
|
||||
let { href, lang } = this.props;
|
||||
let clazz = "o-window__address-bar";
|
||||
|
||||
return (
|
||||
<div className={clazz}>
|
||||
<span className="o-window__address-bar-title">
|
||||
{ Language.get("window.address") }
|
||||
{ lang.window.address }
|
||||
</span>
|
||||
<Frame className="o-window__address-bar-frame">
|
||||
<input
|
||||
type="text"
|
||||
value={this.props.href}
|
||||
value={ href }
|
||||
className="o-window__input o-window__address-bar-input"
|
||||
onChange={ this.onChange.bind(this) }
|
||||
onChange={e => this.onChange(e)}
|
||||
/>
|
||||
</Frame>
|
||||
</div>
|
||||
@ -56,10 +56,4 @@ class AddressBar extends React.Component {
|
||||
}
|
||||
}
|
||||
|
||||
const mapStateToProps = (state) => {
|
||||
return {
|
||||
code: state.language.code
|
||||
};
|
||||
}
|
||||
|
||||
export default connect(mapStateToProps)(AddressBar);
|
||||
export default withLanguage(AddressBar);
|
||||
|
Reference in New Issue
Block a user