Skip to content

Commit

Permalink
fix dialog height
Browse files Browse the repository at this point in the history
  • Loading branch information
rahulnr7 committed Sep 27, 2024
1 parent cf6c8fd commit 9668782
Showing 1 changed file with 2 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,7 @@ import {useDappConnector} from '@yoroi/dapp-connector'
import {useTheme} from '@yoroi/theme'
import {Image} from 'expo-image'
import * as React from 'react'
import {
Alert,
Linking,
StyleSheet,
Text,
TouchableOpacity,
TouchableWithoutFeedback,
useWindowDimensions,
View,
} from 'react-native'
import {Alert, Linking, StyleSheet, Text, TouchableOpacity, TouchableWithoutFeedback, View} from 'react-native'
import {useSafeAreaInsets} from 'react-native-safe-area-context'
import uuid from 'uuid'

Expand Down Expand Up @@ -46,13 +37,7 @@ export const DAppListItem = ({dApp, connected, onPress}: Props) => {
const {manager} = useDappConnector()
const {track} = useMetrics()

const HEIGHT_SCREEN = useWindowDimensions().height

// For devices like iPhone SE wuth logical pixel height < 700, we need a bottom sheet with more height
const heightDialogByHeightScreen =
HEIGHT_SCREEN < 700
? (HEIGHT_SCREEN * (dApp.isSingleAddress ? 70 : 50)) / 100
: (HEIGHT_SCREEN * (dApp.isSingleAddress ? 50 : 40)) / 100
const heightDialogByHeightScreen = dApp.isSingleAddress ? 460 : 340

const heightDialogByInit = INIT_DIALOG_DAPP_ACTIONS_HEIGHT + insets.bottom
const dialogHeight = heightDialogByInit < heightDialogByHeightScreen ? heightDialogByHeightScreen : heightDialogByInit
Expand Down

0 comments on commit 9668782

Please sign in to comment.