diff --git a/.changeset/small-fishes-flow.md b/.changeset/small-fishes-flow.md new file mode 100644 index 000000000000..5f7795dc77d8 --- /dev/null +++ b/.changeset/small-fishes-flow.md @@ -0,0 +1,6 @@ +--- +"@ledgerhq/icons-ui": patch +"@ledgerhq/react-ui": patch +--- + +Removal of ProviderIcons from UILib diff --git a/libs/ui/packages/icons/scripts/buildLegacy.js b/libs/ui/packages/icons/scripts/buildLegacy.js index 27b81fe9a17d..eaa250a42fd4 100644 --- a/libs/ui/packages/icons/scripts/buildLegacy.js +++ b/libs/ui/packages/icons/scripts/buildLegacy.js @@ -9,7 +9,6 @@ const svgr = require("@svgr/core").default; const rootDir = path.join(__dirname, "..", "src"); const reactDir = path.join(rootDir, "reactLegacy"); const nativeDir = path.join(rootDir, "nativeLegacy"); -const additionalIconsDir = path.join(__dirname, "..", "src", "additionalIcons"); // Create folders if needed if (!fs.existsSync(reactDir)) { @@ -67,31 +66,6 @@ function reactTemplate({ template }, _, { imports, interfaces, componentName, __ `; } -// Additional Icons component template -function reactAdditionalTemplate( - { template }, - _, - { imports, interfaces, componentName, __, jsx, exports }, -) { - const plugins = ["typescript"]; - const tpl = template.smart({ plugins }); - - return tpl.ast` - ${imports} - import Svg from "../StyledSvg" - - type Props = { size?: number | string; width?: number | string; height?: number | string; }; - - ${interfaces} - - function ${componentName} ({ size, width, height }: Props): JSX.Element { - return ${jsx}; - } - - ${exports} - `; -} - // Component template function reactNativeTemplate( { template }, @@ -234,52 +208,3 @@ glob(`${rootDir}/svg-legacy/**/*.svg`, (err, icons) => { } }); }); -//====== create additional icons ===== - -// get subfolders -const folders = fs.readdirSync(additionalIconsDir); - -folders.forEach(folder => { - // Create target folders - const folderName = `${folder}`; - if (!fs.existsSync(`${reactDir}/${folderName}`)) { - fs.mkdirSync(`${reactDir}/${folderName}`); - } - - fs.writeFileSync(`${reactDir}/${folderName}/index.ts`, "", { - flag: "w", - encoding: "utf-8", - }); - - glob(`${additionalIconsDir}/${folder}/*.svg`, (err, icons) => { - icons.forEach(icon => { - let name = camelcase(path.basename(icon, ".svg"), { pascalCase: true }); - if (!isNaN(name.charAt(0))) name = `_${name}`; // fix variable name leading with a numerical value - - const exportString = `export { default as ${name} } from "./${name}";\n`; - fs.appendFileSync(`${reactDir}/${folderName}/index.ts`, exportString, "utf-8"); - - const svg = fs.readFileSync(icon, "utf-8"); - - const options = { - plugins: ["@svgr/plugin-svgo", "@svgr/plugin-jsx"], - expandProps: false, - componentName: name, - svgProps: { - height: "{height || size}", - width: "{width || size}", - }, - svgoConfig: { - plugins: [{ removeXMLNS: true, removeViewBox: false }], - }, - }; - convert( - svg, - { ...options, template: reactAdditionalTemplate }, - { componentName: name }, - `${reactDir}/${folderName}/${name}.tsx`, - true, - ); - }); - }); -}); diff --git a/libs/ui/packages/icons/src/additionalIcons/Providers/AAVE.svg b/libs/ui/packages/icons/src/additionalIcons/Providers/AAVE.svg deleted file mode 100644 index 188ad7829913..000000000000 --- a/libs/ui/packages/icons/src/additionalIcons/Providers/AAVE.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/libs/ui/packages/icons/src/additionalIcons/Providers/BTCDirect.svg b/libs/ui/packages/icons/src/additionalIcons/Providers/BTCDirect.svg deleted file mode 100644 index 2e479101ffff..000000000000 --- a/libs/ui/packages/icons/src/additionalIcons/Providers/BTCDirect.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/libs/ui/packages/icons/src/additionalIcons/Providers/Baanx.svg b/libs/ui/packages/icons/src/additionalIcons/Providers/Baanx.svg deleted file mode 100644 index 976841019fed..000000000000 --- a/libs/ui/packages/icons/src/additionalIcons/Providers/Baanx.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/libs/ui/packages/icons/src/additionalIcons/Providers/Binance.svg b/libs/ui/packages/icons/src/additionalIcons/Providers/Binance.svg deleted file mode 100644 index 522763f081f1..000000000000 --- a/libs/ui/packages/icons/src/additionalIcons/Providers/Binance.svg +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/libs/ui/packages/icons/src/additionalIcons/Providers/CIC.svg b/libs/ui/packages/icons/src/additionalIcons/Providers/CIC.svg deleted file mode 100644 index 588253364c3e..000000000000 --- a/libs/ui/packages/icons/src/additionalIcons/Providers/CIC.svg +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/libs/ui/packages/icons/src/additionalIcons/Providers/Changelly.svg b/libs/ui/packages/icons/src/additionalIcons/Providers/Changelly.svg deleted file mode 100644 index 2c9db50659f8..000000000000 --- a/libs/ui/packages/icons/src/additionalIcons/Providers/Changelly.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/libs/ui/packages/icons/src/additionalIcons/Providers/CoinGecko.svg b/libs/ui/packages/icons/src/additionalIcons/Providers/CoinGecko.svg deleted file mode 100644 index ee2f53e45881..000000000000 --- a/libs/ui/packages/icons/src/additionalIcons/Providers/CoinGecko.svg +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/libs/ui/packages/icons/src/additionalIcons/Providers/Coinify.svg b/libs/ui/packages/icons/src/additionalIcons/Providers/Coinify.svg deleted file mode 100644 index 6c5ceb9e2533..000000000000 --- a/libs/ui/packages/icons/src/additionalIcons/Providers/Coinify.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/libs/ui/packages/icons/src/additionalIcons/Providers/Compound.svg b/libs/ui/packages/icons/src/additionalIcons/Providers/Compound.svg deleted file mode 100644 index d2f5319f1972..000000000000 --- a/libs/ui/packages/icons/src/additionalIcons/Providers/Compound.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/libs/ui/packages/icons/src/additionalIcons/Providers/Deversifi.svg b/libs/ui/packages/icons/src/additionalIcons/Providers/Deversifi.svg deleted file mode 100644 index d8e04c0e8742..000000000000 --- a/libs/ui/packages/icons/src/additionalIcons/Providers/Deversifi.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/libs/ui/packages/icons/src/additionalIcons/Providers/FTX.svg b/libs/ui/packages/icons/src/additionalIcons/Providers/FTX.svg deleted file mode 100644 index 39512de56497..000000000000 --- a/libs/ui/packages/icons/src/additionalIcons/Providers/FTX.svg +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/libs/ui/packages/icons/src/additionalIcons/Providers/FTXUS.svg b/libs/ui/packages/icons/src/additionalIcons/Providers/FTXUS.svg deleted file mode 100644 index f2e5922c788b..000000000000 --- a/libs/ui/packages/icons/src/additionalIcons/Providers/FTXUS.svg +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/libs/ui/packages/icons/src/additionalIcons/Providers/Kiln.svg b/libs/ui/packages/icons/src/additionalIcons/Providers/Kiln.svg deleted file mode 100644 index 066be253a144..000000000000 --- a/libs/ui/packages/icons/src/additionalIcons/Providers/Kiln.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/libs/ui/packages/icons/src/additionalIcons/Providers/Lido.svg b/libs/ui/packages/icons/src/additionalIcons/Providers/Lido.svg deleted file mode 100644 index e0e59a44309a..000000000000 --- a/libs/ui/packages/icons/src/additionalIcons/Providers/Lido.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/libs/ui/packages/icons/src/additionalIcons/Providers/LoopiPay.svg b/libs/ui/packages/icons/src/additionalIcons/Providers/LoopiPay.svg deleted file mode 100644 index 9f7d1a72dc30..000000000000 --- a/libs/ui/packages/icons/src/additionalIcons/Providers/LoopiPay.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/libs/ui/packages/icons/src/additionalIcons/Providers/Mercuryo.svg b/libs/ui/packages/icons/src/additionalIcons/Providers/Mercuryo.svg deleted file mode 100644 index c75e9765de59..000000000000 --- a/libs/ui/packages/icons/src/additionalIcons/Providers/Mercuryo.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/libs/ui/packages/icons/src/additionalIcons/Providers/Moonpay.svg b/libs/ui/packages/icons/src/additionalIcons/Providers/Moonpay.svg deleted file mode 100644 index 58ffa652f0cc..000000000000 --- a/libs/ui/packages/icons/src/additionalIcons/Providers/Moonpay.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/libs/ui/packages/icons/src/additionalIcons/Providers/OneInch.svg b/libs/ui/packages/icons/src/additionalIcons/Providers/OneInch.svg deleted file mode 100644 index 38542a8064e1..000000000000 --- a/libs/ui/packages/icons/src/additionalIcons/Providers/OneInch.svg +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/libs/ui/packages/icons/src/additionalIcons/Providers/Opensea.svg b/libs/ui/packages/icons/src/additionalIcons/Providers/Opensea.svg deleted file mode 100644 index c6b1e81aad52..000000000000 --- a/libs/ui/packages/icons/src/additionalIcons/Providers/Opensea.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/libs/ui/packages/icons/src/additionalIcons/Providers/POAP.svg b/libs/ui/packages/icons/src/additionalIcons/Providers/POAP.svg deleted file mode 100644 index 9b86da769f20..000000000000 --- a/libs/ui/packages/icons/src/additionalIcons/Providers/POAP.svg +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/libs/ui/packages/icons/src/additionalIcons/Providers/PancakeSwap.svg b/libs/ui/packages/icons/src/additionalIcons/Providers/PancakeSwap.svg deleted file mode 100644 index b287dc8fca50..000000000000 --- a/libs/ui/packages/icons/src/additionalIcons/Providers/PancakeSwap.svg +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/libs/ui/packages/icons/src/additionalIcons/Providers/Paraswap.svg b/libs/ui/packages/icons/src/additionalIcons/Providers/Paraswap.svg deleted file mode 100644 index 9d473f3c87e5..000000000000 --- a/libs/ui/packages/icons/src/additionalIcons/Providers/Paraswap.svg +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/libs/ui/packages/icons/src/additionalIcons/Providers/Rainbow.me.svg b/libs/ui/packages/icons/src/additionalIcons/Providers/Rainbow.me.svg deleted file mode 100644 index d8047dc46e53..000000000000 --- a/libs/ui/packages/icons/src/additionalIcons/Providers/Rainbow.me.svg +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/libs/ui/packages/icons/src/additionalIcons/Providers/Ramp.svg b/libs/ui/packages/icons/src/additionalIcons/Providers/Ramp.svg deleted file mode 100644 index b72a58b86839..000000000000 --- a/libs/ui/packages/icons/src/additionalIcons/Providers/Ramp.svg +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/libs/ui/packages/icons/src/additionalIcons/Providers/Rarible.svg b/libs/ui/packages/icons/src/additionalIcons/Providers/Rarible.svg deleted file mode 100644 index d6d4655c6305..000000000000 --- a/libs/ui/packages/icons/src/additionalIcons/Providers/Rarible.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/libs/ui/packages/icons/src/additionalIcons/Providers/Simplex.svg b/libs/ui/packages/icons/src/additionalIcons/Providers/Simplex.svg deleted file mode 100644 index 3f85d4cb4ff8..000000000000 --- a/libs/ui/packages/icons/src/additionalIcons/Providers/Simplex.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/libs/ui/packages/icons/src/additionalIcons/Providers/SushiSwap.svg b/libs/ui/packages/icons/src/additionalIcons/Providers/SushiSwap.svg deleted file mode 100644 index 26bd5609fb25..000000000000 --- a/libs/ui/packages/icons/src/additionalIcons/Providers/SushiSwap.svg +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/libs/ui/packages/icons/src/additionalIcons/Providers/Transak.svg b/libs/ui/packages/icons/src/additionalIcons/Providers/Transak.svg deleted file mode 100644 index c0ebfd75aa9b..000000000000 --- a/libs/ui/packages/icons/src/additionalIcons/Providers/Transak.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/libs/ui/packages/icons/src/additionalIcons/Providers/Wyre.svg b/libs/ui/packages/icons/src/additionalIcons/Providers/Wyre.svg deleted file mode 100644 index 122fc82d1d21..000000000000 --- a/libs/ui/packages/icons/src/additionalIcons/Providers/Wyre.svg +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/libs/ui/packages/icons/src/additionalIcons/Providers/Zerion.svg b/libs/ui/packages/icons/src/additionalIcons/Providers/Zerion.svg deleted file mode 100644 index c11274ecb4e5..000000000000 --- a/libs/ui/packages/icons/src/additionalIcons/Providers/Zerion.svg +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/libs/ui/packages/icons/src/additionalIcons/Providers/banxa.svg b/libs/ui/packages/icons/src/additionalIcons/Providers/banxa.svg deleted file mode 100644 index a4b94e7c164a..000000000000 --- a/libs/ui/packages/icons/src/additionalIcons/Providers/banxa.svg +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/libs/ui/packages/icons/src/additionalIcons/Providers/bitrefill.svg b/libs/ui/packages/icons/src/additionalIcons/Providers/bitrefill.svg deleted file mode 100644 index b642e39eac63..000000000000 --- a/libs/ui/packages/icons/src/additionalIcons/Providers/bitrefill.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/aave.svg b/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/aave.svg deleted file mode 100644 index 0a25ce362709..000000000000 --- a/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/aave.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/baanx.svg b/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/baanx.svg deleted file mode 100644 index 430fe219865d..000000000000 --- a/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/baanx.svg +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/banxa.svg b/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/banxa.svg deleted file mode 100644 index 93584cf8bf68..000000000000 --- a/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/banxa.svg +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/binance.svg b/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/binance.svg deleted file mode 100644 index 22600df850a0..000000000000 --- a/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/binance.svg +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/bitrefill.svg b/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/bitrefill.svg deleted file mode 100644 index 332bed00a502..000000000000 --- a/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/bitrefill.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/btcdirect.svg b/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/btcdirect.svg deleted file mode 100644 index 528c11b49693..000000000000 --- a/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/btcdirect.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/changelly.svg b/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/changelly.svg deleted file mode 100644 index 8623ead27d2e..000000000000 --- a/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/changelly.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/cic.svg b/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/cic.svg deleted file mode 100644 index 4e84f42d6c89..000000000000 --- a/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/cic.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/coingecko.svg b/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/coingecko.svg deleted file mode 100644 index e94107502c7a..000000000000 --- a/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/coingecko.svg +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/coinify.svg b/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/coinify.svg deleted file mode 100644 index 9c7211722cab..000000000000 --- a/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/coinify.svg +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/compound.svg b/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/compound.svg deleted file mode 100644 index f79b26c1f9a3..000000000000 --- a/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/compound.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/deversifi.svg b/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/deversifi.svg deleted file mode 100644 index 2503f80908f2..000000000000 --- a/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/deversifi.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/ftx-us.svg b/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/ftx-us.svg deleted file mode 100644 index 6844b5b7dd44..000000000000 --- a/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/ftx-us.svg +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/ftx.svg b/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/ftx.svg deleted file mode 100644 index 0a96c1f2e1e0..000000000000 --- a/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/ftx.svg +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/juno.svg b/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/juno.svg deleted file mode 100644 index b020a81c5d24..000000000000 --- a/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/juno.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/kiln.svg b/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/kiln.svg deleted file mode 100644 index c45e913a997d..000000000000 --- a/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/kiln.svg +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/ledger black.svg b/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/ledger black.svg deleted file mode 100644 index 673de6e3813a..000000000000 --- a/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/ledger black.svg +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/ledger card.svg b/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/ledger card.svg deleted file mode 100644 index c9672aad6408..000000000000 --- a/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/ledger card.svg +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/ledger white.svg b/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/ledger white.svg deleted file mode 100644 index d42d313a9302..000000000000 --- a/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/ledger white.svg +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/lido.svg b/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/lido.svg deleted file mode 100644 index 4184fecb467c..000000000000 --- a/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/lido.svg +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/loopipay.svg b/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/loopipay.svg deleted file mode 100644 index cbab3da8aeff..000000000000 --- a/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/loopipay.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/mercuryo.svg b/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/mercuryo.svg deleted file mode 100644 index f7301253d43a..000000000000 --- a/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/mercuryo.svg +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/moonpay.svg b/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/moonpay.svg deleted file mode 100644 index 8b9d50724ae2..000000000000 --- a/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/moonpay.svg +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/oneinch.svg b/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/oneinch.svg deleted file mode 100644 index 81570c11e5c8..000000000000 --- a/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/oneinch.svg +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/opensea.svg b/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/opensea.svg deleted file mode 100644 index 8112fcfa1a62..000000000000 --- a/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/opensea.svg +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/pancakeswap.svg b/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/pancakeswap.svg deleted file mode 100644 index 3173e575eae0..000000000000 --- a/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/pancakeswap.svg +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/paraswap.svg b/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/paraswap.svg deleted file mode 100644 index bce7c7ad7386..000000000000 --- a/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/paraswap.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/poap.svg b/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/poap.svg deleted file mode 100644 index 85fdcce1978e..000000000000 --- a/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/poap.svg +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/rainbowme.svg b/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/rainbowme.svg deleted file mode 100644 index 5d6db061d239..000000000000 --- a/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/rainbowme.svg +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/ramp.svg b/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/ramp.svg deleted file mode 100644 index bbe20794d9e6..000000000000 --- a/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/ramp.svg +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/rarible.svg b/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/rarible.svg deleted file mode 100644 index 750afa2751d9..000000000000 --- a/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/rarible.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/sardine.svg b/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/sardine.svg deleted file mode 100644 index 61b19bb617ca..000000000000 --- a/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/sardine.svg +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/simplex.svg b/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/simplex.svg deleted file mode 100644 index 415250db981b..000000000000 --- a/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/simplex.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/skeleton.svg b/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/skeleton.svg deleted file mode 100644 index 2216e32c8429..000000000000 --- a/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/skeleton.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/sushiswap.svg b/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/sushiswap.svg deleted file mode 100644 index 9a5a9e08dc6d..000000000000 --- a/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/sushiswap.svg +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/transak.svg b/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/transak.svg deleted file mode 100644 index 78a514123295..000000000000 --- a/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/transak.svg +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/wyre.svg b/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/wyre.svg deleted file mode 100644 index b537abc673cd..000000000000 --- a/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/wyre.svg +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/zerion.svg b/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/zerion.svg deleted file mode 100644 index 8138cf196345..000000000000 --- a/libs/ui/packages/icons/src/additionalIcons/ProvidersBoxed/zerion.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/libs/ui/packages/react/src/components/asorted/Icon/ProviderIcon.tsx b/libs/ui/packages/react/src/components/asorted/Icon/ProviderIcon.tsx deleted file mode 100644 index ebcdb0ced50d..000000000000 --- a/libs/ui/packages/react/src/components/asorted/Icon/ProviderIcon.tsx +++ /dev/null @@ -1,73 +0,0 @@ -import * as providers from "@ledgerhq/icons-ui/reactLegacy/Providers/index"; -import * as providersBoxed from "@ledgerhq/icons-ui/reactLegacy/ProvidersBoxed/index"; - -import React from "react"; -import FlexBox from "../../layout/Flex"; - -export const sizes = { - XXS: 16, - XS: 24, - S: 32, - M: 40, - L: 48, - XL: 56, -}; - -export type ProviderSizes = keyof typeof sizes; - -export type Props = { - name: string; - size?: ProviderSizes; - boxed?: boolean; -}; - -export const iconNames = Array.from( - Object.keys(providers).reduce((set, rawKey) => { - const key = rawKey - .replace(/(.+)(Regular|Light|UltraLight|Thin|Medium)+$/g, "$1") - .replace(/(.+)(Ultra)+$/g, "$1") - .replace(/^_/, ""); - if (!set.has(key)) set.add(key); - return set; - }, new Set()), -); - -export type IconGetterProps = { - search: string; - object: Record; -}; - -const getIconCaseInsensitive = ({ search, object }: IconGetterProps) => { - const asLower = search.toLowerCase(); - const key = Object.keys(object).find(key => key.toLowerCase().replace(/^_/, "") === asLower); - return key ? object[key] : null; -}; - -const ProviderIcon = ({ name, size = "S", boxed = false }: Props): JSX.Element | null => { - const maybeIconName = `${name}`; - - if (boxed) { - const BoxedComponent = getIconCaseInsensitive({ - search: maybeIconName, - object: providersBoxed, - }) as React.ElementType; - if (BoxedComponent) { - return ( - - - - ); - } - return null; - } - const Component = getIconCaseInsensitive({ - search: maybeIconName, - object: providers, - }) as React.ElementType; - if (Component) { - return ; - } - return null; -}; - -export default ProviderIcon; diff --git a/libs/ui/packages/react/src/components/asorted/Icon/Providers.stories.tsx b/libs/ui/packages/react/src/components/asorted/Icon/Providers.stories.tsx deleted file mode 100644 index 53156b3a43cd..000000000000 --- a/libs/ui/packages/react/src/components/asorted/Icon/Providers.stories.tsx +++ /dev/null @@ -1,121 +0,0 @@ -import React, { useState } from "react"; -import styled from "styled-components"; -import ProviderIcon, { - iconNames, - Props as ProviderIconProps, - sizes as providerSizes, -} from "./ProviderIcon"; -import { Text, SearchInput, Flex, Grid } from "../../.."; - -const ScrollArea = styled(Grid)` - flex: 1; - height: auto; - ${p => p.theme.overflow.y}; -`; - -const Container = styled(Flex).attrs({ - flex: 1, - flexDirection: "column", - p: 4, -})` - overflow: hidden; - height: calc(100vh - 4em); -`; - -const IconContainer = styled(Flex).attrs<{ active?: boolean }>({ - flexDirection: "column", - justifyContent: "flex-end", - alignItems: "center", - p: 4, -})<{ active?: boolean }>` - ${p => (p.active ? `background-color: ${p.theme.colors.neutral.c20};` : ``)} - border-radius: 4px; - height: 100px; -`; - -const Bold = styled.b` - color: ${p => p.theme.colors.primary.c80}; -`; - -const Story = { - title: "Asorted/Icons/ProviderIcons", - argTypes: { - size: { - type: "enum", - description: "Icon size", - defaultValue: "L", - control: { - options: Object.keys(providerSizes), - }, - }, - boxed: { - type: "boolean", - description: "Boxed", - defaultValue: false, - }, - name: { - type: "string", - // defaultValue: "Aave", - // description: "[Only for single icon], Icon name", - // control: { - // options: iconNames, - // control: { - // type: "select", - // }, - // }, - }, - }, -}; -export default Story; - -const ListTemplate = (args: ProviderIconProps) => { - const [search, setSearch] = useState(""); - const s = search.toLowerCase(); - const regexp = new RegExp(s, "i"); - - return ( - - - - {iconNames - .sort((a: string, b: string) => { - return s ? b.toLowerCase().indexOf(s) - a.toLowerCase().indexOf(s) : a.localeCompare(b); - }) - .map(name => { - const match = name.match(regexp); - const active = s && match; - const index = match?.index ?? 0; - return ( - - - - - - {active ? ( - <> - {name.substr(0, index)} - {name.substr(index, s.length)} - {name.substr(index + s.length)} - - ) : ( - name - )} - - - ); - })} - - - ); -}; -const FlagTemplate = (args: ProviderIconProps) => { - return ; -}; - -export const List = ListTemplate.bind({}); -export const SingleIcon = FlagTemplate.bind({}); diff --git a/libs/ui/packages/react/src/components/asorted/Icon/index.tsx b/libs/ui/packages/react/src/components/asorted/Icon/index.tsx index 3ad5f8758724..573209ebfb62 100644 --- a/libs/ui/packages/react/src/components/asorted/Icon/index.tsx +++ b/libs/ui/packages/react/src/components/asorted/Icon/index.tsx @@ -3,4 +3,3 @@ import BoxedIcon, { IconBox } from "./BoxedIcon"; export { BoxedIcon, IconBox }; export type { Props } from "./Icon"; export { default as CryptoIcon } from "./CryptoIcon"; -export { default as ProviderIcon } from "./ProviderIcon"; diff --git a/libs/ui/packages/react/src/components/asorted/index.ts b/libs/ui/packages/react/src/components/asorted/index.ts index 7ce50d587c8f..70dcb8fea564 100644 --- a/libs/ui/packages/react/src/components/asorted/index.ts +++ b/libs/ui/packages/react/src/components/asorted/index.ts @@ -1,3 +1,3 @@ export { default as Divider } from "./Divider"; -export { default as Icon, IconBox, BoxedIcon, CryptoIcon, ProviderIcon } from "./Icon"; +export { default as Icon, IconBox, BoxedIcon, CryptoIcon } from "./Icon"; export { default as Text } from "./Text";