mirror of
https://github.com/pezkuwichain/pezkuwi-ui.git
synced 2026-04-30 02:38:00 +00:00
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
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
// 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.
|
||||
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import { encodeAddress, randomAsU8a } from '@polkadot/util-crypto';
|
||||
|
||||
import IdentityIcon from '.';
|
||||
|
||||
export default class Demo extends React.PureComponent {
|
||||
public render (): React.ReactNode {
|
||||
const identities: string[] = [];
|
||||
|
||||
while (identities.length !== 50) {
|
||||
identities.push(
|
||||
encodeAddress(randomAsU8a(32))
|
||||
);
|
||||
}
|
||||
|
||||
return identities.map((value): React.ReactNode => (
|
||||
<IdentityIcon
|
||||
key={value.toString()}
|
||||
theme='jdenticon'
|
||||
value={value}
|
||||
/>
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
const rootElement = document.getElementById('demo');
|
||||
|
||||
if (!rootElement) {
|
||||
throw new Error(`Unable to find element with id 'demo'`);
|
||||
}
|
||||
|
||||
ReactDOM.render(<Demo />, rootElement);
|
||||
Reference in New Issue
Block a user