Skip to content

Commit

Permalink
feat: update author profile icon and fix loading alignment (#848)
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasguillot authored Aug 27, 2021
1 parent 7ab2854 commit 040b145
Show file tree
Hide file tree
Showing 5 changed files with 120 additions and 49 deletions.
141 changes: 102 additions & 39 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"@wordpress/hooks": "^2.6.0",
"@wordpress/html-entities": "^2.5.0",
"@wordpress/i18n": "^3.7.0",
"@wordpress/icons": "^4.0.1",
"@wordpress/icons": "^4.1.0",
"@wordpress/keycodes": "^2.9.0",
"@wordpress/plugins": "^2.12.0",
"lodash": "^4.17.20",
Expand Down
12 changes: 5 additions & 7 deletions src/blocks/author-profile/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {
} from '@wordpress/components';
import { useEffect, useState } from '@wordpress/element';
import { decodeEntities } from '@wordpress/html-entities';
import { Icon, edit, people, pullLeft, pullRight } from '@wordpress/icons';
import { Icon, edit, postAuthor, pullLeft, pullRight } from '@wordpress/icons';
import { __, sprintf } from '@wordpress/i18n';
import { addQueryArgs } from '@wordpress/url';

Expand Down Expand Up @@ -340,7 +340,7 @@ export default ( { attributes, setAttributes } ) => {
) }
{ ! author && (
<Placeholder
icon={ <Icon icon={ people } /> }
icon={ <Icon icon={ postAuthor } /> }
label={ __( 'Author Profile', 'newspack-blocks' ) }
>
{ error && (
Expand All @@ -349,12 +349,10 @@ export default ( { attributes, setAttributes } ) => {
</Notice>
) }
{ isLoading && (
<>
<p style={ { margin: 0 } }>
{ __( 'Fetching author info...', 'newspack-blocks' ) }
</p>
<div className="is-loading">
{ __( 'Fetching author info...', 'newspack-blocks' ) }
<Spinner />
</>
</div>
) }
{ ! isLoading && (
<AutocompleteWithSuggestions
Expand Down
10 changes: 10 additions & 0 deletions src/blocks/author-profile/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@
width: 100%;
}

.is-loading {
align-items: center;
display: flex;

.components-spinner {
margin-right: 0;
margin-top: 0;
}
}

a.no-op {
pointer-events: none;
}
Expand Down
4 changes: 2 additions & 2 deletions src/blocks/author-profile/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* WordPress dependencies
*/
import { __, _x } from '@wordpress/i18n';
import { Icon, people } from '@wordpress/icons';
import { Icon, postAuthor } from '@wordpress/icons';

/**
* Internal dependencies
Expand All @@ -25,7 +25,7 @@ export const title = __( 'Author Profile', 'newspack-blocks' );
export const settings = {
title,
icon: {
src: <Icon icon={ people } />,
src: <Icon icon={ postAuthor } />,
foreground: '#36f',
},
keywords: [ __( 'author', 'newspack-blocks' ), __( 'profile', 'newspack-blocks' ) ],
Expand Down

0 comments on commit 040b145

Please sign in to comment.