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

@dcentralab/header

v1.3.34

Published

## Instalation ```shell npm install @dcentralab/web3-wc-modal @dcentralab/language-provider ``` or ```shell yarn add @dcentralab/web3-wc-modal @dcentralab/language-provider ```

Downloads

416

Readme

Header Component

Instalation

npm install @dcentralab/web3-wc-modal @dcentralab/language-provider

or

yarn add @dcentralab/web3-wc-modal @dcentralab/language-provider

Getting started

import { LangProvider } from '@dcentralab/language-provider';
import { Header } from '@dcentralab/header';
import { Web3WalletModal } from '@dcentralab/web3-wc-modal';
import emvProviders from '@dcentralab/evm-providers';
import cardanoProviders from '@dcentralab/cardano-providers';
import { NetworkSwitcherContextProvider } from '@dcentralab/wc-network-switcher'


<LangProvider enMessages={en} locales={locales} ref={lngRef}>
  <Header
    onCloseCallbackRef={ref}
    profileImage="https://hord-staging-users.s3.amazonaws.com/media/profile/4a4ece44-56dd-4e2a-8bc1-ba0b2d3d7e3b.jpg"
    links={links}
    menuLinks={menuLinks}
    mobileLinks={mobileLinks}
    sidebarLinks={sidebarLinks}
    sidebarAdditionalLinks={sidebarAdditionalLinks}
    sidebarBottomContent={<BottomContentElem />}
    isExpanded
    logo={{
      text: 'brandlogo',
      to: '/',
      // img: logo,
      img: <TokensFarmLogo />,
      imgWide: <TokensFarmLogoWide />,
    }}
    projectLogo={{
      text: 'projectlogo',
      href: 'https://projectlogo.com/',
      img: <Logo />,
    }}
    howToLink="https://google.com"
    networkSelectorProps={{
      networks,
      networkId,
      onNetworkSelect: handleNetChange,
      blockchainType,
      // account: '0x1b1872BE0f8685B234c487ECec406f7770ca63eD',
    }}
    onAuditsClicked={() => {}}
    defillamaLink="https://google.com"
    walletComponent={(
    <NetworkSwitcherContextProvider networks={appNetworks}>
      <Web3WalletModal
        rpcUrl={rpcUrl}
        networkId={networkId}
        pendingTx={0}
        onConnect={onConnect}
        onConnectError={onConnectError}
        onDisconnect={onDisconnect}
        onConnectRequest={onConnectRequest}
        autoConnectInPageProvider
        blockchainType={blockchainType}
        showBalance
        supportedWallets={[...evmProviders, ...cardanoProviders]}
        // supportedWallets={[MetaMaskConnector, ...cardanoProviders]}
        autoConnect
      />
    </NetworkSwitcherContextProvider>
    )}
  />
</LangProvider>

Props and Interfaces

interface ILogo {
  img: string | React.ReactNode
  imgWide?: string | React.ReactNode
  to?: string
  href?: string
  text?: string
  onClick?: () => void
}

type TVoidFunction = () => void;

export interface IBaseLink {
  id?: number | string
  text?: string
  className?: string
  to?: string
  icon?: string | React.ReactNode
  suffix?: string | React.ReactNode
  href?: string
  onClick?: (event: any) => void
  separator?: boolean
}
export interface ILink extends IBaseLink {
  items?: Array<IBaseLink>
}

interface IHeader {
  className?: string
  profileImage?: string
  logo: ILogo // app logo
  projectLogo: ILogo // for farm page
  links?: Array<ILink>
  sidebarLinks?: Array<ILink>
  sidebarAdditionalLinks?: Array<ILink>
  menuLinks?: Array<ILink>
  mobileLinks?: Array<ILink>
  networkSelectorProps?: INetworkSelector
  backButton?: React.ReactNode
  children?: React.ReactNode
  walletComponent?: React.ReactNode
  onCloseCallbackRef?: MutableRefObject<TVoidFunction>
  howToLink?: string
  defillamaLink?: string
  isExpanded?: boolean
  topContent?: JSX.Element | JSX.Element[]
  sidebarBottomContent?: JSX.Element | JSX.Element[]
  onToggleMenu?: (e?: boolean) => void,
  onAuditsClicked?: () => void,
}