@wordpress/components
Version:
UI components for WordPress.
44 lines (39 loc) • 1.23 kB
JavaScript
import { createElement } from "@wordpress/element";
/**
* External dependencies
*/
import { View, Text, Platform } from 'react-native';
/**
* WordPress dependencies
*/
import { __ } from '@wordpress/i18n';
import { Icon, check } from '@wordpress/icons';
import { usePreferredColorSchemeStyle } from '@wordpress/compose';
/**
* Internal dependencies
*/
import styles from './styles.scss';
import ActionButton from './action-button';
function ApplyButton(_ref) {
let {
onPress
} = _ref;
const buttonTextStyle = usePreferredColorSchemeStyle(styles['button-text'], styles['button-text-dark']);
const applyButtonStyle = usePreferredColorSchemeStyle(styles['apply-button-icon'], styles['apply-button-icon-dark']);
return createElement(View, {
style: styles['apply-button']
}, createElement(ActionButton, {
onPress: onPress,
accessibilityLabel: __('Apply'),
accessibilityHint: __('Applies the setting')
}, Platform.OS === 'ios' ? createElement(Text, {
style: buttonTextStyle,
maxFontSizeMultiplier: 2
}, __('Apply')) : createElement(Icon, {
icon: check,
size: 24,
style: applyButtonStyle
})));
}
export default ApplyButton;
//# sourceMappingURL=apply-button.native.js.map