diff --git a/client/homebrew/homebrew.jsx b/client/homebrew/homebrew.jsx index a6b4b9175..a261e76ef 100644 --- a/client/homebrew/homebrew.jsx +++ b/client/homebrew/homebrew.jsx @@ -1,7 +1,7 @@ /* eslint-disable camelcase */ import 'core-js/es/string/to-well-formed.js'; //Polyfill for older browsers import './homebrew.less'; -import React from 'react'; +import { useState, useEffect } from 'react'; import { StaticRouter as Router, Route, Routes, useParams, useSearchParams } from 'react-router'; import HomePage from './pages/homePage/homePage.jsx'; @@ -17,7 +17,6 @@ const WithRoute = ({ el: Element, ...rest })=>{ const params = useParams(); const [searchParams] = useSearchParams(); const queryParams = Object.fromEntries(searchParams?.entries() || []); - return ; }; @@ -42,15 +41,35 @@ const Homebrew = (props)=>{ brews } = props; + const [isClient, setIsClient] = useState(false); + + useEffect(() => { + setIsClient(true); + }, []); + global.account = account; global.version = version; global.enable_v3 = enable_v3; global.enable_themes = enable_themes; global.config = config; + const backgroundObject = ()=>{ + if(!isClient) return null; + if(config.deployment) { + return { + backgroundImage : `url("data:image/svg+xml;utf8,${config.deployment}")` + }; + } else if(config.local) { + return { + backgroundImage : `url("data:image/svg+xml;utf8,Local")` + }; + } + return null; + }; + return ( -
+
} /> } /> @@ -72,4 +91,4 @@ const Homebrew = (props)=>{ ); }; -module.exports = Homebrew; \ No newline at end of file +module.exports = Homebrew;