Skip to content

Commit 7f14590

Browse files
Improve look of route change bar
1 parent 724d0cf commit 7f14590

File tree

2 files changed

+27
-8
lines changed

2 files changed

+27
-8
lines changed

packages/app/features/activity/utils/useActivityFeed.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ export function useActivityFeed({
3434
> {
3535
const supabase = useSupabase()
3636
const addressBook = useAddressBook()
37-
console.log(addressBook)
3837
const enabled = useMemo(() => addressBook.isError || addressBook.isSuccess, [addressBook])
3938
const queryKey = useMemo(
4039
() => ['activity_feed', { addressBook, supabase, pageSize }] as const,

packages/ui/src/components/PendingIndicatorBar.tsx

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { useEffect, useState } from 'react'
22
import { Stack } from 'tamagui'
3+
import { usePwa, useSafeAreaInsets } from '../utils'
34

45
const getTimeout = (progress: number): number => {
56
if (progress < 0.7) {
@@ -20,6 +21,8 @@ const LoadingBar = ({ visible }: { visible: boolean }) => {
2021

2122
const translate = 100 - progress * 100
2223

24+
const insets = useSafeAreaInsets()
25+
2326
useEffect(() => {
2427
if (render) {
2528
const timeoutId = setTimeout(() => {
@@ -65,7 +68,7 @@ const LoadingBar = ({ visible }: { visible: boolean }) => {
6568
}, [visible])
6669

6770
return (
68-
<Stack w="100%" h="$0.5" overflow="hidden" position="relative">
71+
<Stack w="100%" h={insets.bottom > 0 ? '$0.75' : '$0.5'} overflow="hidden" position="relative">
6972
<Stack
7073
position="absolute"
7174
top={0}
@@ -74,14 +77,31 @@ const LoadingBar = ({ visible }: { visible: boolean }) => {
7477
width="100%"
7578
bc="$primary"
7679
opacity={!render || (render && progress === 0) ? 0 : 1}
77-
style={{ transform: `translateX(-${translate}%)` }}
80+
animation="quick"
81+
transformStyle="preserve-3d"
82+
x={`-${translate}%`}
83+
animateOnly={['transform']}
7884
/>
7985
</Stack>
8086
)
8187
}
8288

83-
export const PendingIndicatorBar = ({ pending }: { pending: boolean }) => (
84-
<Stack position="absolute" left={0} top={0} w="100%" pointerEvents="none" zIndex={20}>
85-
<LoadingBar visible={pending} />
86-
</Stack>
87-
)
89+
export const PendingIndicatorBar = ({ pending }: { pending: boolean }) => {
90+
const isPwa = usePwa()
91+
92+
const placement = isPwa ? { bottom: 0 } : { top: 0 }
93+
94+
return (
95+
<Stack
96+
position="absolute"
97+
left={0}
98+
w="100%"
99+
pointerEvents="none"
100+
zIndex={20}
101+
{...placement}
102+
$platform-native={{ bottom: 0 }}
103+
>
104+
<LoadingBar visible={pending} />
105+
</Stack>
106+
)
107+
}

0 commit comments

Comments
 (0)