Created
March 4, 2020 12:06
-
-
Save jimmychu0807/d88ba3e87bc2e0ad49b269772bab99a0 to your computer and use it in GitHub Desktop.
Markdium-用 Substrate Front-end Template 輕鬆打造你的 React 應用
This file contains 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