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-307] Add useScreenEndMargin hook #5808

Merged
merged 18 commits into from
Jun 6, 2024

Conversation

dmnplb
Copy link
Contributor

@dmnplb dmnplb commented May 31, 2024

Short description

This PR adds the new useScreenEndMargin, a specific hook to use when you have to develop a new screen and you want to get a safe numeric value to set as paddingBottom for the ScrollView. This hook automatically takes into account each device configuration (devices with safe area boundaries and devices without)

This should also help to prevent the inclusion of SafeAreaView (or similar) which results in a white block at the corresponding bottom safe area (see image below):

Note

To learn more about the technical details, take a look at the hook file and its comments

Important

If you already use FooterActions or IOScrollView you don't need this hook because the end margin is already taken into account

List of changes proposed in this pull request

  • Add useScreenEndMargin hook
  • Refactor and remove useless useMemo in IOScrollView and FooterActions
  • Add relative example screen in the DS (Screen End Margin)

How to test

  • Launch the app in the local environment
  • Go to the Design SystemScreen End Margin (under Debug)

@dmnplb dmnplb added the Design System New visual language and reduction of previous UI clutter label May 31, 2024
@dmnplb dmnplb requested a review from a team as a code owner May 31, 2024 12:23
@pagopa-github-bot pagopa-github-bot changed the title [IOAPPX-307] Add useScreenEndMargin hook chore(Cross): [IOAPPX-307] Add useScreenEndMargin hook May 31, 2024
@pagopa-github-bot
Copy link
Collaborator

pagopa-github-bot commented May 31, 2024

Affected stories

  • ⚙️ IOAPPX-307: Aggiunta di un hook per ottenere il margine inferiore di una schermata
    subtask of

Generated by 🚫 dangerJS against d9e3f56

Copy link

codecov bot commented May 31, 2024

Codecov Report

Attention: Patch coverage is 42.10526% with 44 lines in your changes missing coverage. Please review.

Project coverage is 50.04%. Comparing base (4f204b4) to head (d9e3f56).
Report is 138 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5808      +/-   ##
==========================================
+ Coverage   48.42%   50.04%   +1.61%     
==========================================
  Files        1488     1646     +158     
  Lines       31617    32611     +994     
  Branches     7669     7925     +256     
==========================================
+ Hits        15311    16320    +1009     
+ Misses      16238    16233       -5     
+ Partials       68       58      -10     
Files Coverage Δ
ts/features/design-system/navigation/navigator.tsx 18.75% <ø> (-4.11%) ⬇️
ts/features/design-system/navigation/routes.ts 100.00% <ø> (ø)
...tures/zendesk/screens/ZendeskSupportHelpCenter.tsx 74.28% <100.00%> (+1.97%) ⬆️
...es/design-system/components/DesignSystemScreen.tsx 11.11% <0.00%> (ø)
ts/hooks/useScreenEndMargin.tsx 83.33% <83.33%> (ø)
.../features/design-system/core/DSScreenEndMargin.tsx 25.00% <25.00%> (ø)
ts/features/design-system/DesignSystem.tsx 29.62% <16.66%> (-5.16%) ⬇️
ts/components/ui/IOScrollView.tsx 63.23% <52.63%> (ø)
ts/components/ui/FooterActions.tsx 13.33% <7.69%> (ø)

... and 634 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a7fb875...d9e3f56. Read the comment docs.

dmnplb added a commit to pagopa/io-app-design-system that referenced this pull request Jun 4, 2024
## Short description
This PR removes the `VDivider` and `EndOfPage` components. The former
because it wasn't used. The latter because it's replaced by the
`useScreenEndMargin` hook or space already managed by `FooterActions` or
`IOScrollView`.

## List of changes proposed in this pull request
- Remove mentioned components
- Update example app and Storybook docs accordingly

## Related PRs
Here are the PRs for the components listed above:
- pagopa/io-app#5808
- pagopa/io-app#5787
- pagopa/io-app#5704
ts/hooks/useScreenEndMargin.tsx Outdated Show resolved Hide resolved
ts/hooks/useScreenEndMargin.tsx Outdated Show resolved Hide resolved
ts/hooks/useScreenEndMargin.tsx Outdated Show resolved Hide resolved
ts/hooks/useScreenEndMargin.tsx Outdated Show resolved Hide resolved
Copy link
Contributor

@Vangaorth Vangaorth left a comment

Choose a reason for hiding this comment

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

LGTM

@dmnplb dmnplb merged commit af7b8a6 into master Jun 6, 2024
13 checks passed
@dmnplb dmnplb deleted the IOAPPX-307-add-use-screen-end-margin-hook branch June 6, 2024 15:02
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants