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

[IOAPPX-365] Add enableDiscreteTransition to HeaderSecondLevel to allow transition even if triggerOffset is not set #323

Merged
merged 3 commits into from
Aug 27, 2024

Conversation

dmnplb
Copy link
Collaborator

@dmnplb dmnplb commented Aug 5, 2024

Short description

This PR adds the new enableDiscreteTransition option to HeaderSecondLevel to allow an animated transition when triggerOffset is not set, or in some specific cases where there is a custom background and the default transition looks bad. The new transition differs from the previous one in that it's always triggered when the user scrolls down, even by one pixel. In the default transition you need to set a custom height along with a proper snapToOffsets array.

List of changes proposed in this pull request

  • Add the new enableDiscreteTransition boolean prop along with the animatedRef mandatory prop
  • Add two new screens to the example app for demo purposes

Preview

Default Discrete
default-transition.mp4
discrete-transition.mp4

Related PR

How to test

  1. Launch the example app
  2. Go to the Header Second Level (discrete transition, …) screens

@dmnplb dmnplb added the enhancement New feature or request label Aug 5, 2024
@dmnplb dmnplb requested review from a team as code owners August 5, 2024 15:27
@dmnplb dmnplb merged commit 82f79fb into main Aug 27, 2024
6 checks passed
@dmnplb dmnplb deleted the IOAPPX-365-add-discrete-transition-header-second-level branch August 27, 2024 09:13
dmnplb added a commit to pagopa/io-app that referenced this pull request Sep 11, 2024
… to the `useHeaderSecondLevel` hook (#6170)

## Short description
This PR adds support for `enableDiscreteTransition` to the
`useHeaderSecondLevel` hook. If you want to learn more about this prop,
please refer to the following PR:
* pagopa/io-app-design-system#323

## List of changes proposed in this pull request
- Add support for the new `enableDiscreteTransition` prop
- Refactor the code to improve readability
- Remove `canGoBack` declarations when they are set to true (it is
already `true` by default)

## How to test
Run all the tests provided by default

---------

Co-authored-by: Federico Mastrini <federicomastrini93@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants