0.42.0 • Published 2 months ago

@lidofinance/next-widget-layout v0.42.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

@lidofinance/next-widget-layout

Layout components: header, main, footer, etc.

Installation

  • React 17 || 18
  • Next 12 || 13
yarn add @lidofinance/next-widget-layout

# other packages 
yarn add styled-components@^5.3.5 @lidofinance/lido-ui@^3.7.3 @lidofinance/next-ui-primitives@^0.27.0

Getting started

Example for pages/_app.tsx:

import React, { FC } from 'react'
import NextApp, { AppProps } from 'next/app'
import { useWeb3 } from 'reef-knot/web3-react'

import { WalletButton, WalletConnectButton } from '@lidofinance/eth-ui-wallet-modal'
import { Header, Main, Footer, Layout, NavigationAdaptive, NavigationLink } from '@lidofinance/next-widget-layout'
import { Stake, Withdraw } from '@lidofinance/lido-ui'

const Navigation: FC = () => (
  <NavigationAdaptive>
    <NavigationLink title='Stake' href='/' icon={<Stake />} />
    <NavigationLink title='Withdrawals' href='/withdrawals' icon={<Withdraw />} />
  </NavigationAdaptive>
);

const HeaderActions: FC = () => {
  const { active } = useWeb3()
  return (
    <>
      {active ? <WalletButton /> : <WalletConnectButton size="sm" />}
    </>
  )
}

export const WidgetAppWrapper: FC<AppProps> = (props) => (
  <>
    <Layout>
      <Header headerActions={<HeaderActions />}>
        <Navigation />
      </Header>
      <Main>
        <NextApp {...props} />
      </Main>
      <Footer />
    </Layout>
  </>
)
0.42.0

2 months ago

0.41.0

2 months ago

0.40.0

3 months ago

0.39.1

5 months ago

0.39.0

7 months ago

0.38.0

8 months ago

0.37.1

8 months ago

0.37.0

8 months ago

0.36.0

9 months ago

0.35.0

9 months ago

0.34.0

9 months ago

0.33.0

10 months ago

0.32.0

10 months ago

0.31.0

10 months ago

0.30.0

10 months ago

0.29.0

10 months ago