From 391c859dddcb837b6417a2f021edfc820e633519 Mon Sep 17 00:00:00 2001
From: Lu <66273292+thisdotLolu@users.noreply.github.com>
Date: Wed, 21 Feb 2024 07:11:29 +0100
Subject: [PATCH 1/2] feat:coin logos on send
---
shim.js | 26 +++++++++++++++++++
.../ConvertOrCrossChainSendForm.js | 13 ++++++----
2 files changed, 34 insertions(+), 5 deletions(-)
create mode 100644 shim.js
diff --git a/shim.js b/shim.js
new file mode 100644
index 00000000..812d6b45
--- /dev/null
+++ b/shim.js
@@ -0,0 +1,26 @@
+if (typeof __dirname === 'undefined') global.__dirname = '/'
+if (typeof __filename === 'undefined') global.__filename = ''
+if (typeof process === 'undefined') {
+ global.process = require('process')
+} else {
+ const bProcess = require('process')
+ for (var p in bProcess) {
+ if (!(p in process)) {
+ process[p] = bProcess[p]
+ }
+ }
+}
+
+process.browser = false
+if (typeof Buffer === 'undefined') global.Buffer = require('buffer').Buffer
+
+// global.location = global.location || { port: 80 }
+const isDev = typeof __DEV__ === 'boolean' && __DEV__
+process.env['NODE_ENV'] = isDev ? 'development' : 'production'
+if (typeof localStorage !== 'undefined') {
+ localStorage.debug = isDev ? '*' : ''
+}
+
+// If using the crypto shim, uncomment the following line to ensure
+// crypto is loaded first, so it can populate global.crypto
+// require('crypto')
diff --git a/src/components/SendModal/ConvertOrCrossChainSend/ConvertOrCrossChainSendForm/ConvertOrCrossChainSendForm.js b/src/components/SendModal/ConvertOrCrossChainSend/ConvertOrCrossChainSendForm/ConvertOrCrossChainSendForm.js
index 61ded570..de77a8df 100644
--- a/src/components/SendModal/ConvertOrCrossChainSend/ConvertOrCrossChainSendForm/ConvertOrCrossChainSendForm.js
+++ b/src/components/SendModal/ConvertOrCrossChainSend/ConvertOrCrossChainSendForm/ConvertOrCrossChainSendForm.js
@@ -1039,11 +1039,14 @@ const ConvertOrCrossChainSendForm = ({ setLoading, setModalHeight, updateSendFor
{item.right}
)}
left={props => {
- const Logo = getCoinLogo(
- item.logoid,
- item.logoproto,
- 'dark',
- );
+ let id;
+ if (item.title.includes('.')) {
+ const logoId = item?.title?.split('.');
+ id = logoId[0];
+ } else {
+ id = item.logoid;
+ }
+ const Logo = getCoinLogo(id, item.logoproto, 'dark');
return (
From 05bb7fcc1f3a8d3eaf41658092ec31eda21e8478 Mon Sep 17 00:00:00 2001
From: Lu <66273292+thisdotLolu@users.noreply.github.com>
Date: Wed, 21 Feb 2024 07:12:30 +0100
Subject: [PATCH 2/2] feat:remove shim
---
shim.js | 26 --------------------------
1 file changed, 26 deletions(-)
delete mode 100644 shim.js
diff --git a/shim.js b/shim.js
deleted file mode 100644
index 812d6b45..00000000
--- a/shim.js
+++ /dev/null
@@ -1,26 +0,0 @@
-if (typeof __dirname === 'undefined') global.__dirname = '/'
-if (typeof __filename === 'undefined') global.__filename = ''
-if (typeof process === 'undefined') {
- global.process = require('process')
-} else {
- const bProcess = require('process')
- for (var p in bProcess) {
- if (!(p in process)) {
- process[p] = bProcess[p]
- }
- }
-}
-
-process.browser = false
-if (typeof Buffer === 'undefined') global.Buffer = require('buffer').Buffer
-
-// global.location = global.location || { port: 80 }
-const isDev = typeof __DEV__ === 'boolean' && __DEV__
-process.env['NODE_ENV'] = isDev ? 'development' : 'production'
-if (typeof localStorage !== 'undefined') {
- localStorage.debug = isDev ? '*' : ''
-}
-
-// If using the crypto shim, uncomment the following line to ensure
-// crypto is loaded first, so it can populate global.crypto
-// require('crypto')