diff --git a/src/components/mods/Geolosys.jsx b/src/components/mods/Geolosys.jsx index 2b02066..b808db8 100644 --- a/src/components/mods/Geolosys.jsx +++ b/src/components/mods/Geolosys.jsx @@ -1,27 +1,14 @@ -import React, { useState, useEffect } from 'react'; +import React, { useState } from 'react'; import { CSSTransition } from 'react-transition-group'; import About from './GeolosysComponents/About'; -import Plutons from './GeolosysComponents/Plutons'; -import Datapacks from './GeolosysComponents/Datapacks'; -import Config from './GeolosysComponents/Config'; -import CraftTweaker from './GeolosysComponents/CraftTweaker'; - -const extractComponentName = () => { - const url = window.location.href; - if (url.includes('#')) { - return url.split('#')[1]; - } - - return 'about'; -}; +import ConfigArchive from './GeolosysComponents/Docs/Archive/Config'; +import CraftTweakerArchive from './GeolosysComponents/Docs/Archive/CraftTweaker'; +import DatapacksArchive from './GeolosysComponents/Docs/Archive/Datapacks'; +import Datapacks from './GeolosysComponents/Docs/Datapacks'; +import PlutonsArchive from './GeolosysComponents/Plutons'; export default () => { - const [component, setComponent] = useState(extractComponentName()); - - useEffect(() => { - setComponent(extractComponentName()); - return () => { }; - }, []); + const [component, setComponent] = useState(window.location.hash.replace(/#/g, '') || 'about'); return ( @@ -37,7 +24,7 @@ export default () => {