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

Refactor BlockMover to use React hooks #24774

Merged
merged 1 commit into from
Aug 28, 2020

Conversation

alexandec
Copy link
Contributor

Description

Related to #22890.

Refactor BlockMover to use React hooks.

How has this been tested?

  1. Edit page or post
  2. Add multiple blocks
  3. Move blocks up and down

Types of changes

Refactor component to use React hooks.

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.
  • I've updated all React Native files affected by any refactorings/renamings in this PR.

@talldan talldan added First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository [Type] Code Quality Issues or PRs that relate to code quality labels Aug 28, 2020
@talldan
Copy link
Contributor

talldan commented Aug 28, 2020

Thanks @alexandec for the contribution, and congrats on your first merged PR!

I gave it a test and everything seems to be working well. I note that the withSelect HOC could be switched over to the useSelect hook as well, but happy that this seems like a good first step to improving this component.

@talldan talldan merged commit 535c9ea into WordPress:master Aug 28, 2020
@github-actions github-actions bot added this to the Gutenberg 8.9 milestone Aug 28, 2020
noisysocks added a commit that referenced this pull request Oct 29, 2020
* Refactor BlockMover to use React hooks (#24774)

* Add drag handle to block toolbar (#24852)

* Add drag handle to block mover component

* Switch draggable chip to reflect toolbar layout

* Use drag cursor

* Hide drag handle on mobile or in top toolbar mode

* Adjust handle and structure.

* Size the switcher.

* Adjust mover.

* Update icon for handle.

* Update movers buttons.

* Fix groups.

* Focus for switcher.

* Handle focus.

* Fix top toolbar.

* Popover fix.

* Fix spacing issue.

* Harmonize spacing.

* Try small independen transition for up / down.

* Reduce motion.

* use dragHandle icon in draggable chip

* Make draggable chip use same icon as toolbar

* Revert "Make draggable chip use same icon as toolbar"

This reverts commit d031006.

* Revert offset change and ensure cursor does not overlap chip block info

* Update snapshots to reflect chevron icon change

Co-authored-by: jasmussen <[email protected]>
Co-authored-by: Matías Ventura <[email protected]>

* Fix issue with single block. (#25107)

* Remove animation from mover buttons. (#25728)

The animation was intended to better convey direction, and were added as an experiment. It doesn't seem successful, so let's remove it again.

* add label in drag and drop button (#25606)

* Change toolbar drag remove labels (#25614)

* Refactor toolabar drag+remove labels

* fix tests

* fixes #24845 (#24847)

* Fix: Post schedule label showing wrong time if site and user timezones did not match (#26212)

* URLInput: Use debounce() instead of throttle() (#26529)

Wait until the user finishes typing before sending an AJAX request. This
ensures that there isn't an AJAX request sent every 200 ms while the
user is typing.

* Update browserlist dependency (#24756)

* Fix composer test failures due to invalid lock (#26472)

* Update package-lock.json

* Set dev environment to use WordPress 5.5

Co-authored-by: Chris Alexander <[email protected]>
Co-authored-by: Daniel Richards <[email protected]>
Co-authored-by: jasmussen <[email protected]>
Co-authored-by: Matías Ventura <[email protected]>
Co-authored-by: Joen A <[email protected]>
Co-authored-by: Nik Tsekouras <[email protected]>
Co-authored-by: Ari Stathopoulos <[email protected]>
Co-authored-by: Jorge Costa <[email protected]>
Co-authored-by: Riad Benguella <[email protected]>
Co-authored-by: Marcus Kazmierczak <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository [Type] Code Quality Issues or PRs that relate to code quality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants