@metamask/design-system-react-native
Version:
26 lines • 1.31 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Jazzicon = void 0;
const design_system_shared_1 = require("@metamask/design-system-shared");
const react_1 = __importDefault(require("react"));
const react_native_1 = require("react-native/index.js");
const react_native_jazzicon_1 = __importDefault(require("react-native-jazzicon"));
const Jazzicon = ({ testID, address, ...props }) => {
// Extract the account address from CAIP-10 format if needed
const accountAddress = address ? (0, design_system_shared_1.extractAccountAddress)(address) : '';
// Generate appropriate seed based on address format (matches MetaMask Mobile)
const seed = (0, design_system_shared_1.generateIconSeed)(accountAddress);
return (<react_native_1.View testID={testID}>
<react_native_jazzicon_1.default {...props}
// @ts-expect-error The underlying PRNG supports the seed being an array but the component is typed wrong.
seed={seed} containerStyle={{
borderRadius: 0,
...props.containerStyle,
}}/>
</react_native_1.View>);
};
exports.Jazzicon = Jazzicon;
//# sourceMappingURL=Jazzicon.cjs.map