Files
wanderer/assets/js/hooks/Mapper/components/topbar/Topbar.tsx
Aleksei Chichenkov d8222d83f0 Refactoring and fixing problems (#317)
* fix(Map): fix design of kills widget, fix design of signatures widget - refactor a lot of code, fixed problem with tooltip blinking

* fix(Map): refactor Tracking dialog, refactor Activity tracker, refactor codebase and some styles

* fix(Core): don't count character passage on manual add connection

* refactor(Core): improved characters tracking API

* fix(Core): fixed link signature to system on 'leads to' set

* fix(Map): Refactor map settings and prepared it to easier using

* fix(Map): Add support new command for following update

* fix(Map): Add support new command for main update

* refactor(Core): Reduce map init data by using cached system static data

* refactor(Core): Reduce map init data by extract signatures loading to a separate event

* fix(Core): adjusted IP rate limits

* fix(Map): Update design of tracking characters. Added icons for following and main. Added ability to see that character on the station or structure

---------

Co-authored-by: achichenkov <aleksei.chichenkov@telleqt.ai>
Co-authored-by: Dmitry Popov <dmitriypopovsamara@gmail.com>
2025-04-11 23:17:53 +04:00

35 lines
1.1 KiB
TypeScript

import { Characters } from '../characters/Characters';
import { useMapRootState } from '@/hooks/Mapper/mapRootProvider';
import { useMemo } from 'react';
import clsx from 'clsx';
import { sortOnlineFunc } from '@/hooks/Mapper/components/hooks/useGetOwnOnlineCharacters.ts';
import { WithChildren } from '@/hooks/Mapper/types/common.ts';
const Topbar = ({ children }: WithChildren) => {
const {
data: { characters, userCharacters },
} = useMapRootState();
const charsToShow = useMemo(() => {
return characters.filter(x => userCharacters.includes(x.eve_id)).sort(sortOnlineFunc);
}, [characters, userCharacters]);
return (
<nav
className={clsx(
'px-2 flex items-center justify-center min-w-0 h-12 pointer-events-auto',
'border-b border-stone-800 bg-gray-800 bg-opacity-5',
'bg-opacity-70 bg-neutral-900',
)}
>
<span className="flex-1"></span>
<span className="mr-2"></span>
<Characters data={charsToShow} />
{children}
</nav>
);
};
// eslint-disable-next-line react/display-name
export default Topbar;