Skip to content

Commit

Permalink
fix: QA issues
Browse files Browse the repository at this point in the history
  • Loading branch information
walmat committed Nov 8, 2023
1 parent 826b1bb commit 41610c3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
13 changes: 11 additions & 2 deletions src/components/PromoSheet.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import React, { useCallback, useEffect, useReducer } from 'react';
import { ImageSourcePropType, StatusBar, ImageBackground } from 'react-native';
import {
ImageSourcePropType,
Dimensions,
StatusBar,
ImageBackground,
} from 'react-native';
import LinearGradient from 'react-native-linear-gradient';
import MaskedView from '@react-native-masked-view/masked-view';
import { SheetActionButton, SheetHandle, SlackSheet } from '@/components/sheet';
Expand Down Expand Up @@ -99,10 +104,14 @@ export function PromoSheet({
const contentHeight =
deviceHeight - (!isSmallPhone ? sharedCoolModalTopOffset : 0);

const screenHeight = Dimensions.get('screen').height;
const windowHeight = Dimensions.get('window').height;
const navbarHeight = screenHeight - windowHeight;

return (
// @ts-ignore
<SlackSheet
additionalTopPadding={IS_ANDROID ? StatusBar.currentHeight : false}
additionalTopPadding={IS_ANDROID ? navbarHeight : false}
contentHeight={contentHeight}
height="100%"
hideHandle
Expand Down
10 changes: 8 additions & 2 deletions src/screens/ProfileSheet.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useRoute } from '@react-navigation/native';
import React, { createContext, useEffect, useMemo } from 'react';
import { StatusBar } from 'react-native';
import { Dimensions, Pressable, StatusBar } from 'react-native';
import RecyclerAssetList2 from '../components/asset-list/RecyclerAssetList2';
import ProfileSheetHeader from '../components/ens-profile/ProfileSheetHeader';
import Skeleton from '../components/skeleton/Skeleton';
Expand All @@ -27,6 +27,8 @@ import { addressHashedColorIndex } from '@/utils/profileUtils';
import { useFirstTransactionTimestamp } from '@/resources/transactions/firstTransactionTimestampQuery';
import { useENSAddress } from '@/resources/ens/ensAddressQuery';
import { usePersistentDominantColorFromImage } from '@/hooks/usePersistentDominantColorFromImage';
import { IS_ANDROID } from '@/env';
import { SheetHandleFixedToTop } from '@/components/sheet';

export const ProfileSheetConfigContext = createContext<{
enableZoomableImages: boolean;
Expand Down Expand Up @@ -125,11 +127,15 @@ export default function ProfileSheet() {
}

function AndroidWrapper({ children }: { children: React.ReactElement }) {
const screenHeight = Dimensions.get('screen').height;
const windowHeight = Dimensions.get('window').height;
const navbarHeight = screenHeight - windowHeight;

return android ? (
<Box
borderTopRadius={30}
style={{ overflow: 'hidden' }}
top={{ custom: StatusBar.currentHeight || 0 }}
top={{ custom: navbarHeight || 0 }}
>
{children}
</Box>
Expand Down

0 comments on commit 41610c3

Please sign in to comment.