Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
01400dd
Initial work on social links
lukewalczak Jun 2, 2020
25f4d71
Style social links and their infra
lukewalczak Jun 5, 2020
835f7f2
Merge branch 'master' into rnmobile/social_links
lukewalczak Jun 5, 2020
7f35aac
Merge branch 'master' into rnmobile/social_links
lukewalczak Jun 8, 2020
b40ad02
Correct action sheet labels and add header
lukewalczak Jun 8, 2020
dafa685
Merge branch 'rnmobile/correct-action-sheet-labels' into rnmobile/soc…
lukewalczak Jun 8, 2020
5deb622
Merge branch 'master' into rnmobile/social_links
lukewalczak Jun 8, 2020
9f1ad97
Merge branch 'master' into rnmobile/social_links
lukewalczak Jun 15, 2020
ae263c4
Main social icons refactor
lukewalczak Jun 15, 2020
216f3cc
Refactor animation in social links, blur post title when unselected
lukewalczak Jun 16, 2020
85eb3ae
Wrap Svg in forwardRef to pass the ref to func component
lukewalczak Jun 16, 2020
76cf8d6
Add placeholder for inactive unselected icons
lukewalczak Jun 18, 2020
a0edba7
Correct undo in social links
lukewalczak Jun 18, 2020
4eae11c
Create link settings component
lukewalczak Jun 19, 2020
015ab5a
Merge branch 'rnmobile/link-settings' into rnmobile/social_links
lukewalczak Jun 19, 2020
08aeedc
Use LinkSettings
lukewalczak Jun 19, 2020
631daee
Display social icon name on mobile platform
lukewalczak Jun 22, 2020
0217143
Use usePrevious hook
lukewalczak Jun 23, 2020
036c6c4
Add props description, refactor some props
lukewalczak Jun 23, 2020
f56525e
Merge branch 'rnmobile/link-settings' into rnmobile/social_links
lukewalczak Jun 24, 2020
342228f
Merge branch 'master' into rnmobile/social_links
lukewalczak Jun 24, 2020
90f6ec1
Merge branch 'master' into rnmobile/social_links
lukewalczak Jun 24, 2020
ff15202
Correct e2e test
lukewalczak Jun 24, 2020
c74f14c
Code clean up
lukewalczak Jun 25, 2020
40333ea
Code refactor
lukewalczak Jun 25, 2020
3921817
Revert block picker changes
lukewalczak Jun 25, 2020
2ae940b
Merge branch 'master' into rnmobile/social_links
lukewalczak Jun 30, 2020
15949b9
Merge branch 'master' into rnmobile/social_links
lukewalczak Jun 30, 2020
8f274a8
Add a11y to social links
lukewalczak Jun 30, 2020
030ce31
Use button size variable
lukewalczak Jun 30, 2020
c10c55a
Refactor social icons
lukewalczak Jul 3, 2020
7a9575d
Revert post title changes
lukewalczak Jul 3, 2020
9fbb610
Merge branch 'master' into rnmobile/social_links
lukewalczak Jul 3, 2020
c58e64e
Code refactor, add svg wrapper
lukewalczak Jul 6, 2020
c3fc255
Merge branch 'master' into rnmobile/social_links
lukewalczak Jul 7, 2020
509c5cb
Remove initialAttributes
lukewalczak Jul 7, 2020
763459e
Merge branch 'master' into rnmobile/social_links
lukewalczak Jul 7, 2020
7c21866
Add check for block name
lukewalczak Jul 8, 2020
643b9e5
Merge branch 'master' into rnmobile/social_links
lukewalczak Jul 9, 2020
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
Prev Previous commit
Next Next commit
Refactor social icons
  • Loading branch information
lukewalczak committed Jul 3, 2020
commit c10c55adaad6526b496d4cf26bc23b4bf1adb820
11 changes: 5 additions & 6 deletions packages/block-editor/src/components/block-list/index.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -332,27 +332,26 @@ export default compose( [
const selectedBlockClientId = getSelectedBlockClientId();

let blockClientIds = getBlockOrder( rootClientId );

// Display only block which fulfill the condition in passed `filterInnerBlocks` function
if ( filterInnerBlocks ) {
blockClientIds = filterInnerBlocks(
getBlockOrder( rootClientId )
);
blockClientIds = filterInnerBlocks( blockClientIds );
}

const isReadOnly = getSettings().readOnly;

const rootBlockId = getBlockHierarchyRootClientId(
selectedBlockClientId
);
const hasRootInnerBlocks = !! getBlockCount( rootBlockId );

const blockCount = getBlockCount( rootBlockId );
const hasRootInnerBlocks = !! blockCount;

const isFloatingToolbarVisible =
!! selectedBlockClientId && hasRootInnerBlocks;

return {
blockClientIds,
blockCount: getBlockCount( rootClientId ),
blockCount,
isBlockInsertionPointVisible: isBlockInsertionPointVisible(),
isReadOnly,
isRootList: rootClientId === undefined,
Expand Down
38 changes: 21 additions & 17 deletions packages/block-library/src/social-link/edit.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,21 @@ import styles from './editor.scss';
const ANIMATION_DELAY = 300;
const ANIMATION_DURATION = 400;

const linkSettingsOptions = {
url: {
label: __( 'URL' ),
placeholder: __( 'Add URL' ),
autoFocus: true,
},
linkLabel: {
label: __( 'Link label' ),
placeholder: __( 'None' ),
},
footer: {
label: __( 'Briefly describe the link to help screen reader user' ),
},
};

const SocialLinkEdit = ( {
attributes,
setAttributes,
Expand Down Expand Up @@ -83,21 +98,6 @@ const SocialLinkEdit = ( {
? activeIcon
: interpolationColors;

const options = {
url: {
label: __( 'URL' ),
placeholder: __( 'Add URL' ),
autoFocus: true,
},
linkLabel: {
label: __( 'Link label' ),
placeholder: __( 'None' ),
},
footer: {
label: __( 'Briefly describe the link to help screen reader user' ),
},
};

function animateColors() {
Animated.sequence( [
Animated.delay( ANIMATION_DELAY ),
Expand All @@ -113,6 +113,10 @@ const SocialLinkEdit = ( {
setIsLinkSheetVisible( false );
}

function onOpenSettingsSheet() {
setIsLinkSheetVisible( true );
}

function onEmptyURL() {
animatedValue.setValue( 0 );
setIsValue( false );
Expand Down Expand Up @@ -150,7 +154,7 @@ const SocialLinkEdit = ( {
socialLinkName
) }
icon={ link }
onClick={ () => setIsLinkSheetVisible( true ) }
onClick={ onOpenSettingsSheet }
isActive={ url }
/>
</ToolbarGroup>
Expand All @@ -162,7 +166,7 @@ const SocialLinkEdit = ( {
onEmptyURL={ onEmptyURL }
onClose={ onCloseSettingsSheet }
setAttributes={ setAttributes }
options={ options }
options={ linkSettingsOptions }
withBottomSheet={ true }
/>
<TouchableWithoutFeedback
Expand Down
4 changes: 3 additions & 1 deletion packages/block-library/src/social-links/edit.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ function SocialLinksEdit( {
);

function renderPlaceholder() {
return [ ...new Array( innerBlocks.length || 1 ) ].map( ( index ) => (
return [
...new Array( innerBlocks.length || 1 ),
].map( ( _, index ) => (
<View style={ placeholderStyle } key={ index } />
) );
}
Expand Down