From 2ed6f94ca8a0bcae6fe65821fe0aa9784920b19d Mon Sep 17 00:00:00 2001 From: katspaugh <381895+katspaugh@users.noreply.github.com> Date: Sun, 26 Mar 2023 13:53:12 +0200 Subject: [PATCH] Fix: "unique key" warnings in Tooltips (#226) * Fix: "unique key" warnings in Tooltip * v2.0.5 --- .storybook/webpack.config.js | 47 ++--------------------- package.json | 2 +- src/components/EthHashInfo/CopyButton.tsx | 1 + src/components/ExplorerButton/index.tsx | 1 + 4 files changed, 7 insertions(+), 44 deletions(-) diff --git a/.storybook/webpack.config.js b/.storybook/webpack.config.js index 195eaeab..ef626fff 100644 --- a/.storybook/webpack.config.js +++ b/.storybook/webpack.config.js @@ -1,48 +1,9 @@ -module.exports = ({ config }) => { - config.module.rules.push({ - test: /\.(ts|js)x?$/, - exclude: [/node_modules/], - use: { - loader: 'ts-loader', - }, - }); - - config.module.rules.push({ - test: /\.css$/i, - use: ['style-loader', 'css-loader'], - }); - - // remove svg from existing rule - config.module.rules = config.module.rules.map((rule) => { - if ( - String(rule.test) === - String( - /\.(svg|ico|jpg|jpeg|png|gif|eot|otf|webp|ttf|woff|woff2|cur|ani)(\?.*)?$/ - ) - ) { - return { - ...rule, - test: /\.(ico|jpg|jpeg|png|gif|eot|otf|webp|ttf|woff|woff2|cur|ani)(\?.*)?$/, - }; - } +const mainConfig = require('../webpack.config.js'); - return rule; - }); - - config.module.rules.push({ - test: /\.(woff(2)?|ttf|eot)(\?v=\d+\.\d+\.\d+)?$/, - type: 'asset/resource', - generator: { - filename: '[name][ext][query]', - }, - }); - - config.module.rules.push({ - test: /\.(png|jpg)$/i, - type: 'asset/inline', - }); +module.exports = ({ config }) => { + config.module.rules = mainConfig.module.rules; - config.resolve.extensions.push('.ts', '.tsx', 'woff2'); + config.resolve.extensions.push('.ts', '.tsx', '.svg', 'woff2'); return config; }; diff --git a/package.json b/package.json index 1ff81829..77d575f0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@safe-global/safe-react-components", - "version": "2.0.4", + "version": "2.0.5", "description": "Safe UI components", "main": "dist/index.min.js", "typings": "dist/index.d.ts", diff --git a/src/components/EthHashInfo/CopyButton.tsx b/src/components/EthHashInfo/CopyButton.tsx index 82fae6b8..26680ec1 100644 --- a/src/components/EthHashInfo/CopyButton.tsx +++ b/src/components/EthHashInfo/CopyButton.tsx @@ -42,6 +42,7 @@ const CopyButton = ({ placement="top" onMouseLeave={handleMouseLeave}>