Skip to content

Commit

Permalink
Merge pull request #4753 from EdgeApp/paul/smalFixes2
Browse files Browse the repository at this point in the history
Paul/smal fixes2
  • Loading branch information
paullinator authored Jan 25, 2024
2 parents 80e1c69 + 44016ba commit 5fc041d
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2701,7 +2701,7 @@ exports[`TransactionDetailsScene should render with negative nativeAmount and fi
"includeFontPadding": false,
},
{
"color": "#888888",
"color": "#D9E3ED",
},
null,
]
Expand Down
8 changes: 3 additions & 5 deletions src/components/common/EdgeAnim.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react'
import { Platform, ViewProps } from 'react-native'
import { ViewProps } from 'react-native'
import Animated, {
AnimateProps,
ComplexAnimationBuilder,
Expand Down Expand Up @@ -47,8 +47,6 @@ interface Props extends AnimateProps<ViewProps> {
enter?: Anim
exit?: Anim

/** only animate on ios */
ios?: boolean
visible?: boolean
}

Expand Down Expand Up @@ -93,12 +91,12 @@ const getAnimBuilder = (anim?: Anim) => {
return builder
}

export const EdgeAnim = ({ children, disableType, enter, exit, ios = false, visible = true, ...rest }: Props): JSX.Element | null => {
export const EdgeAnim = ({ children, disableType, enter, exit, visible = true, ...rest }: Props): JSX.Element | null => {
if (!visible) return null
const entering = getAnimBuilder(enter)
const exiting = getAnimBuilder(exit)

if (disableType === 'anim' || (ios && Platform.OS !== 'ios')) {
if (disableType === 'anim') {
return <Animated.View {...rest}>{children}</Animated.View>
}

Expand Down
10 changes: 6 additions & 4 deletions src/components/scenes/GettingStartedScene.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { CreateAccountType, InitialRouteName } from 'edge-login-ui-rn'
import * as React from 'react'
import { useEffect } from 'react'
import { Image, Pressable, Text, View } from 'react-native'
import { Image, Platform, Pressable, Text, View } from 'react-native'
import { ScrollView, TouchableOpacity } from 'react-native-gesture-handler'
import Animated, {
Extrapolation,
Expand Down Expand Up @@ -171,6 +171,8 @@ export const GettingStartedScene = (props: Props) => {
}
}, [isLoggedIn, localUsers, navigation])

const disableType = Platform.OS === 'android' ? 'view' : undefined

return (
<SceneWrapper hasHeader={false}>
<SkipButton swipeOffset={swipeOffset}>
Expand Down Expand Up @@ -211,7 +213,7 @@ export const GettingStartedScene = (props: Props) => {
)
})}
</HeroContainer>
<EdgeAnim ios enter={{ type: 'fadeInDown', duration: ANIM_DURATION, distance: 20 }}>
<EdgeAnim disableType={disableType} enter={{ type: 'fadeInDown', duration: ANIM_DURATION, distance: 20 }}>
<Pagination>
{Array.from({ length: paginationCount + (isFinalSwipeEnabled ? 0 : 1) }).map((_, index) => (
<Pressable key={index} onPress={() => handlePressIndicator(index)}>
Expand All @@ -235,10 +237,10 @@ export const GettingStartedScene = (props: Props) => {
})}
</Sections>
<Space horizontal={2}>
<EdgeAnim ios enter={{ type: 'fadeInDown', duration: ANIM_DURATION, distance: 40 }}>
<EdgeAnim disableType={disableType} enter={{ type: 'fadeInDown', duration: ANIM_DURATION, distance: 40 }}>
<MainButton onPress={handlePressSignUp} label={lstrings.account_get_started} />
</EdgeAnim>
<EdgeAnim ios enter={{ type: 'fadeInDown', duration: ANIM_DURATION, distance: 60 }}>
<EdgeAnim disableType={disableType} enter={{ type: 'fadeInDown', duration: ANIM_DURATION, distance: 60 }}>
<MainButton type="escape" onPress={handlePressSignIn} label={lstrings.getting_started_button_sign_in} />
</EdgeAnim>
</Space>
Expand Down
2 changes: 1 addition & 1 deletion src/components/scenes/TransactionDetailsScene.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ const TransactionDetailsComponent = (props: Props) => {
{recipientsAddresses === '' ? null : (
<EdgeAnim enter={{ type: 'fadeInDown', distance: 60 }}>
<CardUi4>
<RowUi4 rightButtonType="copy" title={lstrings.transaction_details_recipient_addresses} body={recipientsAddresses} />
<RowUi4 maximumHeight="large" rightButtonType="copy" title={lstrings.transaction_details_recipient_addresses} body={recipientsAddresses} />
</CardUi4>
</EdgeAnim>
)}
Expand Down
6 changes: 4 additions & 2 deletions src/components/scenes/TransactionListScene.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,11 @@ function TransactionListComponent(props: Props) {
onSearchingChange={setIsSearching}
onSearchTextChange={setSearchText}
/>
{assetStatuses.length > 0
{assetStatuses.length > 0 && !isSearching
? assetStatuses.map(assetStatus => (
<AssetStatusCard assetStatus={assetStatus} key={`${String(assetStatus.localeStatusTitle)}-${String(assetStatus.localeStatusBody)}`} />
<EdgeAnim enter={{ type: 'fadeInDown', distance: 10 }} key={`${String(assetStatus.localeStatusTitle)}-${String(assetStatus.localeStatusBody)}`}>
<AssetStatusCard assetStatus={assetStatus} key={`${String(assetStatus.localeStatusTitle)}-${String(assetStatus.localeStatusBody)}`} />
</EdgeAnim>
))
: null}
</>
Expand Down
6 changes: 3 additions & 3 deletions src/components/ui4/AssetChangeTextUi4.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ const getPercentDeltaString = (assetToFiatRate: string, assetToYestFiatRate: str
const yesterdayDelta = sub(assetToFiatRate, yesterdayExchangeRate)

// Avoid divide by zero if there's no exchange rate from yesterday
const yesterdayDeltaPct = zeroString(yesterdayExchangeRate) ? '0' : abs(div(yesterdayDelta, yesterdayExchangeRate, DECIMAL_PRECISION))
const yesterdayDeltaPct = zeroString(yesterdayExchangeRate) ? '0' : div(yesterdayDelta, yesterdayExchangeRate, DECIMAL_PRECISION)

let percentString
// Prepend a < sign if a nonzero delta rounds to zero
if (!zeroString(yesterdayDeltaPct) && lt(yesterdayDeltaPct, '0.001')) {
if (!zeroString(yesterdayDeltaPct) && lt(abs(yesterdayDeltaPct), '0.001')) {
percentString = `<${toPercentString(0.0001, { maxPrecision: 2, intlOpts: { noGrouping: true } })}`
} else {
percentString = toPercentString(yesterdayDeltaPct, { maxPrecision: 2, intlOpts: { noGrouping: true } })
Expand All @@ -61,7 +61,7 @@ const getPercentDeltaString = (assetToFiatRate: string, assetToYestFiatRate: str
if (gt(yesterdayDeltaPct, '0')) {
return { percentString: `+${percentString}`, deltaColorStyle: theme.positiveText }
} else if (lt(yesterdayDeltaPct, '0')) {
return { percentString: `-${percentString}`, deltaColorStyle: theme.negativeText }
return { percentString: `${percentString}`, deltaColorStyle: theme.negativeText }
} else {
return { percentString, deltaColorStyle: theme.negativeText }
}
Expand Down
2 changes: 1 addition & 1 deletion src/theme/variables/edgeDark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ export const edgeDark: Theme = {
secondaryText: palette.skyBlue,
warningText: palette.accentOrange,
positiveText: palette.accentGreen,
negativeText: palette.gray,
negativeText: palette.lightGray,
dangerText: palette.accentRed,
textLink: palette.edgeMint,
deactivatedText: palette.gray,
Expand Down

0 comments on commit 5fc041d

Please sign in to comment.