Created
March 4, 2020 12:03
-
-
Save jimmychu0807/e3cdc569e7281ce33df4887d52089235 to your computer and use it in GitHub Desktop.
Markdium-用 Substrate Front-end Template 轻松打造你的 React 应用
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//... | |
import { SubstrateContextProvider, useSubstrate } from './substrate-lib'; | |
import { DeveloperConsole } from './substrate-lib/components'; | |
//... | |
function Main() { | |
const [accountAddress, setAccountAddress] = useState(null); | |
const { apiState, keyring, keyringState } = useSubstrate(); | |
const accountPair = | |
accountAddress && | |
keyringState === 'READY' && | |
keyring.getPair(accountAddress); | |
//... | |
return ( | |
) | |
} | |
export default function App () { | |
return ( | |
<SubstrateContextProvider> | |
<Main /> | |
</SubstrateContextProvider> | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment