Skip to content

Commit eda9400

Browse files
committed
v2.0.0: renamed to scoped npm package @depay/react-token-image
1 parent 27d7320 commit eda9400

File tree

11 files changed

+56
-55
lines changed

11 files changed

+56
-55
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,5 @@
2020
# Various
2121
npm-debug.log*
2222
yarn-error.log
23+
24+
/tmp

dev.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
99
<script crossorigin src="https://unpkg.com/react@17/umd/react.development.js"></script>
1010
<script crossorigin src="https://unpkg.com/react-dom@17/umd/react-dom.development.js"></script>
11-
<script crossorigin src="https://unpkg.com/depay-web3-blockchains@2/dist/umd/index.js"></script>
12-
<script crossorigin src="https://unpkg.com/depay-web3-constants@2/dist/umd/index.js"></script>
13-
<script src="dist/umd/index.dev.js"></script>
11+
<script crossorigin src="https://unpkg.com/@depay/web3-blockchains@3/dist/umd/index.js"></script>
12+
<script crossorigin src="https://unpkg.com/@depay/web3-constants@4/dist/umd/index.js"></script>
13+
<script src="tmp/index.dev.js"></script>
1414
</head>
1515
<body>
1616
<div id="tokenOne" class="container d-flex justify-content-center pt-5"></div>

dist/cjs/index.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
Object.defineProperty(exports, '__esModule', { value: true });
44

55
var React = require('react');
6-
var depayWeb3Blockchains = require('depay-web3-blockchains');
7-
var depayWeb3Constants = require('depay-web3-constants');
6+
var web3Blockchains = require('@depay/web3-blockchains');
7+
var web3Constants = require('@depay/web3-constants');
88

99
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
1010

1111
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
1212

13-
const _jsxFileName = "/Users/sebastian/Work/DePay/depay-react-token-image/src/index.jsx";
13+
const _jsxFileName = "/Users/sebastian/Work/DePay/react-token-image/src/index.jsx";
1414
let TokenImage = function(props){
1515

1616
const [src, setSrc] = React.useState();
@@ -20,8 +20,8 @@ let TokenImage = function(props){
2020
const address = props.address;
2121

2222
React.useEffect(()=>{
23-
if(depayWeb3Constants.CONSTANTS[blockchain].NATIVE.toLowerCase() == address.toLowerCase()) {
24-
setSrc(depayWeb3Blockchains.Blockchain.findByName(blockchain).logo);
23+
if(web3Constants.CONSTANTS[blockchain].NATIVE.toLowerCase() == address.toLowerCase()) {
24+
setSrc(web3Blockchains.Blockchain.findByName(blockchain).logo);
2525
} else {
2626
setSrc(trustWalletAddress({ blockchain, address }));
2727
}

dist/es/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import React, { useState, useEffect } from 'react';
2-
import { Blockchain } from 'depay-web3-blockchains';
3-
import { CONSTANTS } from 'depay-web3-constants';
2+
import { Blockchain } from '@depay/web3-blockchains';
3+
import { CONSTANTS } from '@depay/web3-constants';
44

5-
const _jsxFileName = "/Users/sebastian/Work/DePay/depay-react-token-image/src/index.jsx";
5+
const _jsxFileName = "/Users/sebastian/Work/DePay/react-token-image/src/index.jsx";
66
let TokenImage = function(props){
77

88
const [src, setSrc] = useState();

dist/umd/index.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
(function (global, factory) {
2-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react'), require('depay-web3-blockchains'), require('depay-web3-constants')) :
3-
typeof define === 'function' && define.amd ? define(['exports', 'react', 'depay-web3-blockchains', 'depay-web3-constants'], factory) :
2+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react'), require('@depay/web3-blockchains'), require('@depay/web3-constants')) :
3+
typeof define === 'function' && define.amd ? define(['exports', 'react', '@depay/web3-blockchains', '@depay/web3-constants'], factory) :
44
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.ReactTokenImage = {}, global.React, global.Web3Blockchains, global.Web3Constants));
5-
}(this, (function (exports, React, depayWeb3Blockchains, depayWeb3Constants) { 'use strict';
5+
}(this, (function (exports, React, web3Blockchains, web3Constants) { 'use strict';
66

77
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
88

99
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
1010

11-
const _jsxFileName = "/Users/sebastian/Work/DePay/depay-react-token-image/src/index.jsx";
11+
const _jsxFileName = "/Users/sebastian/Work/DePay/react-token-image/src/index.jsx";
1212
let TokenImage = function(props){
1313

1414
const [src, setSrc] = React.useState();
@@ -18,8 +18,8 @@
1818
const address = props.address;
1919

2020
React.useEffect(()=>{
21-
if(depayWeb3Constants.CONSTANTS[blockchain].NATIVE.toLowerCase() == address.toLowerCase()) {
22-
setSrc(depayWeb3Blockchains.Blockchain.findByName(blockchain).logo);
21+
if(web3Constants.CONSTANTS[blockchain].NATIVE.toLowerCase() == address.toLowerCase()) {
22+
setSrc(web3Blockchains.Blockchain.findByName(blockchain).logo);
2323
} else {
2424
setSrc(trustWalletAddress({ blockchain, address }));
2525
}

package.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"name": "depay-react-token-image",
2+
"name": "@depay/react-token-image",
33
"moduleName": "ReactTokenImage",
4-
"version": "1.1.3",
4+
"version": "2.0.0",
55
"description": "React component to display token images with fallbacks and unknown state.",
66
"main": "./dist/cjs/index.js",
77
"files": [
@@ -18,7 +18,7 @@
1818
"test:cypress:debug": "yarn cypress run --headed --no-exit",
1919
"test": "yarn test:cypress"
2020
},
21-
"repository": "git@github.com:DePayFi/depay-react-token-image.git",
21+
"repository": "git@github.com:DePayFi/react-token-image.git",
2222
"keywords": [
2323
"react",
2424
"token",
@@ -29,15 +29,15 @@
2929
"author": "depay.fi",
3030
"license": "MIT",
3131
"bugs": {
32-
"url": "https://github.com/DePayFi/depay-react-token-image/issues"
32+
"url": "https://github.com/DePayFi/react-token-image/issues"
3333
},
34-
"homepage": "https://github.com/DePayFi/depay-react-token-image#readme",
34+
"homepage": "https://github.com/DePayFi/react-token-image#readme",
3535
"private": false,
3636
"dependencies": {
3737
},
3838
"peerDependencies": {
39-
"depay-web3-blockchains": "^2.4.0",
40-
"depay-web3-constants": "^3.0.0",
39+
"@depay/web3-blockchains": "^3.0.0",
40+
"@depay/web3-constants": "^4.0.0",
4141
"react": "^17",
4242
"react-dom": "^17"
4343
},
@@ -48,6 +48,8 @@
4848
"@babel/core": "^7.12.9",
4949
"@babel/preset-env": "^7.12.7",
5050
"@babel/preset-react": "^7.12.7",
51+
"@depay/web3-blockchains": "^3.0.0",
52+
"@depay/web3-constants": "^4.0.0",
5153
"@rollup/plugin-commonjs": "^18.0.0",
5254
"@rollup/plugin-node-resolve": "^11.2.1",
5355
"@rollup/plugin-replace": "^2.4.2",
@@ -56,16 +58,14 @@
5658
"babel-preset-env": "^1.7.0",
5759
"babel-preset-react": "^6.24.1",
5860
"cypress": "^8.2.0",
59-
"depay-web3-blockchains": "^2.4.0",
60-
"depay-web3-constants": "^3.0.0",
6161
"eslint": "^7.15.0",
6262
"eslint-loader": "^4.0.2",
6363
"eslint-plugin-import": "^2.22.1",
6464
"eslint-plugin-react": "^7.21.5",
6565
"eslint-plugin-react-hooks": "^4.2.0",
66-
"react": "^17.0.1",
67-
"react-dom": "^17.0.2",
68-
"react-test-renderer": "^17.0.1",
66+
"react": "^17",
67+
"react-dom": "^17",
68+
"react-test-renderer": "^17",
6969
"react-testing-library": "^8.0.1",
7070
"rollup": "^2.34.2",
7171
"rollup-plugin-livereload": "^2.0.0",

rollup.dev.config.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
1-
import globals from './rollup.globals'
1+
import globals from './rollup.globals.js'
22
import livereload from 'rollup-plugin-livereload'
33
import pkg from './package.json'
44
import rollup from './rollup.module.config.js'
55
import serve from 'rollup-plugin-serve'
66

77
export default Object.assign({}, rollup, {
8-
input: 'src/index.jsx',
98
output: [
109
{
1110
format: 'umd',
12-
globals: globals,
1311
name: pkg.moduleName,
14-
file: 'dist/umd/index.dev.js'
15-
}
12+
globals: globals,
13+
file: 'tmp/index.dev.js'
14+
},
1615
],
1716
plugins: [...rollup.plugins,
1817
serve({

rollup.globals.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export default {
22
'react': 'React',
33
'react-dom': 'ReactDOM',
4-
'depay-web3-constants': 'Web3Constants',
5-
'depay-web3-blockchains': 'Web3Blockchains',
4+
'@depay/web3-constants': 'Web3Constants',
5+
'@depay/web3-blockchains': 'Web3Blockchains',
66
}

rollup.module.config.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import commonjs from '@rollup/plugin-commonjs'
2-
import globals from './rollup.globals'
2+
import globals from './rollup.globals.js'
33
import pkg from './package.json'
44
import replace from '@rollup/plugin-replace'
55
import resolve from '@rollup/plugin-node-resolve'
@@ -21,8 +21,8 @@ export default {
2121
},
2222
{
2323
format: 'umd',
24-
globals: globals,
2524
name: pkg.moduleName,
25+
globals: globals,
2626
file: 'dist/umd/index.js'
2727
},
2828
],
@@ -33,10 +33,10 @@ export default {
3333
plugins: [
3434
sucrase({
3535
exclude: ['node_modules/**'],
36-
transforms: ['typescript', 'jsx']
36+
transforms: ['jsx']
3737
}),
3838
resolve({
39-
extensions: ['.js', '.ts', '.jsx']
39+
extensions: ['.js', '.jsx']
4040
}),
4141
nodeResolve(),
4242
commonjs({

src/index.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { useState, useEffect } from 'react'
2-
import { Blockchain } from 'depay-web3-blockchains'
3-
import { CONSTANTS } from 'depay-web3-constants'
2+
import { Blockchain } from '@depay/web3-blockchains'
3+
import { CONSTANTS } from '@depay/web3-constants'
44

55
let TokenImage = function(props){
66

0 commit comments

Comments
 (0)