diff --git a/src/assets/hbd_icon.png b/src/assets/hbd_icon.png new file mode 100644 index 000000000..3c8700a2d Binary files /dev/null and b/src/assets/hbd_icon.png differ diff --git a/src/assets/hive_icon.png b/src/assets/hive_icon.png new file mode 100644 index 000000000..2a8a91037 Binary files /dev/null and b/src/assets/hive_icon.png differ diff --git a/src/components/atoms/assetIcon/container/assetIcon.tsx b/src/components/atoms/assetIcon/container/assetIcon.tsx index 8eefddc78..0aee8eff1 100644 --- a/src/components/atoms/assetIcon/container/assetIcon.tsx +++ b/src/components/atoms/assetIcon/container/assetIcon.tsx @@ -3,27 +3,50 @@ import { View, ViewStyle } from 'react-native'; import FastImage from 'react-native-fast-image'; import styles from '../styles/assetIcon.styles'; import HIVE_ENGINE_ICON from '../../../../assets/hive_engine.png'; +import HBD_ICON from '../../../../assets/hbd_icon.png'; +import HIVE_ICON from '../../../../assets/hive_icon.png'; +import ECENCY_ICON from '../../../../assets/ecency-logo.png'; import { ASSET_IDS } from '../../../../constants/defaultAssets'; interface AssetIconProps { - id:ASSET_IDS - iconUrl: string; + id:string; + iconUrl?: string; isEngine?: boolean; iconSize?: number; containerStyle?: ViewStyle; } -export const AssetIcon = ({ iconUrl, isEngine, containerStyle, iconSize }: AssetIconProps) => { +export const AssetIcon = ({id, iconUrl, isEngine, containerStyle, iconSize }: AssetIconProps) => { if (iconSize) { } const _logoStyle = iconSize - ? { ...styles.logo, width: iconSize, height: iconSize, borderRadius: iconSize / 2 } + ? { ...styles.logo, width: iconSize, height: iconSize} : styles.logo; + let _iconSource = iconUrl && {uri:iconUrl}; + if(!_iconSource){ + switch(id){ + case ASSET_IDS.HBD: + _iconSource = HBD_ICON; + break; + case ASSET_IDS.HIVE: + case ASSET_IDS.HP: + _iconSource = HIVE_ICON; + break; + case ASSET_IDS.ECENCY: + _iconSource = ECENCY_ICON; + break; + } + } + + if(!_iconSource){ + return null; + } + return ( - + {isEngine && ( diff --git a/src/components/atoms/assetIcon/styles/assetIcon.styles.ts b/src/components/atoms/assetIcon/styles/assetIcon.styles.ts index 7536a99b4..d4d6c17e3 100644 --- a/src/components/atoms/assetIcon/styles/assetIcon.styles.ts +++ b/src/components/atoms/assetIcon/styles/assetIcon.styles.ts @@ -18,6 +18,6 @@ export default EStyleSheet.create({ logo: { height: 30, width: 30, - borderRadius: 15, + } as ImageStyle, }) \ No newline at end of file diff --git a/src/screens/assetDetails/children/coinBasics.tsx b/src/screens/assetDetails/children/coinBasics.tsx index 3e5d23562..562d7ac14 100644 --- a/src/screens/assetDetails/children/coinBasics.tsx +++ b/src/screens/assetDetails/children/coinBasics.tsx @@ -6,6 +6,7 @@ import { DataPair } from '../../../redux/reducers/walletReducer'; import styles from './children.styles'; interface CoinBasicsProps { + assetId:string; valuePairs: DataPair[]; extraData: DataPair[]; coinSymbol: string; @@ -15,24 +16,27 @@ interface CoinBasicsProps { } export const CoinBasics = ({ + assetId, valuePairs, extraData, coinSymbol, percentChange, iconUrl, + isEngine, onInfoPress, }: CoinBasicsProps) => { const intl = useIntl(); const _renderCoinHeader = ( <> - {iconUrl && ( + - )} + {coinSymbol} diff --git a/src/screens/assetDetails/children/coinSummary.tsx b/src/screens/assetDetails/children/coinSummary.tsx index 4c23f173d..2ea7fd736 100644 --- a/src/screens/assetDetails/children/coinSummary.tsx +++ b/src/screens/assetDetails/children/coinSummary.tsx @@ -50,6 +50,7 @@ export const CoinSummary = ({ return ( - {iconUrl && ( - )} {symbol} {_name}