mirror of
https://github.com/wanderer-industries/wanderer
synced 2025-12-12 02:35:42 +00:00
fix(Map): Removed unnecessary code onFE part
This commit is contained in:
@@ -4,12 +4,7 @@ import classes from './SystemViewStandalone.module.scss';
|
||||
import clsx from 'clsx';
|
||||
import { WithClassName } from '@/hooks/Mapper/types/common.ts';
|
||||
import { SolarSystemStaticInfoRaw } from '@/hooks/Mapper/types';
|
||||
import { HTMLProps, MouseEvent, useCallback, useMemo } from 'react';
|
||||
import {
|
||||
SOLAR_SYSTEM_CLASS_GROUPS,
|
||||
SOLAR_SYSTEM_CLASSES_TO_CLASS_GROUPS,
|
||||
WORMHOLES_ADDITIONAL_INFO_BY_CLASS_ID,
|
||||
} from '@/hooks/Mapper/components/map/constants.ts';
|
||||
import { HTMLProps, MouseEvent, useCallback } from 'react';
|
||||
|
||||
export type SystemViewStandaloneStatic = Pick<
|
||||
SolarSystemStaticInfoRaw,
|
||||
@@ -45,18 +40,6 @@ export const SystemViewStandalone = ({
|
||||
const isWH = isWormholeSpace(system_class);
|
||||
1;
|
||||
|
||||
const systemPreparedName = useMemo(() => {
|
||||
const { id: whType, shortTitle } = WORMHOLES_ADDITIONAL_INFO_BY_CLASS_ID[system_class];
|
||||
|
||||
// @ts-ignore
|
||||
const spawnClassGroup = SOLAR_SYSTEM_CLASSES_TO_CLASS_GROUPS[whType];
|
||||
if (spawnClassGroup === SOLAR_SYSTEM_CLASS_GROUPS.drifter) {
|
||||
return shortTitle;
|
||||
}
|
||||
|
||||
return solar_system_name;
|
||||
}, [system_class, solar_system_name]);
|
||||
|
||||
const handleClick = useCallback(
|
||||
(e: MouseEvent) => {
|
||||
e.preventDefault();
|
||||
@@ -79,7 +62,7 @@ export const SystemViewStandalone = ({
|
||||
[classes.CompactName]: compact,
|
||||
})}
|
||||
>
|
||||
{customName ?? systemPreparedName}
|
||||
{customName ?? solar_system_name}
|
||||
</span>
|
||||
{!hideRegion && !isWH && <span className="whitespace-nowrap">{region_name}</span>}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user