-
-
Notifications
You must be signed in to change notification settings - Fork 156
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix safe area stories cut off (#431)
* fix: Avoid cutting off content in `noSafeArea: false` story content Stories that use `noSafeArea: true` are unaffected. * chore: Prettier formatting in changed files * feat: Improve the preview scaling/translating behaviour In order to create more a more stable animation, one that isn't affected by safe areas popping in/out, a few refactorings were necessary: - Remove the use of `SafeAreaView` and instead manually manage the margin using the values from `useSafeAreaInsets` - Use a stable Y-translation for the scaled preview, to ensure it is at the same position regardless of safe area presence, or UI visibility Some additional improvements: - Center the scaled preview horizontally in the available space, instead of using a fixed pixel offset (TRANSLATE_X_OFFSET) - Reduce the number of views and animated views necessary to achieve the animation - Add a shadow to the scaled preview to indicate the device screen area in relation to the story content area - Measure the navigation bar height, instead of using a fixed value that is differently incorrect on each platform - Add comments to code where explaining something not obvious could help the next developer * fix: Dark mode on iOS causing a black preview background * commit: fix: Safe area not being accounted for in the addons panel This unifies the special behaviour regarding safe area insets in `StoryListView`. --------- Co-authored-by: Jonathan Jacobs <[email protected]> Co-authored-by: Daniel Williams <[email protected]>
- Loading branch information
1 parent
663fbef
commit b4ed276
Showing
5 changed files
with
241 additions
and
165 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.