mirror of
https://github.com/wanderer-industries/wanderer
synced 2025-12-11 18:26:04 +00:00
* 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>
67 lines
1.8 KiB
TypeScript
67 lines
1.8 KiB
TypeScript
import { useEffect, useRef, useState } from 'react';
|
|
import { Dialog } from 'primereact/dialog';
|
|
import { TabPanel, TabView } from 'primereact/tabview';
|
|
import { TrackingSettings } from './TrackingSettings.tsx';
|
|
import { TrackingCharactersList } from './TrackingCharactersList.tsx';
|
|
import { useMapRootState } from '@/hooks/Mapper/mapRootProvider';
|
|
import { TrackingProvider, useTracking } from './TrackingProvider.tsx';
|
|
|
|
interface TrackingDialogProps {
|
|
visible: boolean;
|
|
onHide: () => void;
|
|
}
|
|
|
|
const TrackingDialogComp = ({ visible, onHide }: TrackingDialogProps) => {
|
|
const [activeIndex, setActiveIndex] = useState(0);
|
|
const { outCommand } = useMapRootState();
|
|
const { loadTracking } = useTracking();
|
|
|
|
const refVars = useRef({ outCommand });
|
|
refVars.current = { outCommand };
|
|
|
|
useEffect(() => {
|
|
if (!visible) {
|
|
return;
|
|
}
|
|
|
|
loadTracking();
|
|
}, [loadTracking, visible]);
|
|
|
|
return (
|
|
<Dialog
|
|
header={
|
|
<div className="dialog-header">
|
|
<span className="pointer-events-none">Track & Follow</span>
|
|
</div>
|
|
}
|
|
draggable={false}
|
|
resizable={false}
|
|
visible={visible}
|
|
onHide={onHide}
|
|
className="w-[640px] h-[400px] text-text-color min-h-0"
|
|
>
|
|
<TabView
|
|
className="vertical-tabs-container h-full [&_.p-tabview-panels]:!pr-0"
|
|
activeIndex={activeIndex}
|
|
onTabChange={e => setActiveIndex(e.index)}
|
|
renderActiveOnly={false}
|
|
>
|
|
<TabPanel header="Tracking" contentClassName="h-full">
|
|
<TrackingCharactersList />
|
|
</TabPanel>
|
|
<TabPanel header="Follow & Settings">
|
|
<TrackingSettings />
|
|
</TabPanel>
|
|
</TabView>
|
|
</Dialog>
|
|
);
|
|
};
|
|
|
|
export const TrackingDialog = (props: TrackingDialogProps) => {
|
|
return (
|
|
<TrackingProvider>
|
|
<TrackingDialogComp {...props} />
|
|
</TrackingProvider>
|
|
);
|
|
};
|