From 6702d0ef2ec2a796a9aa6afdf58604800c4915a0 Mon Sep 17 00:00:00 2001 From: Daniel Karbach Date: Thu, 28 Mar 2024 13:35:36 +0100 Subject: [PATCH] restructure map for future --- .../tracker/{Map.js => Map/Overworld.js} | 82 +++++++++---------- resources/js/components/tracker/Map/index.js | 11 +++ 2 files changed, 51 insertions(+), 42 deletions(-) rename resources/js/components/tracker/{Map.js => Map/Overworld.js} (91%) create mode 100644 resources/js/components/tracker/Map/index.js diff --git a/resources/js/components/tracker/Map.js b/resources/js/components/tracker/Map/Overworld.js similarity index 91% rename from resources/js/components/tracker/Map.js rename to resources/js/components/tracker/Map/Overworld.js index 3ee4b2f..609dc34 100644 --- a/resources/js/components/tracker/Map.js +++ b/resources/js/components/tracker/Map/Overworld.js @@ -19,8 +19,8 @@ import { setBossDefeated, setPrizeAcquired, unclearAll, -} from '../../helpers/tracker'; -import { useTracker } from '../../hooks/tracker'; +} from '../../../helpers/tracker'; +import { useTracker } from '../../../hooks/tracker'; const LW_DUNGEONS = [ { @@ -686,7 +686,7 @@ const makeBackground = (src, level) => { return tiles; }; -const Map = () => { +const Overworld = () => { const { dungeons, logic, setManualState, state } = useTracker(); const mapDungeon = React.useCallback(dungeon => { @@ -775,46 +775,44 @@ const Map = () => { const dwDungeons = React.useMemo(() => DW_DUNGEONS.map(mapDungeon), [mapDungeon]); const dwLocations = React.useMemo(() => DW_LOCATIONS.map(mapLocation), [mapLocation]); - return
- { - e.preventDefault(); - e.stopPropagation(); - }} - > - - - {makeBackground('lw_files', 10)} - - - {lwLocations.map(l => - - )} - {lwDungeons.map(l => - - )} - + return { + e.preventDefault(); + e.stopPropagation(); + }} + > + + + {makeBackground('lw_files', 10)} + + + {lwLocations.map(l => + + )} + {lwDungeons.map(l => + + )} + + + + + {makeBackground('dw_files', 10)} - - - {makeBackground('dw_files', 10)} - - - {dwLocations.map(l => - - )} - {dwDungeons.map(l => - - )} - + + {dwLocations.map(l => + + )} + {dwDungeons.map(l => + + )} - -
; + + ; }; -export default Map; +export default Overworld; diff --git a/resources/js/components/tracker/Map/index.js b/resources/js/components/tracker/Map/index.js new file mode 100644 index 0000000..65dcbd3 --- /dev/null +++ b/resources/js/components/tracker/Map/index.js @@ -0,0 +1,11 @@ +import React from 'react'; + +import Overworld from './Overworld'; + +const Map = () => { + return
+ +
; +}; + +export default Map; -- 2.39.2