|
|
@ -38,7 +38,7 @@ const App = () => { |
|
|
|
clientInstanceRef.current = clientInstance; |
|
|
|
clientInstanceRef.current = clientInstance; |
|
|
|
const contractsRef = useRef(contracts); |
|
|
|
const contractsRef = useRef(contracts); |
|
|
|
contractsRef.current = contracts; |
|
|
|
contractsRef.current = contracts; |
|
|
|
const [themeType, setThemeType] = useState<string>("dark") |
|
|
|
const [themeType, setThemeType] = useState<string>("dark"); |
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
useEffect(() => { |
|
|
|
console.log("Remix EthDoc loading..."); |
|
|
|
console.log("Remix EthDoc loading..."); |
|
|
@ -78,16 +78,15 @@ const App = () => { |
|
|
|
} |
|
|
|
} |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
const currentTheme = await client.call("theme", "currentTheme") |
|
|
|
const currentTheme = await client.call("theme", "currentTheme"); |
|
|
|
console.log("Current theme", currentTheme) |
|
|
|
console.log("Current theme", currentTheme); |
|
|
|
|
|
|
|
|
|
|
|
setThemeType(currentTheme.brightness || currentTheme.quality) |
|
|
|
setThemeType(currentTheme.brightness || currentTheme.quality); |
|
|
|
|
|
|
|
|
|
|
|
client.on("theme", "themeChanged", (theme: any) => { |
|
|
|
client.on("theme", "themeChanged", (theme: any) => { |
|
|
|
console.log("themeChanged") |
|
|
|
console.log("themeChanged"); |
|
|
|
setThemeType(theme.quality) |
|
|
|
setThemeType(theme.quality); |
|
|
|
}) |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
loadClient(); |
|
|
|
loadClient(); |
|
|
@ -101,7 +100,7 @@ const App = () => { |
|
|
|
setContracts, |
|
|
|
setContracts, |
|
|
|
sites, |
|
|
|
sites, |
|
|
|
setSites, |
|
|
|
setSites, |
|
|
|
themeType |
|
|
|
themeType, |
|
|
|
}} |
|
|
|
}} |
|
|
|
> |
|
|
|
> |
|
|
|
<Routes /> |
|
|
|
<Routes /> |
|
|
|