From 73994a8f83df09abd49e269ae234666d7237da9a Mon Sep 17 00:00:00 2001 From: Gerardo Pacheco Date: Tue, 7 Jan 2020 14:58:53 +0100 Subject: [PATCH] [RNMobile] Page Template Picker UI Improvements (#19307) * RNMobile - Page template picker: styles and icons, scroll and accessibility text * Update Page templates picker for web * RNMobile - Layout template picker: accessibility hint added * RNMobile - Layout template picker: style improvements, removed unneeded icons * Page layout picker: remove Icon dependency --- .../components/page-template-picker/button.js | 3 +- .../page-template-picker/button.native.js | 40 ++++++++++++++----- .../page-template-picker/container.js | 9 ++++- .../page-template-picker/container.native.js | 24 ++++++++++- .../page-template-picker/default-templates.js | 4 +- .../components/page-template-picker/picker.js | 22 +++++----- .../page-template-picker/styles.native.scss | 36 +++++++++++++++++ .../src/components/layout/index.native.js | 2 +- 8 files changed, 110 insertions(+), 30 deletions(-) create mode 100644 packages/block-editor/src/components/page-template-picker/styles.native.scss diff --git a/packages/block-editor/src/components/page-template-picker/button.js b/packages/block-editor/src/components/page-template-picker/button.js index 6677fb87af5bc..7d5b03479816d 100644 --- a/packages/block-editor/src/components/page-template-picker/button.js +++ b/packages/block-editor/src/components/page-template-picker/button.js @@ -5,13 +5,14 @@ import { Button } from '@wordpress/components'; const PickerButton = ( props ) => { const { + icon, label, onPress, } = props; return ( ); }; diff --git a/packages/block-editor/src/components/page-template-picker/button.native.js b/packages/block-editor/src/components/page-template-picker/button.native.js index 36f9a97eb6c43..897ceb20dd41f 100644 --- a/packages/block-editor/src/components/page-template-picker/button.native.js +++ b/packages/block-editor/src/components/page-template-picker/button.native.js @@ -1,20 +1,40 @@ /** * External dependencies */ -import { Button } from 'react-native'; +import { TouchableOpacity, Text } from 'react-native'; -const PickerButton = ( props ) => { - const { - label, - onPress, - } = props; +/** + * WordPress dependencies + */ +import { __ } from '@wordpress/i18n'; +import { withPreferredColorScheme } from '@wordpress/compose'; + +/** + * Internal dependencies + */ +import styles from './styles.scss'; + +const PickerButton = ( { + icon, + label, + onPress, + getStylesFromColorScheme, +} ) => { + const butonStyles = getStylesFromColorScheme( styles.button, styles.buttonDark ); + const butonTextStyles = getStylesFromColorScheme( styles.buttonText, styles.buttonTextDark ); return ( -