Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RNMobile] Editor Onboarding: "The Basics" help section - Details Part 1 #33790

Merged
merged 25 commits into from
Aug 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
c02c659
Add help menu option to iOS demo app
AmandaRiu Jul 6, 2021
d23f810
Add basic help topics bottom sheet
AmandaRiu Jul 6, 2021
6de6287
Add help option to Android demo app
AmandaRiu Jul 6, 2021
478447d
Add new help topics icons
AmandaRiu Jul 7, 2021
fd3ad45
Add help topics to main help bottom sheet
AmandaRiu Jul 7, 2021
1cd48a1
Remove unused imports
AmandaRiu Jul 7, 2021
7eff1a7
Optimized new SVG images using https://jakearchibald.github.io/svgomg/
AmandaRiu Jul 7, 2021
6f2a617
Merge branch 'trunk' into rnmobile/editor-onboarding-basic-help-2
AmandaRiu Jul 8, 2021
23c3531
Add navigation to help detail subsheet
AmandaRiu Jul 8, 2021
80ce670
Add react-native and react-navigation to package.json per lint
AmandaRiu Jul 8, 2021
5bfec94
Fix lint errors
AmandaRiu Jul 8, 2021
59ead05
Add images for help detail sections
AmandaRiu Jul 9, 2021
cca5bde
Add intro to blocks page
AmandaRiu Jul 9, 2021
787aa4f
Add remaining help detail pages
AmandaRiu Jul 9, 2021
c8d56fc
Link help details to topics
AmandaRiu Jul 9, 2021
556d1d9
WIP
AmandaRiu Jul 31, 2021
4bfd81d
Merge branch 'trunk' into rnmobile/editor-onboarding-basic-help-4
AmandaRiu Jul 31, 2021
8b11125
Remove unnecessary dependency
AmandaRiu Jul 31, 2021
0544993
Cleanup code, remove debugging
AmandaRiu Jul 31, 2021
dce0398
Patch to correct issues with asset loading at runtime
AmandaRiu Jul 31, 2021
4a1ca51
Fix lint errors by removing unused imports
AmandaRiu Aug 2, 2021
b2b1363
Remove extreneous filename extension from import
AmandaRiu Aug 2, 2021
af28285
Rename view property for clarity
AmandaRiu Aug 2, 2021
b68013c
Remove memoization
AmandaRiu Aug 2, 2021
c559402
Fix Metro local static image paths (#33829)
dcalhoun Aug 2, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions packages/editor/src/components/editor-help/add-blocks.native.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/**
* External dependencies
*/
import { View } from 'react-native';

/**
* WordPress dependencies
*/
import { __ } from '@wordpress/i18n';

/**
* Internal dependencies
*/
import styles from './style.scss';
import { HelpDetailBodyText, HelpDetailImage } from './view-sections';

const AddBlocks = () => {
return (
<View style={ styles.helpDetailContainer }>
<HelpDetailImage source={ require( './images/add-blocks.png' ) } />
<HelpDetailBodyText
text={ __(
'Add a new block at any time by tapping on the + icon in the toolbar on the bottom left. '
) }
/>
<HelpDetailBodyText
text={ __(
'Once you become familiar with the names of different blocks, you can add a block by typing a forward slash followed by the block name — for example, /image or /heading.'
) }
/>
</View>
);
};

export default AddBlocks;
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/**
* External dependencies
*/
import { View } from 'react-native';

/**
* WordPress dependencies
*/
import { __ } from '@wordpress/i18n';

/**
* Internal dependencies
*/
import styles from './style.scss';
import { HelpDetailBodyText, HelpDetailImage } from './view-sections';

const CustomizeBlocks = () => {
return (
<View style={ styles.helpDetailContainer }>
<HelpDetailImage
source={ require( './images/customize-blocks.png' ) }
/>
<HelpDetailBodyText
text={ __(
'Each block has its own settings. To find them, click on a block. Its settings will appear on the toolbar at the bottom of the screen.'
) }
/>
<HelpDetailBodyText
text={ __(
'Some blocks have additional settings. Tap the settings icon on the bottom right of the block to view more options.'
) }
/>
</View>
);
};

export default CustomizeBlocks;
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
/**
* External dependencies
*/
import { View, Text } from 'react-native';
import { useNavigation } from '@react-navigation/native';
import { View } from 'react-native';

/**
* WordPress dependencies
*/
import { BottomSheet } from '@wordpress/components';
import { useNavigation } from '@react-navigation/native';
import { __ } from '@wordpress/i18n';

/**
* Internal dependencies
*/
import styles from './style.scss';

const HelpDetailNavigationScreen = ( { name } ) => {
const HelpDetailNavigationScreen = ( { name, content } ) => {
const navigation = useNavigation();

const goBack = () => {
Expand All @@ -29,7 +29,7 @@ const HelpDetailNavigationScreen = ( { name } ) => {
leftButtonOnPress={ goBack }
/>
<View style={ styles.separator } />
<Text>Amanda todo</Text>
{ content }
</BottomSheet.NavigationScreen>
);
};
Expand Down
48 changes: 11 additions & 37 deletions packages/editor/src/components/editor-help/help-topic-row.native.js
Original file line number Diff line number Diff line change
@@ -1,58 +1,32 @@
/**
* External dependencies
*/
import { View, Text } from 'react-native';
import { useNavigation } from '@react-navigation/native';

/**
* WordPress dependencies
*/
import { useState } from '@wordpress/element';
import { BottomSheet, TextControl, Icon } from '@wordpress/components';
import { TextControl, Icon } from '@wordpress/components';
import { chevronRight } from '@wordpress/icons';

/**
* Internal dependencies
*/
import styles from './style.scss';

const HelpTopicRow = ( { label, icon } ) => {
const [ showSubSheet, setShowSubSheet ] = useState( false );
const navigation = useNavigation();

const openSubSheet = () => {
setShowSubSheet( true );
navigation.navigate( BottomSheet.SubSheet.screenName );
};

const goBack = () => {
navigation.goBack();
setShowSubSheet( false );
navigation.navigate( label );
};

return (
<BottomSheet.SubSheet
navigationButton={
<TextControl
separatorType="leftMargin"
customActionButton
leftAlign
onPress={ openSubSheet }
label={ label }
icon={ icon }
>
<Icon icon={ chevronRight } />
</TextControl>
}
showSheet={ showSubSheet }
<TextControl
separatorType="leftMargin"
customActionButton
leftAlign
onPress={ openSubSheet }
label={ label }
icon={ icon }
>
<BottomSheet.NavigationHeader
screen={ label }
leftButtonOnPress={ goBack }
/>
<View style={ styles.separator } />
<Text>Amanda Todo</Text>
</BottomSheet.SubSheet>
<Icon icon={ chevronRight } />
</TextControl>
);
};

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
51 changes: 36 additions & 15 deletions packages/editor/src/components/editor-help/index.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { View, Text } from 'react-native';
* WordPress dependencies
*/
import { BottomSheet, PanelBody } from '@wordpress/components';
import { useMemo } from '@wordpress/element';
import { __ } from '@wordpress/i18n';
import { usePreferredColorSchemeStyle } from '@wordpress/compose';
import {
Expand All @@ -22,14 +21,32 @@ import {
* Internal dependencies
*/
import styles from './style.scss';
import HelpTopicRow from './help-topic-row.native.js';
import HelpDetailNavigationScreen from './help-detail-navigation-screen';
import HelpTopicRow from './help-topic-row';
import IntroToBlocks from './intro-to-blocks';
import AddBlocks from './add-blocks';
import MoveBlocks from './move-blocks';
import RemoveBlocks from './remove-blocks';
import CustomizeBlocks from './customize-blocks';

const HELP_TOPICS = [
{ label: __( 'What is a block?' ), icon: helpFilled },
{ label: __( 'Add blocks' ), icon: plusCircleFilled },
{ label: __( 'Move blocks' ), icon: alignJustifyAlt },
{ label: __( 'Remove blocks' ), icon: trashFilled },
{ label: __( 'Customize blocks' ), icon: cogAlt },
{
label: __( 'What is a block?' ),
icon: helpFilled,
view: <IntroToBlocks />,
},
{
label: __( 'Add blocks' ),
icon: plusCircleFilled,
view: <AddBlocks />,
},
{ label: __( 'Move blocks' ), icon: alignJustifyAlt, view: <MoveBlocks /> },
{ label: __( 'Remove blocks' ), icon: trashFilled, view: <RemoveBlocks /> },
{
label: __( 'Customize blocks' ),
icon: cogAlt,
view: <CustomizeBlocks />,
},
];

function EditorHelpTopics( { isVisible, onClose } ) {
Expand All @@ -38,13 +55,13 @@ function EditorHelpTopics( { isVisible, onClose } ) {
styles.bottomSheetHeaderTitleDark
);

return useMemo( () => (
return (
<BottomSheet
isVisible={ isVisible }
onClose={ onClose }
contentStyle={ styles.contentContainer }
hideHeader
hasNavigation
contentStyle={ styles.contentContainer }
>
<BottomSheet.NavigationContainer animate main>
<BottomSheet.NavigationScreen name={ __( 'Topics' ) }>
Expand Down Expand Up @@ -74,14 +91,18 @@ function EditorHelpTopics( { isVisible, onClose } ) {
</PanelBody>
</BottomSheet.NavigationScreen>
{ /* Print out help detail screens */ }
<BottomSheet.NavigationScreen
name={ BottomSheet.SubSheet.screenName }
>
<BottomSheet.SubSheet.Slot />
</BottomSheet.NavigationScreen>
{ HELP_TOPICS.map( ( topic ) => {
return (
<HelpDetailNavigationScreen
key={ topic.label }
name={ topic.label }
content={ topic.view }
/>
);
} ) }
</BottomSheet.NavigationContainer>
</BottomSheet>
) );
);
}

export default EditorHelpTopics;
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
/**
* External dependencies
*/
import { View, Text } from 'react-native';

/**
* WordPress dependencies
*/
import { __ } from '@wordpress/i18n';

/**
* Internal dependencies
*/
import styles from './style.scss';
import {
HelpDetailBodyText,
HelpDetailSectionHeadingText,
HelpDetailImage,
} from './view-sections';

const IntroToBlocks = () => {
return (
<View style={ styles.helpDetailContainer }>
<HelpDetailImage
source={ require( './images/intro-blocks-1.png' ) }
/>
<Text style={ styles.helpDetailTitle }>
{ __( 'Welcome to the world of blocks' ) }
</Text>
<HelpDetailBodyText
text={ __(
'Blocks are pieces of content that you can insert, rearrange, and style without needing to know how to code. Blocks are an easy and modern way for you to create beautiful layouts.'
) }
/>
<HelpDetailSectionHeadingText text={ __( 'Rich text editing' ) } />
<HelpDetailBodyText
text={ __(
'Blocks allow you to focus on writing your content, knowing that all the formatting tools you need are there to help you get your message across.'
) }
/>
<HelpDetailImage
source={ require( './images/intro-blocks-2.png' ) }
/>
<HelpDetailSectionHeadingText text={ __( 'Embed media' ) } />
<HelpDetailBodyText
text={ __(
'Make your content stand out by adding images, gifs, videos, and embedded media to your pages.'
) }
/>
<HelpDetailImage
source={ require( './images/intro-blocks-3.png' ) }
/>
<HelpDetailSectionHeadingText text={ __( 'Build layouts' ) } />
<HelpDetailBodyText
text={ __(
'Arrange your content into columns, add Call to Action buttons, and overlay images with text.'
) }
/>
<HelpDetailImage
source={ require( './images/intro-blocks-4.png' ) }
/>
<HelpDetailBodyText
text={ __(
'Give it a try by adding a few blocks to your post or page!'
) }
/>
</View>
);
};

export default IntroToBlocks;
30 changes: 30 additions & 0 deletions packages/editor/src/components/editor-help/move-blocks.native.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/**
* External dependencies
*/
import { View } from 'react-native';

/**
* WordPress dependencies
*/
import { __ } from '@wordpress/i18n';

/**
* Internal dependencies
*/
import styles from './style.scss';
import { HelpDetailBodyText, HelpDetailImage } from './view-sections';

const MoveBlocks = () => {
return (
<View style={ styles.helpDetailContainer }>
<HelpDetailImage source={ require( './images/move-blocks.png' ) } />
<HelpDetailBodyText
text={ __(
'You can rearrange blocks by tapping a block and then tapping the up and down arrows that appear on the bottom left side of the block to move it above or below other blocks.'
) }
/>
</View>
);
};

export default MoveBlocks;
Loading