Skip to content

Commit

Permalink
chore(demo): improve loading views (#1107)
Browse files Browse the repository at this point in the history
Resolving several visual quirks with Hyperview demo:
- Updated demo loading screen background to white
- Removed title from loading screens
- Setting a top padding to reduce screen jumping down after render

| Before | After |
| -- | -- |
|
![before-navigate](https://github.com/user-attachments/assets/3837feb4-86d5-4012-bc09-d0a0c1ffb6fc)
|
![after-navigate](https://github.com/user-attachments/assets/eb4b2d40-52a8-4c3a-8e9c-55054bab600d)
|
|
![before-new](https://github.com/user-attachments/assets/e808ecbb-705b-4f25-8f08-75427cdb9a2d)
|
![after-new](https://github.com/user-attachments/assets/26ef4b46-0491-433b-a981-1832b8b72f40)
|





[Asana](https://app.asana.com/0/1204008699308084/1209519280674251)
  • Loading branch information
hgray-instawork authored Mar 4, 2025
1 parent 90f727c commit 8b37429
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion demo/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
SafeAreaInsetsContext,
SafeAreaProvider,
} from 'react-native-safe-area-context';
import { Platform, View } from 'react-native';
import Behaviors from './src/Behaviors';
import { BottomTabBar } from './src/Core';
import { BottomTabBarContextProvider } from './src/Contexts';
Expand All @@ -14,7 +15,6 @@ import Hyperview from 'hyperview';
import LoadingScreen from './src/loading-screen';
import { NavigationContainer } from '@react-navigation/native';
import React from 'react';
import { View } from 'react-native';

// this value needs to match the path prefix where the app is hosted
// our demo app is hosted under instawork.github.io/hyperview
Expand Down Expand Up @@ -49,6 +49,7 @@ export default () => (
paddingBottom: insets?.bottom,
paddingLeft: insets?.left,
paddingRight: insets?.right,
paddingTop: insets?.top,
}}
>
<NavigationContainer linking={linking}>
Expand Down
1 change: 1 addition & 0 deletions demo/backend/_includes/templates/loading-screen.xml.njk
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
{% include 'templates/styles.xml.njk' %}
</styles>
<body style="body" safe-area="true">
{% set hv_title = "" %}
{% include 'templates/header.xml.njk' %}
<view style="loading">
<text style="loading-text">Loading…</text>
Expand Down
1 change: 1 addition & 0 deletions demo/backend/_includes/templates/styles.xml.njk
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
paddingBottom="16"
paddingLeft="24"
paddingRight="24"
height="48"
/>
<style
id="header-btn"
Expand Down
1 change: 1 addition & 0 deletions demo/src/loading-screen/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const LoadingScreen = (props: Props) => {
<View
style={{
alignItems: 'center',
backgroundColor: 'white',
flex: 1,
gap: 10,
justifyContent: 'center',
Expand Down

0 comments on commit 8b37429

Please sign in to comment.