aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancesco Agosti <francesco.agosti93@gmail.com>2018-12-06 04:45:16 +0800
committerGitHub <noreply@github.com>2018-12-06 04:45:16 +0800
commite839e698f9360d3632f4717f8e37699b6c14dd78 (patch)
tree871144a589059a48eecc5806c82092e491361859
parent08eb0b91b6d0f0dc90ae920a18ca5dd080bf235c (diff)
parentf2c5a8e2f1e517e89f45b03bd3cdf5bb59c450bf (diff)
downloaddexon-0x-contracts-e839e698f9360d3632f4717f8e37699b6c14dd78.tar.gz
dexon-0x-contracts-e839e698f9360d3632f4717f8e37699b6c14dd78.tar.zst
dexon-0x-contracts-e839e698f9360d3632f4717f8e37699b6c14dd78.zip
Merge pull request #1392 from 0xProject/fix/instant/pre-release-hotfixes
[instant] CSS leakage and non-lowercase defaultAssetData fix
-rw-r--r--packages/instant/public/external.css4
-rw-r--r--packages/instant/src/components/ui/input.tsx4
-rw-r--r--packages/instant/src/components/zero_ex_instant_provider.tsx3
-rw-r--r--packages/instant/src/util/asset.ts4
4 files changed, 10 insertions, 5 deletions
diff --git a/packages/instant/public/external.css b/packages/instant/public/external.css
index cab11112a..21278577e 100644
--- a/packages/instant/public/external.css
+++ b/packages/instant/public/external.css
@@ -15,6 +15,10 @@ input {
height: 100px;
}
+input::-webkit-input-placeholder {
+ color: #b4b4b4 !important;
+}
+
div {
padding: 3px;
}
diff --git a/packages/instant/src/components/ui/input.tsx b/packages/instant/src/components/ui/input.tsx
index 863c970ef..62c70f9e1 100644
--- a/packages/instant/src/components/ui/input.tsx
+++ b/packages/instant/src/components/ui/input.tsx
@@ -29,8 +29,8 @@ export const Input =
outline: none;
border: none;
&::placeholder {
- color: ${props => props.theme[props.fontColor || 'white']};
- opacity: 0.5;
+ color: ${props => props.theme[props.fontColor || 'white']} !important;
+ opacity: 0.5 !important;
}
}
`;
diff --git a/packages/instant/src/components/zero_ex_instant_provider.tsx b/packages/instant/src/components/zero_ex_instant_provider.tsx
index dae9124c6..f06d551c7 100644
--- a/packages/instant/src/components/zero_ex_instant_provider.tsx
+++ b/packages/instant/src/components/zero_ex_instant_provider.tsx
@@ -60,7 +60,8 @@ export class ZeroExInstantProvider extends React.Component<ZeroExInstantProvider
);
// merge the additional additionalAssetMetaDataMap with our default map
const completeAssetMetaDataMap = {
- ...props.additionalAssetMetaDataMap,
+ // Make sure the passed in assetDatas are lower case
+ ..._.mapKeys(props.additionalAssetMetaDataMap || {}, (value, key) => key.toLowerCase()),
...defaultState.assetMetaDataMap,
};
// construct the final state
diff --git a/packages/instant/src/util/asset.ts b/packages/instant/src/util/asset.ts
index 08f3642e3..13f84ef74 100644
--- a/packages/instant/src/util/asset.ts
+++ b/packages/instant/src/util/asset.ts
@@ -26,7 +26,7 @@ export const assetUtils = {
return;
}
return {
- assetData,
+ assetData: assetData.toLowerCase(),
metaData,
};
},
@@ -36,7 +36,7 @@ export const assetUtils = {
network: Network,
): Asset => {
return {
- assetData,
+ assetData: assetData.toLowerCase(),
metaData: assetUtils.getMetaDataOrThrow(assetData, assetMetaDataMap, network),
};
},