diff --git a/src/App.tsx b/src/App.tsx index 8749512066..c8d0ac5cc4 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -38,7 +38,7 @@ const App = () => { clientInstanceRef.current = clientInstance; const contractsRef = useRef(contracts); contractsRef.current = contracts; - const [themeType, setThemeType] = useState("dark") + const [themeType, setThemeType] = useState("dark"); useEffect(() => { console.log("Remix EthDoc loading..."); @@ -78,16 +78,15 @@ const App = () => { } ); - const currentTheme = await client.call("theme", "currentTheme") - console.log("Current theme", currentTheme) + const currentTheme = await client.call("theme", "currentTheme"); + console.log("Current theme", currentTheme); - setThemeType(currentTheme.brightness || currentTheme.quality) + setThemeType(currentTheme.brightness || currentTheme.quality); client.on("theme", "themeChanged", (theme: any) => { - console.log("themeChanged") - setThemeType(theme.quality) - }) - + console.log("themeChanged"); + setThemeType(theme.quality); + }); }; loadClient(); @@ -101,7 +100,7 @@ const App = () => { setContracts, sites, setSites, - themeType + themeType, }} > diff --git a/src/AppContext.tsx b/src/AppContext.tsx index 2d9685d694..b7acff6ad0 100644 --- a/src/AppContext.tsx +++ b/src/AppContext.tsx @@ -16,5 +16,5 @@ export const AppContext = React.createContext({ setSites: (sites: PublishedSite[]) => { console.log("Calling Set Sites"); }, - themeType: "dark" + themeType: "dark", }); diff --git a/src/views/HomeView.tsx b/src/views/HomeView.tsx index 9d57f0237f..0845d99b39 100644 --- a/src/views/HomeView.tsx +++ b/src/views/HomeView.tsx @@ -64,7 +64,10 @@ export const HomeView: React.FC = () => { return ( {({ clientInstance, contracts, setContracts, themeType }) => ( -
+
{[...contracts.keys()].length === 0 && (

Compile a contract with Solidity Compiler

)}