prep everything for wallet management

This commit is contained in:
Ilja 2022-02-03 14:15:54 +02:00
parent 6d9e902bbc
commit 5301fd10e4
7 changed files with 1378 additions and 11 deletions

View File

@ -8,13 +8,19 @@
"lint": "next lint"
},
"dependencies": {
"@walletconnect/client": "2.0.0-beta.22",
"@walletconnect/utils": "2.0.0-beta.22",
"@walletconnect/jsonrpc-utils": "1.0.0",
"@nextui-org/react": "1.0.2-beta.3",
"next": "12.0.10",
"react": "17.0.2",
"react-dom": "17.0.2"
"react-dom": "17.0.2",
"ethers": "5.5.4",
"keyvaluestorage": "0.7.1"
},
"devDependencies": {
"@types/node": "^17.0.14",
"@walletconnect/types": "2.0.0-beta.22",
"@types/node": "17.0.14",
"@types/react": "17.0.38",
"eslint": "8.8.0",
"eslint-config-next": "12.0.10",

View File

@ -0,0 +1,19 @@
import { Text } from '@nextui-org/react'
interface Props {
children: string
}
export default function PageHeader({ children }: Props) {
return (
<Text
h3
css={{
textGradient: '45deg, $cyan300 -30%, $green600 100%'
}}
weight="bold"
>
{children}
</Text>
)
}

View File

@ -0,0 +1,28 @@
import { createContext, ReactNode, useState } from 'react'
/**
* Types
*/
interface State {}
interface Props {
children: ReactNode | ReactNode[]
}
/**
* Context
*/
export const WalletContext = createContext<State>({})
/**
* Provider
*/
export function WalletContextProvider({ children }: Props) {
const [state, setState] = useState<State>({})
const actions = {
async initialise() {}
}
return <WalletContext.Provider value={{ state, actions }}>{children}</WalletContext.Provider>
}

View File

@ -1,4 +1,5 @@
import Layout from '@/components/Layout'
import { WalletContextProvider } from '@/contexts/WalletContext'
import { theme } from '@/utils/ThemeUtil'
import { NextUIProvider } from '@nextui-org/react'
import { AppProps } from 'next/app'
@ -6,9 +7,11 @@ import { AppProps } from 'next/app'
export default function App({ Component, pageProps }: AppProps) {
return (
<NextUIProvider theme={theme}>
<Layout>
<Component {...pageProps} />
</Layout>
<WalletContextProvider>
<Layout>
<Component {...pageProps} />
</Layout>
</WalletContextProvider>
</NextUIProvider>
)
}

View File

@ -1,3 +1,5 @@
import PageHeader from '@/components/PageHeader'
export default function HomePage() {
return <h1>Accounts</h1>
return <PageHeader>Accounts</PageHeader>
}

File diff suppressed because it is too large Load Diff