refactor. add comment
This commit is contained in:
parent
f730ee3ff6
commit
aad8680a54
@ -9,6 +9,57 @@ import background from 'src/assets/minimap-bg.jpg';
|
||||
import ACA from 'src/components/Widget/ACA';
|
||||
import ACAHeader from 'src/components/Element/ACAHeader';
|
||||
|
||||
const data: {
|
||||
title: string;
|
||||
ammoLeft: ('Used' | 'Unused')[];
|
||||
ammoRight: ('Used' | 'Unused')[];
|
||||
fuelAmount: number;
|
||||
circleColor: 'blue' | 'yellow';
|
||||
}[] = [
|
||||
{
|
||||
title: 'ACA-1',
|
||||
ammoLeft: ['Unused', 'Unused', 'Unused', 'Used'],
|
||||
ammoRight: ['Unused', 'Used', 'Used', 'Used'],
|
||||
fuelAmount: 70,
|
||||
circleColor: 'blue',
|
||||
},
|
||||
{
|
||||
title: 'ACA-2',
|
||||
ammoLeft: ['Unused', 'Used', 'Used', 'Used'],
|
||||
ammoRight: ['Unused', 'Unused', 'Used', 'Used'],
|
||||
fuelAmount: 15,
|
||||
circleColor: 'yellow',
|
||||
},
|
||||
{
|
||||
title: 'ACA-3',
|
||||
ammoLeft: ['Unused', 'Unused', 'Used', 'Used'],
|
||||
ammoRight: ['Unused', 'Used', 'Used', 'Used'],
|
||||
fuelAmount: 40,
|
||||
circleColor: 'blue',
|
||||
},
|
||||
{
|
||||
title: 'ACA-4',
|
||||
ammoLeft: ['Unused', 'Used', 'Used', 'Used'],
|
||||
ammoRight: ['Unused', 'Unused', 'Used', 'Used'],
|
||||
fuelAmount: 90,
|
||||
circleColor: 'yellow',
|
||||
},
|
||||
{
|
||||
title: 'ACA-5',
|
||||
ammoLeft: ['Unused', 'Unused', 'Used', 'Used'],
|
||||
ammoRight: ['Unused', 'Used', 'Used', 'Used'],
|
||||
fuelAmount: 20,
|
||||
circleColor: 'blue',
|
||||
},
|
||||
{
|
||||
title: 'ACA-6',
|
||||
ammoLeft: ['Unused', 'Used', 'Used', 'Used'],
|
||||
ammoRight: ['Unused', 'Unused', 'Used', 'Used'],
|
||||
fuelAmount: 10,
|
||||
circleColor: 'yellow',
|
||||
},
|
||||
];
|
||||
|
||||
const Minimap = () => {
|
||||
const widgets = useAppSelector((state) =>
|
||||
getWidgetsOnScreen(state, '/minimap'),
|
||||
@ -24,67 +75,18 @@ const Minimap = () => {
|
||||
console.log('elementsInGaze: ', elementsInGaze);
|
||||
}, [elementsInGaze]);
|
||||
|
||||
const data: { title: string; ammoLeft: ('Used' | 'Unused')[], ammoRight: ('Used' | 'Unused')[], fuelAmount: number, circleColor: 'blue' | 'yellow' }[] = [
|
||||
|
||||
{
|
||||
title: "ACA-1",
|
||||
ammoLeft: ['Unused', 'Unused', 'Unused', 'Used'],
|
||||
ammoRight: ['Unused', 'Used', 'Used', 'Used'],
|
||||
fuelAmount: 70,
|
||||
circleColor: 'blue'
|
||||
},
|
||||
{
|
||||
title: "ACA-2",
|
||||
ammoLeft: ['Unused', 'Used', 'Used', 'Used'],
|
||||
ammoRight: ['Unused', 'Unused', 'Used', 'Used'],
|
||||
fuelAmount: 15,
|
||||
circleColor: 'yellow'
|
||||
|
||||
},
|
||||
{
|
||||
title: "ACA-3",
|
||||
ammoLeft: ['Unused', 'Unused', 'Used', 'Used'],
|
||||
ammoRight: ['Unused', 'Used', 'Used', 'Used'],
|
||||
fuelAmount: 40,
|
||||
circleColor: 'blue'
|
||||
},
|
||||
{
|
||||
title: "ACA-4",
|
||||
ammoLeft: ['Unused', 'Used', 'Used', 'Used'],
|
||||
ammoRight: ['Unused', 'Unused', 'Used', 'Used'],
|
||||
fuelAmount: 90,
|
||||
circleColor: 'yellow'
|
||||
|
||||
},
|
||||
{
|
||||
title: "ACA-5",
|
||||
ammoLeft: ['Unused', 'Unused', 'Used', 'Used'],
|
||||
ammoRight: ['Unused', 'Used', 'Used', 'Used'],
|
||||
fuelAmount: 20,
|
||||
circleColor: 'blue'
|
||||
},
|
||||
{
|
||||
title: "ACA-6",
|
||||
ammoLeft: ['Unused', 'Used', 'Used', 'Used'],
|
||||
ammoRight: ['Unused', 'Unused', 'Used', 'Used'],
|
||||
fuelAmount: 10,
|
||||
circleColor: 'yellow'
|
||||
|
||||
},
|
||||
|
||||
|
||||
];
|
||||
|
||||
|
||||
return (
|
||||
<>
|
||||
<ACAHeader data={data} />
|
||||
<div className="bg-stone-200 w-[1920px] h-[950px]"
|
||||
style={{ backgroundImage: `url(${background})` }}>
|
||||
{Object.keys(widgets).map((widgetId) => (
|
||||
<Widget key={widgetId} widget={widgets[widgetId]} />
|
||||
))}
|
||||
</div>
|
||||
{/* ACAHeader should be part of the widgets array below. */}
|
||||
<ACAHeader data={data} />
|
||||
<div
|
||||
className="bg-stone-200 w-[1920px] h-[950px]"
|
||||
style={{ backgroundImage: `url(${background})` }}
|
||||
>
|
||||
{Object.keys(widgets).map((widgetId) => (
|
||||
<Widget key={widgetId} widget={widgets[widgetId]} />
|
||||
))}
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user