11import { abs , sub } from 'biggystring'
22import { EdgeCurrencyWallet , EdgeTransaction , EdgeTxSwap } from 'edge-core-js'
33import * as React from 'react'
4- import { Linking , Platform , View } from 'react-native'
4+ import { Linking , Platform } from 'react-native'
55import Mailer from 'react-native-mail'
66import SafariView from 'react-native-safari-view'
77import { sprintf } from 'sprintf-js'
@@ -21,7 +21,6 @@ import { convertNativeToDisplay, unixToLocaleDateTime } from '../../util/utils'
2121import { RawTextModal } from '../modals/RawTextModal'
2222import { EdgeRow } from '../rows/EdgeRow'
2323import { Airship , showError } from '../services/AirshipInstance'
24- import { cacheStyles , Theme , useTheme } from '../services/ThemeContext'
2524import { EdgeText } from '../themed/EdgeText'
2625import { EdgeCard } from './EdgeCard'
2726
@@ -35,8 +34,6 @@ const TXID_PLACEHOLDER = '{{TXID}}'
3534
3635export function SwapDetailsCard ( props : Props ) {
3736 const { swapData, transaction, wallet } = props
38- const theme = useTheme ( )
39- const styles = getStyles ( theme )
4037
4138 const { memos = [ ] , spendTargets = [ ] , tokenId } = transaction
4239 const { currencyInfo } = wallet
@@ -159,12 +156,6 @@ export function SwapDetailsCard(props: Props) {
159156 getExchangeDenom ( destinationWallet . currencyConfig , null ) . name
160157 } )`
161158
162- const symbolString =
163- currencyInfo . currencyCode === transaction . currencyCode &&
164- walletDefaultDenom . symbol != null
165- ? walletDefaultDenom . symbol
166- : transaction . currencyCode
167-
168159 const createExchangeDataString = ( newline : string = '\n' ) => {
169160 const uniqueIdentifier = memos
170161 . map (
@@ -216,23 +207,16 @@ export function SwapDetailsCard(props: Props) {
216207 title = { lstrings . transaction_details_exchange_details }
217208 onPress = { handleExchangeDetails }
218209 >
219- < View style = { styles . tileColumn } >
220- < EdgeText >
221- { lstrings . title_exchange + ' ' + sourceAmount + ' ' + symbolString }
222- </ EdgeText >
223- < EdgeText >
224- { lstrings . string_to_capitalize +
225- ' ' +
226- destinationAmount +
227- ' ' +
228- destinationAssetName }
229- </ EdgeText >
230- < EdgeText >
231- { swapData . isEstimate
232- ? lstrings . estimated_quote
233- : lstrings . fixed_quote }
234- </ EdgeText >
235- </ View >
210+ < EdgeText >
211+ { `${ sourceAmount } ${ sourceAssetName } ` +
212+ ' → ' +
213+ `${ destinationAmount } ${ destinationAssetName } ` }
214+ </ EdgeText >
215+ < EdgeText >
216+ { swapData . isEstimate
217+ ? lstrings . estimated_quote
218+ : lstrings . fixed_quote }
219+ </ EdgeText >
236220 </ EdgeRow >
237221 { orderUri == null ? null : (
238222 < EdgeRow
@@ -253,10 +237,3 @@ export function SwapDetailsCard(props: Props) {
253237 </ EdgeCard >
254238 )
255239}
256-
257- const getStyles = cacheStyles ( ( theme : Theme ) => ( {
258- tileColumn : {
259- flexDirection : 'column' ,
260- justifyContent : 'center'
261- }
262- } ) )
0 commit comments