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

metronome-wallet-ui-logic

v3.5.2

Published

UI logic to develop an Ethereum Metronome wallet with React and Redux

Downloads

25

Readme

metronome-wallet-ui-logic

This package contains common elements required to develop the UI of an Ethereum Metronome wallet with React and Redux on different platforms.

The intent behind all this is that for each platform we only have to build:

  1. a client implementing platform-specific functionality (such as storage), and
  2. the view rendering code.

Everything else should be abstracted in this package and metronome-wallet-core, which takes care of core wallet logic.

Supported target environments are Electron, React Native and web.

Contents

These are the common elements intended to be directly imported by different platform implementations:

src/components

React components that can be reused across different platforms because they don't rely on platform-specific elements.

These include:

  • <Root />
  • <TermsAndConditions />

Check src/components

Example usage:

import React from 'react'
import Root from 'metronome-wallet-ui-logic/components/Root'

import Onboarding from './components/Onboarding'
import Loading from './components/Loading'
import Router from './components/Router'
import Login from './components/Login'

...

class MyComponent extends React.Component {
  ...

  render() {
    return (
      <Root
        OnboardingComponent={Onboarding}
        LoadingComponent={Loading}
        RouterComponent={Router}
        LoginComponent={Login}
      />
    )
  }
}

src/hocs

Functions that follow the Higher-Order Component pattern. These functions encapsulate all the common UI logic and Redux store mappings and inject useful props to the composed components.

Check src/hocs

Example usage:

import withAuctionState from 'metronome-wallet-ui-logic/hocs/withAuctionState'
import React from 'react'

const Auction = props => {

  // These props are injected by withAuctionState() higher-order component
  const {
    countdownTargetTimestamp,
    buyDisabledReason,
    auctionPriceUSD,
    auctionStatus,
    buyDisabled,
    navigation,
    title
  } = props

  return (
    // Platform-specific code here...
  )
}

export default withAuctionState(Auction)

src/store

This module exports a createStore(reduxDevtoolsOptions, initialState) function and a Redux <Provider /> component.

Check src/store/index.js

Example usage:

import { Provider as ClientProvider } from 'metronome-wallet-ui-logic/hocs/clientContext'
import { createStore, Provider } from 'metronome-wallet-ui-logic/store'
import React from 'react'

import createClient from './client'
import config from './config'

const client = createClient(config, createStore)

class App extends React.Component {
  render() {
    return (
      <ClientProvider value={client}>
        <Provider store={client.store}>
          {/* App's Root component goes here... */}
        </Provider>
      </ClientProvider>
    )
  }
}

src/utils

Miscelaneous helper functions.

Check src/utils/index.js

src/theme

This is an object containing theme constants such as colors and font sizes to be used for component styles.

Check src/theme/index.js

Other (not intended to be directly imported)

src/validators

Form data validators used by hocs.

src/selectors

reselect memoized store selectors. Used by hocs.

src/reducers

Redux reducers, used by store.

License

MIT