From abc09c067f0b89c20e6f136cedfbcd8e971ea597 Mon Sep 17 00:00:00 2001
From: Aleksei Chichenkov <39502310+DanSylvest@users.noreply.github.com>
Date: Sun, 13 Apr 2025 21:59:56 +0300
Subject: [PATCH] fix(Map): Fix icons of main, follow and shattered (#321)
---
.../characters/Characters.module.scss | 35 -----------------
.../components/characters/Characters.tsx | 24 ++++++++++--
.../SolarSystemNodeDefault.module.scss | 12 ++++++
.../SolarSystemNodeDefault.tsx | 12 ++++--
.../SolarSystemNode/SolarSystemNodeTheme.tsx | 10 +++--
.../mapRootProvider/hooks/api/useMapInit.ts | 38 ++++++++++---------
.../images/chart-network-svgrepo-com.svg | 7 ++++
7 files changed, 75 insertions(+), 63 deletions(-)
create mode 100644 assets/static/images/chart-network-svgrepo-com.svg
diff --git a/assets/js/hooks/Mapper/components/characters/Characters.module.scss b/assets/js/hooks/Mapper/components/characters/Characters.module.scss
index dc44b381..7f46500b 100644
--- a/assets/js/hooks/Mapper/components/characters/Characters.module.scss
+++ b/assets/js/hooks/Mapper/components/characters/Characters.module.scss
@@ -1,38 +1,3 @@
-.MainCharacter,
-.FollowingCharacter {
- &::before, &::after {
- content: " ";
- display: inline-block;
- width: 11px;
- height: 11px;
- background-size: contain;
- background-repeat: no-repeat;
- background-position: center;
- position: absolute;
- z-index: 1;
- overflow: hidden;
- border-radius: 1px;
- }
-}
-
-.MainCharacter {
- &::before {
- background-image: url(/images/73_16_247.png);
- left: 22px;
- top: 0px;
- transform: rotateZ(90deg);
- }
-}
-
-.FollowingCharacter {
- &::after {
- background-image: url(/images/73_16_241.png);
- left: 22px;
- top: 22px;
- transform: rotateZ(180deg);
- }
-}
-
.Docked {
content: " ";
display: inline-block;
diff --git a/assets/js/hooks/Mapper/components/characters/Characters.tsx b/assets/js/hooks/Mapper/components/characters/Characters.tsx
index 3ae66687..8befe96b 100644
--- a/assets/js/hooks/Mapper/components/characters/Characters.tsx
+++ b/assets/js/hooks/Mapper/components/characters/Characters.tsx
@@ -7,6 +7,7 @@ import { emitMapEvent } from '@/hooks/Mapper/events';
import { useMapRootState } from '@/hooks/Mapper/mapRootProvider';
import classes from './Characters.module.scss';
import { isDocked } from '@/hooks/Mapper/helpers/isDocked.ts';
+import { PrimeIcons } from 'primereact/api';
interface CharactersProps {
data: CharacterTypeRaw[];
@@ -34,18 +35,35 @@ export const Characters = ({ data }: CharactersProps) => {
>
+ {mainCharacterEveId === character.eve_id && (
+
+ )}
+ {followingCharacterEveId === character.eve_id && (
+
+ )}
{isDocked(character.location) &&
}
) => {
const nodeVars = useSolarSystemNode(props);
@@ -31,8 +33,10 @@ export const SolarSystemNodeDefault = memo((props: NodeProps
)}
{nodeVars.isShattered && (
-
-
+
+
+
+
)}
@@ -40,7 +44,7 @@ export const SolarSystemNodeDefault = memo((props: NodeProps
diff --git a/assets/js/hooks/Mapper/components/map/components/SolarSystemNode/SolarSystemNodeTheme.tsx b/assets/js/hooks/Mapper/components/map/components/SolarSystemNode/SolarSystemNodeTheme.tsx
index 83d33518..3a323473 100644
--- a/assets/js/hooks/Mapper/components/map/components/SolarSystemNode/SolarSystemNodeTheme.tsx
+++ b/assets/js/hooks/Mapper/components/map/components/SolarSystemNode/SolarSystemNodeTheme.tsx
@@ -14,6 +14,8 @@ import { WormholeClassComp } from '@/hooks/Mapper/components/map/components/Worm
import { UnsplashedSignature } from '@/hooks/Mapper/components/map/components/UnsplashedSignature';
import { LocalCounter } from './SolarSystemLocalCounter';
import { KillsCounter } from './SolarSystemKillsCounter';
+import { TooltipPosition, WdTooltipWrapper } from '@/hooks/Mapper/components/ui-kit';
+import { TooltipSize } from '@/hooks/Mapper/components/ui-kit/WdTooltipWrapper/utils.ts';
export const SolarSystemNodeTheme = memo((props: NodeProps) => {
const nodeVars = useSolarSystemNode(props);
@@ -31,8 +33,10 @@ export const SolarSystemNodeTheme = memo((props: NodeProps)
)}
{nodeVars.isShattered && (
-
-
+
+
+
+
)}
@@ -40,7 +44,7 @@ export const SolarSystemNodeTheme = memo((props: NodeProps
)
diff --git a/assets/js/hooks/Mapper/mapRootProvider/hooks/api/useMapInit.ts b/assets/js/hooks/Mapper/mapRootProvider/hooks/api/useMapInit.ts
index db034041..0cd95323 100644
--- a/assets/js/hooks/Mapper/mapRootProvider/hooks/api/useMapInit.ts
+++ b/assets/js/hooks/Mapper/mapRootProvider/hooks/api/useMapInit.ts
@@ -9,23 +9,25 @@ export const useMapInit = () => {
const { addSystemStatic } = useLoadSystemStatic({ systems: [] });
return useCallback(
- ({
- systems,
- system_signatures,
- connections,
- effects,
- wormholes,
- system_static_infos,
- characters,
- user_characters,
- present_characters,
- hubs,
- user_permissions,
- options,
- is_subscription_active,
- main_character_eve_id,
- following_character_eve_id,
- }: CommandInit) => {
+ (props: CommandInit) => {
+ const {
+ systems,
+ system_signatures,
+ connections,
+ effects,
+ wormholes,
+ system_static_infos,
+ characters,
+ user_characters,
+ present_characters,
+ hubs,
+ user_permissions,
+ options,
+ is_subscription_active,
+ main_character_eve_id,
+ following_character_eve_id,
+ } = props;
+
const updateData: Partial = {};
if (wormholes) {
@@ -87,7 +89,7 @@ export const useMapInit = () => {
updateData.mainCharacterEveId = main_character_eve_id;
}
- if (following_character_eve_id) {
+ if ('following_character_eve_id' in props) {
updateData.followingCharacterEveId = following_character_eve_id;
}
diff --git a/assets/static/images/chart-network-svgrepo-com.svg b/assets/static/images/chart-network-svgrepo-com.svg
new file mode 100644
index 00000000..18c7ba58
--- /dev/null
+++ b/assets/static/images/chart-network-svgrepo-com.svg
@@ -0,0 +1,7 @@
+
+
+
\ No newline at end of file