mirror of
https://github.com/pezkuwichain/pezkuwi-ui.git
synced 2026-04-22 21:58:02 +00:00
@@ -8,25 +8,21 @@ import React from 'react';
|
||||
import { View } from 'react-native';
|
||||
import Svg, { Circle } from 'react-native-svg';
|
||||
|
||||
export default class Empty extends React.PureComponent<Props> {
|
||||
public render (): React.ReactNode {
|
||||
const { size } = this.props;
|
||||
|
||||
return (
|
||||
<View>
|
||||
<Svg
|
||||
height={size}
|
||||
viewBox='0 0 64 64'
|
||||
width={size}
|
||||
>
|
||||
<Circle
|
||||
cx='32'
|
||||
cy='32'
|
||||
r='32'
|
||||
fill='#eee'
|
||||
/>
|
||||
</Svg>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
export default function Empty ({ size }: Props): React.ReactElement<Props> {
|
||||
return (
|
||||
<View>
|
||||
<Svg
|
||||
height={size}
|
||||
viewBox='0 0 64 64'
|
||||
width={size}
|
||||
>
|
||||
<Circle
|
||||
cx='32'
|
||||
cy='32'
|
||||
r='32'
|
||||
fill='#eee'
|
||||
/>
|
||||
</Svg>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -13,33 +13,29 @@ interface Props extends BaseProps {
|
||||
sixPoint?: boolean;
|
||||
}
|
||||
|
||||
export default class Identicon extends React.PureComponent<Props> {
|
||||
public render (): React.ReactNode {
|
||||
const { address, sixPoint, size } = this.props;
|
||||
|
||||
return (
|
||||
<View>
|
||||
<Svg
|
||||
height={size}
|
||||
id={address}
|
||||
width={size}
|
||||
viewBox='0 0 64 64'
|
||||
>
|
||||
{generateIcon(address, sixPoint).map(this.renderCircle)}
|
||||
</Svg>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
private renderCircle = ({ cx, cy, r, fill }: CircleType, key: number): React.ReactNode => {
|
||||
return (
|
||||
<SvgCircle
|
||||
key={key}
|
||||
cx={cx}
|
||||
cy={cy}
|
||||
r={r}
|
||||
fill={fill}
|
||||
/>
|
||||
);
|
||||
}
|
||||
function renderCircle ({ cx, cy, r, fill }: CircleType, key: number): React.ReactNode {
|
||||
return (
|
||||
<SvgCircle
|
||||
key={key}
|
||||
cx={cx}
|
||||
cy={cy}
|
||||
r={r}
|
||||
fill={fill}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
export default function Identicon ({ address, sixPoint, size }: Props): React.ReactElement<Props> {
|
||||
return (
|
||||
<View>
|
||||
<Svg
|
||||
height={size}
|
||||
id={address}
|
||||
width={size}
|
||||
viewBox='0 0 64 64'
|
||||
>
|
||||
{generateIcon(address, sixPoint).map(renderCircle)}
|
||||
</Svg>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
// Copyright 2018 @polkadot/reactnative-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.
|
||||
|
||||
// NOTE This is not clean since we miss the proper RN typings. However it does
|
||||
// conflict with everything else, so... well, stick with the minimum here
|
||||
|
||||
declare module 'react-native' {
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
||||
interface GestureResponderHandlers {}
|
||||
type ImageProperties = Record<string, string>;
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
||||
interface ViewProperties {}
|
||||
|
||||
export const View: React.ComponentClass;
|
||||
}
|
||||
Reference in New Issue
Block a user