npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-native-metamask-phrase-backup

v1.0.3

Published

This is a component for phrase backup based on Metamask Wallet App.

Downloads

7

Readme

react-native-metamask-phrase-backup

A simple and fully customizable React Native component that implements a metamask phrase backup.

  • Fully customizable buttons and display selected value area

Metamask UI Example
:-------------------------:

React Native Metamask Phrase Backup Example | React Native Metamask Phrase Backup Example | React Native Metamask Phrase Backup Example :-------------------------:|:-------------------------:|:-------------------------: | |

Installation

If using yarn:

yarn add react-native-metamask-phrase-backup

If using npm:

npm i react-native-metamask-phrase-backup

Usage

import { PhraseBackup } from 'react-native-metamask-phrase-backup';

Simply place a <PhraseBackup /> tag.

<View style={{flex: 1}}>
  <PhraseBackup data={data} onChange={onChangeSelectedValue}/>
</View>

Cusomize Display Selected Area

Cusomize display selected area is fully customizable using the isHaveDisplayValue, value props.

const data = ['relationship', 'thanksgiving', 'professional', 'organization', 'sporadically', 'intimidating', 'abolitionist', 'onomatopoeia', 'appreciation', 'annunciation', 'malnutrition', 'architecture'];
const [displayArr, setDisplayArr] = useState(Array.from({ length: 12 }, (_, i) => i + 1));
const [value, setValue] = useState(null);
const handleSelect = (value) => {
  setDisplayArr(value);
}

const result = () => {
  Alert.alert(
    'Complete Phrase Backup',
    displayArr.toString().replaceAll(',', ', '),
    [
      { text: 'Done' },
    ],
  )
}

return <View style={styles.container}>
  <Text style={[styles.description, { fontSize: 20 }]}>React Native Metamask Phrase Word Example</Text>
  <Text style={styles.description}>Select each word in the order it was presented to you.</Text>
  <View style={{ flexDirection: 'row', justifyContent: 'center', alignItems: 'center', flexWrap: 'wrap', marginBottom: 30 }}>
    {displayArr.map((item, index) => (
      <View key={index} style={[styles.displayItemContainer]}>
        <Text style={{ marginRight: 3 }}>{index + 1}.</Text>
        <TouchableOpacity
          style={typeof item === 'string' ? styles.displaySelectedButton : styles.displayButton}
          onPress={() => typeof item === 'string' && setValue(item)}
        >
          <Text style={styles.buttonText}>{typeof item === 'string' && item}</Text>
        </TouchableOpacity>
      </View>
    ))}
  </View>
  <PhraseBackup isHaveDisplayValue={false} data={data} seeds={12} onChange={handleSelect} value={value}/>
  <TouchableOpacity style={{ width: 320, height: 40, borderWidth: 1, borderColor: '#000', borderRadius: 18, marginTop: 20, alignItems: 'center', justifyContent: 'center' }} onPress={result}>
    <Text style={{ fontWeight: '500' }}>Complete Backup</Text>
  </TouchableOpacity>
</View>;

Documentation

Changelog

Version 1.0.2

  • Allow show/hide display selected area and you can customize that area.
  • Update README.md

Phrase Backup Component

| Name | Description | Default | Type | |---------------------------|------------------------------------------|-------------|---------| | data | The data of phrase backup string | REQUIRED | Array | | seeds | Total of phrase backup words | 12 | number | | value | Just need value when you hide display selected area isHaveDisplayValue = false | OPTIONAL | string | | isHaveDisplayValue | Show/Hide display seletected area, when you want to custom your display area | TRUE | boolean | | onChange | To get the selected string array | null | function | | containerStyle | The wrapper style of component | null | Object | | displaySelectedWrapperStyle | Style applied to the wrapper display seletected container | null | Object | | displaySelectedStyle | Style applied to the display seletected container | null | Object | | displaySelectedItemRowStyle | Style applied to the display selected item row | null | Object | | displaySelectedButtonStyle | Style applied to the display selected button container | null | Object | | displayButtonTextStyle | Style applied to the display selected button text | null | Object | | selectedButtonStyle | Style applied to the selected button container | null | Object | | buttonTextStyle | Style applied to the selected button text | null | Object |

Contributing

Pull requests are always welcome! Feel free to open a new GitHub issue for any changes that can be made.

Author

Huy Pham

License

MIT