From c3f57c19e87c2bf463d60b16dd98785ef7d46fae Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Mon, 29 Jul 2019 11:30:37 +0200 Subject: [PATCH] Move ui-identicon -> react-identicon (#165) * Move ui-identicon -> react-identicon * ui-identicon import fix * Update README package links * Update doc sidebar links * Adjust react-qr signatures, CHANGELOG --- CHANGELOG.md | 2 ++ README.md | 3 ++- docs/.vuepress/config.js | 3 ++- jest.config.js | 4 ++-- packages/{ui-identicon => react-identicon}/LICENSE | 0 .../{ui-identicon => react-identicon}/README.md | 6 +++--- packages/{ui-identicon => react-identicon}/demo.png | Bin .../{ui-identicon => react-identicon}/index.html | 0 .../{ui-identicon => react-identicon}/package.json | 2 +- .../{ui-identicon => react-identicon}/src/Demo.tsx | 2 +- .../src/Identicon.tsx | 2 +- .../src/beachball/LICENSE | 2 +- .../src/beachball/README.md | 4 ++-- .../src/beachball/colors.spec.ts | 2 +- .../src/beachball/colors.ts | 2 +- .../src/beachball/container.spec.ts | 2 +- .../src/beachball/container.ts | 2 +- .../src/beachball/defaults.ts | 2 +- .../src/beachball/demo.ts | 2 +- .../src/beachball/index.spec.ts | 2 +- .../src/beachball/index.ts | 2 +- .../src/beachball/seeder.spec.ts | 2 +- .../src/beachball/seeder.ts | 2 +- .../src/beachball/shape/circle.spec.ts | 2 +- .../src/beachball/shape/circle.ts | 2 +- .../src/beachball/shape/square.ts | 2 +- .../src/beachball/svg/circle.spec.ts | 2 +- .../src/beachball/svg/circle.ts | 2 +- .../src/beachball/svg/element.spec.ts | 2 +- .../src/beachball/svg/element.ts | 2 +- .../src/beachball/svg/rect.spec.ts | 2 +- .../src/beachball/svg/rect.ts | 2 +- .../src/beachball/svg/svg.spec.ts | 2 +- .../src/beachball/svg/svg.ts | 2 +- .../src/beachball/types.ts | 2 +- .../src/beachball/xmlserializer.d.ts | 2 +- .../src/icons/Beachball.tsx | 2 +- .../src/icons/Empty.tsx | 2 +- .../src/icons/Jdenticon.tsx | 2 +- .../src/icons/Polkadot.tsx | 2 +- .../src/icons/index.ts | 2 +- .../{ui-identicon => react-identicon}/src/index.ts | 2 +- .../{ui-identicon => react-identicon}/src/types.ts | 2 +- .../webpack.config.js | 2 +- packages/react-qr/README.md | 2 +- packages/react-qr/src/Display.tsx | 4 ++-- packages/react-qr/src/DisplayAddress.tsx | 2 +- packages/react-qr/src/DisplayPayload.tsx | 2 +- packages/ui-keyring/src/options/KeyPair.tsx | 2 +- tsconfig.json | 4 ++-- 50 files changed, 56 insertions(+), 52 deletions(-) rename packages/{ui-identicon => react-identicon}/LICENSE (100%) rename packages/{ui-identicon => react-identicon}/README.md (84%) rename packages/{ui-identicon => react-identicon}/demo.png (100%) rename packages/{ui-identicon => react-identicon}/index.html (100%) rename packages/{ui-identicon => react-identicon}/package.json (95%) rename packages/{ui-identicon => react-identicon}/src/Demo.tsx (92%) rename packages/{ui-identicon => react-identicon}/src/Identicon.tsx (97%) rename packages/{ui-identicon => react-identicon}/src/beachball/LICENSE (91%) rename packages/{ui-identicon => react-identicon}/src/beachball/README.md (92%) rename packages/{ui-identicon => react-identicon}/src/beachball/colors.spec.ts (94%) rename packages/{ui-identicon => react-identicon}/src/beachball/colors.ts (90%) rename packages/{ui-identicon => react-identicon}/src/beachball/container.spec.ts (94%) rename packages/{ui-identicon => react-identicon}/src/beachball/container.ts (92%) rename packages/{ui-identicon => react-identicon}/src/beachball/defaults.ts (85%) rename packages/{ui-identicon => react-identicon}/src/beachball/demo.ts (92%) rename packages/{ui-identicon => react-identicon}/src/beachball/index.spec.ts (96%) rename packages/{ui-identicon => react-identicon}/src/beachball/index.ts (93%) rename packages/{ui-identicon => react-identicon}/src/beachball/seeder.spec.ts (89%) rename packages/{ui-identicon => react-identicon}/src/beachball/seeder.ts (90%) rename packages/{ui-identicon => react-identicon}/src/beachball/shape/circle.spec.ts (87%) rename packages/{ui-identicon => react-identicon}/src/beachball/shape/circle.ts (91%) rename packages/{ui-identicon => react-identicon}/src/beachball/shape/square.ts (93%) rename packages/{ui-identicon => react-identicon}/src/beachball/svg/circle.spec.ts (86%) rename packages/{ui-identicon => react-identicon}/src/beachball/svg/circle.ts (85%) rename packages/{ui-identicon => react-identicon}/src/beachball/svg/element.spec.ts (86%) rename packages/{ui-identicon => react-identicon}/src/beachball/svg/element.ts (87%) rename packages/{ui-identicon => react-identicon}/src/beachball/svg/rect.spec.ts (87%) rename packages/{ui-identicon => react-identicon}/src/beachball/svg/rect.ts (84%) rename packages/{ui-identicon => react-identicon}/src/beachball/svg/svg.spec.ts (85%) rename packages/{ui-identicon => react-identicon}/src/beachball/svg/svg.ts (81%) rename packages/{ui-identicon => react-identicon}/src/beachball/types.ts (75%) rename packages/{ui-identicon => react-identicon}/src/beachball/xmlserializer.d.ts (69%) rename packages/{ui-identicon => react-identicon}/src/icons/Beachball.tsx (90%) rename packages/{ui-identicon => react-identicon}/src/icons/Empty.tsx (88%) rename packages/{ui-identicon => react-identicon}/src/icons/Jdenticon.tsx (89%) rename packages/{ui-identicon => react-identicon}/src/icons/Polkadot.tsx (98%) rename packages/{ui-identicon => react-identicon}/src/icons/index.ts (82%) rename packages/{ui-identicon => react-identicon}/src/index.ts (75%) rename packages/{ui-identicon => react-identicon}/src/types.ts (91%) rename packages/{ui-identicon => react-identicon}/webpack.config.js (92%) diff --git a/CHANGELOG.md b/CHANGELOG.md index bf017f03..d4401568 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # 0.42.x +- The `@polkadot/react-qr` package has been added to display/scan QR codes +- The `@polkadot/ui-identicon` package has been renamed to `@polkadot/react-identicon` - For `@polkadot/ui-keyring` the stores are now not exported from the index, imports should be changed to either `ui-keyring/stores` or explicitly to `ui-keyring/stores/Extension` - `@polkadot/ui-settings` has UNfrastructure added as an RPC provider for Alex - `@polkadot/ui-settings` exposes a dropdown with address prefix options diff --git a/README.md b/README.md index c2043323..40119d6a 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,8 @@ Basic browser and React components for creating apps using the polkadot{.js} lib The following libraries are currently available +- [react-identicon](packages/react-identicon/) Identity icon generator with address as input +- [react-qr](packages/react-qr/) QR code generator/reader for [uos](https://github.com/maciejhirsz/uos) (Substrate/Polkadot only) - [ui-assets](packages/ui-assets/) Static assets, images and others, shared accross projects -- [ui-identicon](packages/ui-identicon/) Identity icon generator with address as input - [ui-keyring](packages/ui-keyring/) A browser-specific wrapper around the base [@polkadot/util-keyring](https://github.com/polkadot-js/util/) library - [ui-settings](packages/ui-settings/) A browser local storage wrapper for app settings & configuration diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index dcf792d4..fce640cf 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -22,7 +22,8 @@ module.exports = { ], search: false, sidebar: [ - ['/ui-identicon/', '@polkadot/ui-identicon'], + ['/react-identicon/', '@polkadot/react-identicon'], + ['/react-qr/', '@polkadot/react-qr'], ['/ui-keyring/', '@polkadot/ui-keyring'], ['/ui-settings/', '@polkadot/ui-settings'], '/CONTRIBUTING.md' diff --git a/jest.config.js b/jest.config.js index 3a0857ca..371c25c3 100644 --- a/jest.config.js +++ b/jest.config.js @@ -3,8 +3,8 @@ const config = require('@polkadot/dev-react/config/jest'); module.exports = Object.assign({}, config, { moduleNameMapper: { - '@polkadot/react-(qr)(.*)$': '/packages/react-$1/src/$2', - '@polkadot/ui-(assets|identicon|keyring|settings)(.*)$': '/packages/ui-$1/src/$2', + '@polkadot/react-(identicon|qr)(.*)$': '/packages/react-$1/src/$2', + '@polkadot/ui-(assets|keyring|settings)(.*)$': '/packages/ui-$1/src/$2', '\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': 'empty/object', '\\.(css|less)$': 'empty/object' } diff --git a/packages/ui-identicon/LICENSE b/packages/react-identicon/LICENSE similarity index 100% rename from packages/ui-identicon/LICENSE rename to packages/react-identicon/LICENSE diff --git a/packages/ui-identicon/README.md b/packages/react-identicon/README.md similarity index 84% rename from packages/ui-identicon/README.md rename to packages/react-identicon/README.md index 2c9c6448..4d6697d6 100644 --- a/packages/ui-identicon/README.md +++ b/packages/react-identicon/README.md @@ -1,15 +1,15 @@ -# @polkadot/ui-identicon +# @polkadot/react-identicon A generic identity icon that can render icons based on the theme, be it Substrate or Polkadot ## Usage Examples -To install the component, do `yarn add @polkadot/ui-identicon` +To install the component, do `yarn add @polkadot/react-identicon` Inside a React component, you can now render any account with the associated icon - ```javascript -import Identicon from '@polkadot/ui-identicon'; +import Identicon from '@polkadot/react-identicon'; ... render () { diff --git a/packages/ui-identicon/demo.png b/packages/react-identicon/demo.png similarity index 100% rename from packages/ui-identicon/demo.png rename to packages/react-identicon/demo.png diff --git a/packages/ui-identicon/index.html b/packages/react-identicon/index.html similarity index 100% rename from packages/ui-identicon/index.html rename to packages/react-identicon/index.html diff --git a/packages/ui-identicon/package.json b/packages/react-identicon/package.json similarity index 95% rename from packages/ui-identicon/package.json rename to packages/react-identicon/package.json index 4ee24379..a9348a27 100644 --- a/packages/ui-identicon/package.json +++ b/packages/react-identicon/package.json @@ -1,5 +1,5 @@ { - "name": "@polkadot/ui-identicon", + "name": "@polkadot/react-identicon", "version": "0.42.0-beta.18", "description": "Renders an SVG picture representing an address", "main": "index.js", diff --git a/packages/ui-identicon/src/Demo.tsx b/packages/react-identicon/src/Demo.tsx similarity index 92% rename from packages/ui-identicon/src/Demo.tsx rename to packages/react-identicon/src/Demo.tsx index 5523e4a8..e4bc6595 100644 --- a/packages/ui-identicon/src/Demo.tsx +++ b/packages/react-identicon/src/Demo.tsx @@ -1,4 +1,4 @@ -// Copyright 2017-2019 @polkadot/ui-identicon authors & contributors +// Copyright 2017-2019 @polkadot/react-identicon authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. diff --git a/packages/ui-identicon/src/Identicon.tsx b/packages/react-identicon/src/Identicon.tsx similarity index 97% rename from packages/ui-identicon/src/Identicon.tsx rename to packages/react-identicon/src/Identicon.tsx index 12ab0b51..b65b8eb7 100644 --- a/packages/ui-identicon/src/Identicon.tsx +++ b/packages/react-identicon/src/Identicon.tsx @@ -1,4 +1,4 @@ -// Copyright 2017-2019 @polkadot/ui-identicon authors & contributors +// Copyright 2017-2019 @polkadot/react-identicon authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. diff --git a/packages/ui-identicon/src/beachball/LICENSE b/packages/react-identicon/src/beachball/LICENSE similarity index 91% rename from packages/ui-identicon/src/beachball/LICENSE rename to packages/react-identicon/src/beachball/LICENSE index d5108607..6255b215 100644 --- a/packages/ui-identicon/src/beachball/LICENSE +++ b/packages/react-identicon/src/beachball/LICENSE @@ -1,7 +1,7 @@ Apache-2.0 License (Apache-2.0) Copyright 2016 Dan Finlay -Copyright 2017-2019 @polkadot/ui-identicon authors & contributors +Copyright 2017-2019 @polkadot/react-identicon authors & contributors Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above diff --git a/packages/ui-identicon/src/beachball/README.md b/packages/react-identicon/src/beachball/README.md similarity index 92% rename from packages/ui-identicon/src/beachball/README.md rename to packages/react-identicon/src/beachball/README.md index d93ca9e9..e00ebd04 100644 --- a/packages/ui-identicon/src/beachball/README.md +++ b/packages/react-identicon/src/beachball/README.md @@ -1,4 +1,4 @@ -# @polkadot/ui-identicon/beachball +# @polkadot/react-identicon/beachball Adapted from [Jazzicon](https://github.com/danfinlay/jazzicon) by Dan Finlay with the following changes - @@ -16,4 +16,4 @@ Adapted from [Jazzicon](https://github.com/danfinlay/jazzicon) by Dan Finlay wit Also see [src/demo.js](src/demo.js) for a randomly generated example. -![demo](https://raw.githubusercontent.com/polkadot-js/ui/master/packages/ui-identicon/demo.png) +![demo](https://raw.githubusercontent.com/polkadot-js/ui/master/packages/react-identicon/demo.png) diff --git a/packages/ui-identicon/src/beachball/colors.spec.ts b/packages/react-identicon/src/beachball/colors.spec.ts similarity index 94% rename from packages/ui-identicon/src/beachball/colors.spec.ts rename to packages/react-identicon/src/beachball/colors.spec.ts index 2b94b081..8ee4cb45 100644 --- a/packages/ui-identicon/src/beachball/colors.spec.ts +++ b/packages/react-identicon/src/beachball/colors.spec.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2019 @polkadot/ui-identicon authors & contributors +// Copyright 2017-2019 @polkadot/react-identicon authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. diff --git a/packages/ui-identicon/src/beachball/colors.ts b/packages/react-identicon/src/beachball/colors.ts similarity index 90% rename from packages/ui-identicon/src/beachball/colors.ts rename to packages/react-identicon/src/beachball/colors.ts index 34eb98fa..b61a3ef0 100644 --- a/packages/ui-identicon/src/beachball/colors.ts +++ b/packages/react-identicon/src/beachball/colors.ts @@ -1,5 +1,5 @@ // Copyright 2016 Dan Finlay -// Copyright 2017-2019 @polkadot/ui-identicon authors & contributors +// Copyright 2017-2019 @polkadot/react-identicon authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. diff --git a/packages/ui-identicon/src/beachball/container.spec.ts b/packages/react-identicon/src/beachball/container.spec.ts similarity index 94% rename from packages/ui-identicon/src/beachball/container.spec.ts rename to packages/react-identicon/src/beachball/container.spec.ts index e003d281..3db6426c 100644 --- a/packages/ui-identicon/src/beachball/container.spec.ts +++ b/packages/react-identicon/src/beachball/container.spec.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2019 @polkadot/ui-identicon authors & contributors +// Copyright 2017-2019 @polkadot/react-identicon authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. diff --git a/packages/ui-identicon/src/beachball/container.ts b/packages/react-identicon/src/beachball/container.ts similarity index 92% rename from packages/ui-identicon/src/beachball/container.ts rename to packages/react-identicon/src/beachball/container.ts index 6d39a350..2d31aa58 100644 --- a/packages/ui-identicon/src/beachball/container.ts +++ b/packages/react-identicon/src/beachball/container.ts @@ -1,5 +1,5 @@ // Copyright 2016 Dan Finlay -// Copyright 2017-2019 @polkadot/ui-identicon authors & contributors +// Copyright 2017-2019 @polkadot/react-identicon authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. diff --git a/packages/ui-identicon/src/beachball/defaults.ts b/packages/react-identicon/src/beachball/defaults.ts similarity index 85% rename from packages/ui-identicon/src/beachball/defaults.ts rename to packages/react-identicon/src/beachball/defaults.ts index a14f8ebc..12c81479 100644 --- a/packages/ui-identicon/src/beachball/defaults.ts +++ b/packages/react-identicon/src/beachball/defaults.ts @@ -1,5 +1,5 @@ // Copyright 2016 Dan Finlay -// Copyright 2017-2019 @polkadot/ui-identicon authors & contributors +// Copyright 2017-2019 @polkadot/react-identicon authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. diff --git a/packages/ui-identicon/src/beachball/demo.ts b/packages/react-identicon/src/beachball/demo.ts similarity index 92% rename from packages/ui-identicon/src/beachball/demo.ts rename to packages/react-identicon/src/beachball/demo.ts index 3247cb58..824df742 100644 --- a/packages/ui-identicon/src/beachball/demo.ts +++ b/packages/react-identicon/src/beachball/demo.ts @@ -1,5 +1,5 @@ // Copyright 2016 Dan Finlay -// Copyright 2017-2019 @polkadot/ui-identicon authors & contributors +// Copyright 2017-2019 @polkadot/react-identicon authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. diff --git a/packages/ui-identicon/src/beachball/index.spec.ts b/packages/react-identicon/src/beachball/index.spec.ts similarity index 96% rename from packages/ui-identicon/src/beachball/index.spec.ts rename to packages/react-identicon/src/beachball/index.spec.ts index 4e2064b0..0ca1ac11 100644 --- a/packages/ui-identicon/src/beachball/index.spec.ts +++ b/packages/react-identicon/src/beachball/index.spec.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2019 @polkadot/ui-identicon authors & contributors +// Copyright 2017-2019 @polkadot/react-identicon authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. diff --git a/packages/ui-identicon/src/beachball/index.ts b/packages/react-identicon/src/beachball/index.ts similarity index 93% rename from packages/ui-identicon/src/beachball/index.ts rename to packages/react-identicon/src/beachball/index.ts index 88be3c63..0803eac2 100644 --- a/packages/ui-identicon/src/beachball/index.ts +++ b/packages/react-identicon/src/beachball/index.ts @@ -1,5 +1,5 @@ // Copyright 2016 Dan Finlay -// Copyright 2017-2019 @polkadot/ui-identicon authors & contributors +// Copyright 2017-2019 @polkadot/react-identicon authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. diff --git a/packages/ui-identicon/src/beachball/seeder.spec.ts b/packages/react-identicon/src/beachball/seeder.spec.ts similarity index 89% rename from packages/ui-identicon/src/beachball/seeder.spec.ts rename to packages/react-identicon/src/beachball/seeder.spec.ts index 5be73f15..acf60568 100644 --- a/packages/ui-identicon/src/beachball/seeder.spec.ts +++ b/packages/react-identicon/src/beachball/seeder.spec.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2019 @polkadot/ui-identicon authors & contributors +// Copyright 2017-2019 @polkadot/react-identicon authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. diff --git a/packages/ui-identicon/src/beachball/seeder.ts b/packages/react-identicon/src/beachball/seeder.ts similarity index 90% rename from packages/ui-identicon/src/beachball/seeder.ts rename to packages/react-identicon/src/beachball/seeder.ts index ff41207a..4f415437 100644 --- a/packages/ui-identicon/src/beachball/seeder.ts +++ b/packages/react-identicon/src/beachball/seeder.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2019 @polkadot/ui-identicon authors & contributors +// Copyright 2017-2019 @polkadot/react-identicon authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. diff --git a/packages/ui-identicon/src/beachball/shape/circle.spec.ts b/packages/react-identicon/src/beachball/shape/circle.spec.ts similarity index 87% rename from packages/ui-identicon/src/beachball/shape/circle.spec.ts rename to packages/react-identicon/src/beachball/shape/circle.spec.ts index fa0027f5..3a0c2092 100644 --- a/packages/ui-identicon/src/beachball/shape/circle.spec.ts +++ b/packages/react-identicon/src/beachball/shape/circle.spec.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2019 @polkadot/ui-identicon authors & contributors +// Copyright 2017-2019 @polkadot/react-identicon authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. diff --git a/packages/ui-identicon/src/beachball/shape/circle.ts b/packages/react-identicon/src/beachball/shape/circle.ts similarity index 91% rename from packages/ui-identicon/src/beachball/shape/circle.ts rename to packages/react-identicon/src/beachball/shape/circle.ts index d6990c4f..753ff668 100644 --- a/packages/ui-identicon/src/beachball/shape/circle.ts +++ b/packages/react-identicon/src/beachball/shape/circle.ts @@ -1,5 +1,5 @@ // Copyright 2016 Dan Finlay -// Copyright 2017-2019 @polkadot/ui-identicon authors & contributors +// Copyright 2017-2019 @polkadot/react-identicon authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. diff --git a/packages/ui-identicon/src/beachball/shape/square.ts b/packages/react-identicon/src/beachball/shape/square.ts similarity index 93% rename from packages/ui-identicon/src/beachball/shape/square.ts rename to packages/react-identicon/src/beachball/shape/square.ts index 058c022b..d68f4174 100644 --- a/packages/ui-identicon/src/beachball/shape/square.ts +++ b/packages/react-identicon/src/beachball/shape/square.ts @@ -1,5 +1,5 @@ // Copyright 2016 Dan Finlay -// Copyright 2017-2019 @polkadot/ui-identicon authors & contributors +// Copyright 2017-2019 @polkadot/react-identicon authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. diff --git a/packages/ui-identicon/src/beachball/svg/circle.spec.ts b/packages/react-identicon/src/beachball/svg/circle.spec.ts similarity index 86% rename from packages/ui-identicon/src/beachball/svg/circle.spec.ts rename to packages/react-identicon/src/beachball/svg/circle.spec.ts index 896dc77f..1d37f380 100644 --- a/packages/ui-identicon/src/beachball/svg/circle.spec.ts +++ b/packages/react-identicon/src/beachball/svg/circle.spec.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2019 @polkadot/ui-identicon authors & contributors +// Copyright 2017-2019 @polkadot/react-identicon authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. diff --git a/packages/ui-identicon/src/beachball/svg/circle.ts b/packages/react-identicon/src/beachball/svg/circle.ts similarity index 85% rename from packages/ui-identicon/src/beachball/svg/circle.ts rename to packages/react-identicon/src/beachball/svg/circle.ts index e5e8f8b8..18b2bafa 100644 --- a/packages/ui-identicon/src/beachball/svg/circle.ts +++ b/packages/react-identicon/src/beachball/svg/circle.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2019 @polkadot/ui-identicon authors & contributors +// Copyright 2017-2019 @polkadot/react-identicon authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. diff --git a/packages/ui-identicon/src/beachball/svg/element.spec.ts b/packages/react-identicon/src/beachball/svg/element.spec.ts similarity index 86% rename from packages/ui-identicon/src/beachball/svg/element.spec.ts rename to packages/react-identicon/src/beachball/svg/element.spec.ts index 1fb204a8..5aded045 100644 --- a/packages/ui-identicon/src/beachball/svg/element.spec.ts +++ b/packages/react-identicon/src/beachball/svg/element.spec.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2019 @polkadot/ui-identicon authors & contributors +// Copyright 2017-2019 @polkadot/react-identicon authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. diff --git a/packages/ui-identicon/src/beachball/svg/element.ts b/packages/react-identicon/src/beachball/svg/element.ts similarity index 87% rename from packages/ui-identicon/src/beachball/svg/element.ts rename to packages/react-identicon/src/beachball/svg/element.ts index ba084ead..20a8f545 100644 --- a/packages/ui-identicon/src/beachball/svg/element.ts +++ b/packages/react-identicon/src/beachball/svg/element.ts @@ -1,5 +1,5 @@ // Copyright 2016 Dan Finlay -// Copyright 2017-2019 @polkadot/ui-identicon authors & contributors +// Copyright 2017-2019 @polkadot/react-identicon authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. diff --git a/packages/ui-identicon/src/beachball/svg/rect.spec.ts b/packages/react-identicon/src/beachball/svg/rect.spec.ts similarity index 87% rename from packages/ui-identicon/src/beachball/svg/rect.spec.ts rename to packages/react-identicon/src/beachball/svg/rect.spec.ts index 9c5b5eba..be94d2b4 100644 --- a/packages/ui-identicon/src/beachball/svg/rect.spec.ts +++ b/packages/react-identicon/src/beachball/svg/rect.spec.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2019 @polkadot/ui-identicon authors & contributors +// Copyright 2017-2019 @polkadot/react-identicon authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. diff --git a/packages/ui-identicon/src/beachball/svg/rect.ts b/packages/react-identicon/src/beachball/svg/rect.ts similarity index 84% rename from packages/ui-identicon/src/beachball/svg/rect.ts rename to packages/react-identicon/src/beachball/svg/rect.ts index 07b52fa6..bbb21da0 100644 --- a/packages/ui-identicon/src/beachball/svg/rect.ts +++ b/packages/react-identicon/src/beachball/svg/rect.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2019 @polkadot/ui-identicon authors & contributors +// Copyright 2017-2019 @polkadot/react-identicon authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. diff --git a/packages/ui-identicon/src/beachball/svg/svg.spec.ts b/packages/react-identicon/src/beachball/svg/svg.spec.ts similarity index 85% rename from packages/ui-identicon/src/beachball/svg/svg.spec.ts rename to packages/react-identicon/src/beachball/svg/svg.spec.ts index df28b130..11af9a25 100644 --- a/packages/ui-identicon/src/beachball/svg/svg.spec.ts +++ b/packages/react-identicon/src/beachball/svg/svg.spec.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2019 @polkadot/ui-identicon authors & contributors +// Copyright 2017-2019 @polkadot/react-identicon authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. diff --git a/packages/ui-identicon/src/beachball/svg/svg.ts b/packages/react-identicon/src/beachball/svg/svg.ts similarity index 81% rename from packages/ui-identicon/src/beachball/svg/svg.ts rename to packages/react-identicon/src/beachball/svg/svg.ts index 7e4d8895..d16b5d3c 100644 --- a/packages/ui-identicon/src/beachball/svg/svg.ts +++ b/packages/react-identicon/src/beachball/svg/svg.ts @@ -1,5 +1,5 @@ // Copyright 2016 Dan Finlay -// Copyright 2017-2019 @polkadot/ui-identicon authors & contributors +// Copyright 2017-2019 @polkadot/react-identicon authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. diff --git a/packages/ui-identicon/src/beachball/types.ts b/packages/react-identicon/src/beachball/types.ts similarity index 75% rename from packages/ui-identicon/src/beachball/types.ts rename to packages/react-identicon/src/beachball/types.ts index 60701403..0fa6022c 100644 --- a/packages/ui-identicon/src/beachball/types.ts +++ b/packages/react-identicon/src/beachball/types.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2019 @polkadot/ui-identicon authors & contributors +// Copyright 2017-2019 @polkadot/react-identicon authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. diff --git a/packages/ui-identicon/src/beachball/xmlserializer.d.ts b/packages/react-identicon/src/beachball/xmlserializer.d.ts similarity index 69% rename from packages/ui-identicon/src/beachball/xmlserializer.d.ts rename to packages/react-identicon/src/beachball/xmlserializer.d.ts index da1ce8d1..4d09f73d 100644 --- a/packages/ui-identicon/src/beachball/xmlserializer.d.ts +++ b/packages/react-identicon/src/beachball/xmlserializer.d.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2019 @polkadot/ui-identicon authors & contributors +// Copyright 2017-2019 @polkadot/react-identicon authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. diff --git a/packages/ui-identicon/src/icons/Beachball.tsx b/packages/react-identicon/src/icons/Beachball.tsx similarity index 90% rename from packages/ui-identicon/src/icons/Beachball.tsx rename to packages/react-identicon/src/icons/Beachball.tsx index f2a63ef0..ee992d18 100644 --- a/packages/ui-identicon/src/icons/Beachball.tsx +++ b/packages/react-identicon/src/icons/Beachball.tsx @@ -1,4 +1,4 @@ -// Copyright 2017-2019 @polkadot/ui-identicon authors & contributors +// Copyright 2017-2019 @polkadot/react-identicon authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. diff --git a/packages/ui-identicon/src/icons/Empty.tsx b/packages/react-identicon/src/icons/Empty.tsx similarity index 88% rename from packages/ui-identicon/src/icons/Empty.tsx rename to packages/react-identicon/src/icons/Empty.tsx index 74700fb4..2b865874 100644 --- a/packages/ui-identicon/src/icons/Empty.tsx +++ b/packages/react-identicon/src/icons/Empty.tsx @@ -1,4 +1,4 @@ -// Copyright 2017-2019 @polkadot/ui-identicon authors & contributors +// Copyright 2017-2019 @polkadot/react-identicon authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. diff --git a/packages/ui-identicon/src/icons/Jdenticon.tsx b/packages/react-identicon/src/icons/Jdenticon.tsx similarity index 89% rename from packages/ui-identicon/src/icons/Jdenticon.tsx rename to packages/react-identicon/src/icons/Jdenticon.tsx index 72e20431..b77cef07 100644 --- a/packages/ui-identicon/src/icons/Jdenticon.tsx +++ b/packages/react-identicon/src/icons/Jdenticon.tsx @@ -1,4 +1,4 @@ -// Copyright 2017-2019 @polkadot/ui-identicon authors & contributors +// Copyright 2017-2019 @polkadot/react-identicon authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. diff --git a/packages/ui-identicon/src/icons/Polkadot.tsx b/packages/react-identicon/src/icons/Polkadot.tsx similarity index 98% rename from packages/ui-identicon/src/icons/Polkadot.tsx rename to packages/react-identicon/src/icons/Polkadot.tsx index c8da7efd..861e0aeb 100644 --- a/packages/ui-identicon/src/icons/Polkadot.tsx +++ b/packages/react-identicon/src/icons/Polkadot.tsx @@ -1,5 +1,5 @@ // Copyright 2018 Paritytech via paritytech/oo7/polkadot-identicon -// Copyright 2018 @polkadot/ui-identicon authors & contributors +// Copyright 2018 @polkadot/react-identicon authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. diff --git a/packages/ui-identicon/src/icons/index.ts b/packages/react-identicon/src/icons/index.ts similarity index 82% rename from packages/ui-identicon/src/icons/index.ts rename to packages/react-identicon/src/icons/index.ts index b8aaa71d..e7b3c516 100644 --- a/packages/ui-identicon/src/icons/index.ts +++ b/packages/react-identicon/src/icons/index.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2019 @polkadot/ui-identicon authors & contributors +// Copyright 2017-2019 @polkadot/react-identicon authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. diff --git a/packages/ui-identicon/src/index.ts b/packages/react-identicon/src/index.ts similarity index 75% rename from packages/ui-identicon/src/index.ts rename to packages/react-identicon/src/index.ts index 44c4e07d..d0269426 100644 --- a/packages/ui-identicon/src/index.ts +++ b/packages/react-identicon/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2019 @polkadot/ui-identicon authors & contributors +// Copyright 2017-2019 @polkadot/react-identicon authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. diff --git a/packages/ui-identicon/src/types.ts b/packages/react-identicon/src/types.ts similarity index 91% rename from packages/ui-identicon/src/types.ts rename to packages/react-identicon/src/types.ts index 90edbe5b..61fa36cb 100644 --- a/packages/ui-identicon/src/types.ts +++ b/packages/react-identicon/src/types.ts @@ -1,4 +1,4 @@ -// Copyright 2018 @polkadot/ui-identicon authors & contributors +// Copyright 2018 @polkadot/react-identicon authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. diff --git a/packages/ui-identicon/webpack.config.js b/packages/react-identicon/webpack.config.js similarity index 92% rename from packages/ui-identicon/webpack.config.js rename to packages/react-identicon/webpack.config.js index 29610687..fd5bf4a5 100644 --- a/packages/ui-identicon/webpack.config.js +++ b/packages/react-identicon/webpack.config.js @@ -1,4 +1,4 @@ -// Copyright 2017-2019 @polkadot/ui-identicon authors & contributors +// Copyright 2017-2019 @polkadot/react-identicon authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. diff --git a/packages/react-qr/README.md b/packages/react-qr/README.md index 93f01f39..4d34b9cf 100644 --- a/packages/react-qr/README.md +++ b/packages/react-qr/README.md @@ -1,3 +1,3 @@ # @polkadot/react-qr -A Qr-code component that allows for the transfer of addresses and transaction payloads to and from external readers +A Qr-code component that allows for the transfer of addresses and transaction payloads to and from external readers. It implements the [Universal Offline Signatures](https://github.com/maciejhirsz/uos) specification to read and generated QR codes. diff --git a/packages/react-qr/src/Display.tsx b/packages/react-qr/src/Display.tsx index 4127ea8e..9fadeeec 100644 --- a/packages/react-qr/src/Display.tsx +++ b/packages/react-qr/src/Display.tsx @@ -23,7 +23,7 @@ interface State { frames: string[]; frameIdx: number; image: string | null; - timerId: NodeJS.Timeout | null; + timerId: number | null; valueHash: string | null; } @@ -90,7 +90,7 @@ class Display extends React.PureComponent { public componentDidMount (): void { this.setState({ - timerId: setInterval(this.nextFrame, FRAME_DELAY) + timerId: window.setInterval(this.nextFrame, FRAME_DELAY) }); } diff --git a/packages/react-qr/src/DisplayAddress.tsx b/packages/react-qr/src/DisplayAddress.tsx index 801a8c64..05f5d20c 100644 --- a/packages/react-qr/src/DisplayAddress.tsx +++ b/packages/react-qr/src/DisplayAddress.tsx @@ -29,7 +29,7 @@ export default class DisplayExtrinsic extends React.PureComponent dataHash: null }; - public getDerivedStateFromProps ({ address }: Props, prevState: State): State | null { + public static getDerivedStateFromProps ({ address }: Props, prevState: State): State | null { const data = u8aConcat( PREFIX, encodeString(address) diff --git a/packages/react-qr/src/DisplayPayload.tsx b/packages/react-qr/src/DisplayPayload.tsx index e8a9d817..613c9432 100644 --- a/packages/react-qr/src/DisplayPayload.tsx +++ b/packages/react-qr/src/DisplayPayload.tsx @@ -30,7 +30,7 @@ export default class DisplayPayload extends React.PureComponent { dataHash: null }; - public getDerivedStateFromProps ({ address, payload }: Props, prevState: State): State | null { + public static getDerivedStateFromProps ({ address, payload }: Props, prevState: State): State | null { const data = u8aConcat( SUBSTRATE, CRYPTO_SR25519, diff --git a/packages/ui-keyring/src/options/KeyPair.tsx b/packages/ui-keyring/src/options/KeyPair.tsx index ac10d961..88d7252b 100644 --- a/packages/ui-keyring/src/options/KeyPair.tsx +++ b/packages/ui-keyring/src/options/KeyPair.tsx @@ -4,7 +4,7 @@ import React from 'react'; import styled from 'styled-components'; -import IdentityIcon from '@polkadot/ui-identicon'; +import IdentityIcon from '@polkadot/react-identicon'; interface Props { address: string; diff --git a/tsconfig.json b/tsconfig.json index 3df95ef2..d173dbb9 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,12 +3,12 @@ "compilerOptions": { "baseUrl": ".", "paths": { + "@polkadot/react-identicon": [ "packages/react-identicon/src" ], + "@polkadot/react-identicon/*": [ "packages/react-identicon/src/*" ], "@polkadot/react-qr": [ "packages/react-qr/src" ], "@polkadot/react-qr/*": [ "packages/react-qr/src/*" ], "@polkadot/ui-assets": [ "packages/ui-assets/src" ], "@polkadot/ui-assets/*": [ "packages/ui-assets/src/*" ], - "@polkadot/ui-identicon": [ "packages/ui-identicon/src" ], - "@polkadot/ui-identicon/*": [ "packages/ui-identicon/src/*" ], "@polkadot/ui-keyring": [ "packages/ui-keyring/src" ], "@polkadot/ui-keyring/*": [ "packages/ui-keyring/src/*" ], "@polkadot/ui-settings": [ "packages/ui-settings/src" ],