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

chore(Cross): [IOAPPX-356] Add divider to first level sections when the user scrolls + Add useHeaderFirstLevel hook #6054

Merged
merged 40 commits into from
Dec 12, 2024

Conversation

dmnplb
Copy link
Contributor

@dmnplb dmnplb commented Jul 26, 2024

Note

This change applies only to the Wallet, Services and Payments sections.

Short description

This PR adds the new divider transition to first level sections when the user scrolls. To get this behaviour, we need to define HeaderFirstLevelProps directly in the main screen through useLayoutEffect where the main ScrollView or FlatList is placed.

To avoid code duplication, there's a new useHeaderFirstLevelActionPropHelp's hook that returns a FAQ configuration object based on the provided route.

List of changes proposed in this pull request

  • Add the new divider transition to the HeaderFirstLevel using the useScrollViewOffset hook from reanimated
  • Add the new optional endBlock prop to HeaderFirstLevel to render custom block (see the Services screen for a demonstration Update: removed from the PR
  • Break down the overall (chaotic) logic contained in the HeaderFirstLevelHandler into relative first level sections
  • Remove HeaderFirstLevelHandler completely
  • Add the new hooks related to the HeaderFirstLevel:
    • useHeaderFirstLevelActionPropHelp to get the props related to the Help section
    • useHeaderFirstLevelActionPropSettings to get the props related to the Settings section
    • useHeaderFirstLevel to set the HeaderFirstLevel by using useLayoutEffect with react-navigation
  • Update HeaderFirstLevel by making two actions mandatory and thirdAction optional
  • For testing purposes, update HeaderFirstLevel with the latest changes from io-app-design-system

Preview

Important

The divider is set with hairlineWidth, so it's very thin. If you want to see the change, download the following videos and play them at full resolution

Wallet Services Payments
wallet-divider-new.mp4
services-divider.mp4
payment-divider.mp4

How to test

Go to the above sections and check that everything is correct. Also check the relative flow of the Assistance in each first level section.

@dmnplb dmnplb added the Design System New visual language and reduction of previous UI clutter label Jul 26, 2024
@dmnplb dmnplb requested a review from a team as a code owner July 26, 2024 15:54
@pagopa-github-bot pagopa-github-bot changed the title [IOAPPX-356] Add divider to first level sections when the user scrolls chore(Cross): [IOAPPX-356] Add divider to first level sections when the user scrolls Jul 26, 2024
@pagopa-github-bot
Copy link
Collaborator

pagopa-github-bot commented Jul 26, 2024

Affected stories

  • ⚙️ IOAPPX-356: [io-app] Aggiunta del divisore quando l'utente scorre nelle sezioni di primo livello
    subtask of

Generated by 🚫 dangerJS against 33db7fc

Copy link
Contributor

@mastro993 mastro993 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, everything looks as expected

@dmnplb dmnplb requested a review from CrisTofani December 12, 2024 13:38
@dmnplb dmnplb merged commit 77dfc48 into master Dec 12, 2024
12 checks passed
@dmnplb dmnplb deleted the IOAPPX-356-add-divider-header-first-level branch December 12, 2024 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Cross Design System New visual language and reduction of previous UI clutter 💅 Visual tweaks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants