mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-24 20:19:49 +02:00
feat: titles
This commit is contained in:
1 parent
7575f4581c
commit
5d098c46fa
1 file changed
+21
-4
@@ -5,6 +5,7 @@ import {
|
|||||||
Button,
|
Button,
|
||||||
Dialog,
|
Dialog,
|
||||||
Flex,
|
Flex,
|
||||||
|
Heading,
|
||||||
SegmentedControl,
|
SegmentedControl,
|
||||||
Table,
|
Table,
|
||||||
Text,
|
Text,
|
||||||
@@ -25,8 +26,6 @@ import mutateCompare, { useCompare } from '../../../stores/compare';
|
|||||||
import { TankSearch } from '../tankopedia/components/TankSearch';
|
import { TankSearch } from '../tankopedia/components/TankSearch';
|
||||||
import { TankControl } from './components/TankControl';
|
import { TankControl } from './components/TankControl';
|
||||||
|
|
||||||
const SIGNIFICANT_CHANGE_THRESHOLD = 0.15;
|
|
||||||
|
|
||||||
export default function Page() {
|
export default function Page() {
|
||||||
const pathname = usePathname();
|
const pathname = usePathname();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
@@ -138,8 +137,7 @@ export default function Page() {
|
|||||||
|
|
||||||
{values.map((value, index) => {
|
{values.map((value, index) => {
|
||||||
const deltaPercentage = (value ?? 1) / (values[0] ?? 1) - 1;
|
const deltaPercentage = (value ?? 1) / (values[0] ?? 1) - 1;
|
||||||
const significantChange =
|
const significantChange = Math.abs(deltaPercentage) >= 0.15;
|
||||||
Math.abs(deltaPercentage) >= SIGNIFICANT_CHANGE_THRESHOLD;
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Table.Cell
|
<Table.Cell
|
||||||
@@ -191,6 +189,20 @@ export default function Page() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function Title({ children }: { children: string }) {
|
||||||
|
return (
|
||||||
|
<Table.Row>
|
||||||
|
<Table.RowHeaderCell>
|
||||||
|
<Heading>{children}</Heading>
|
||||||
|
</Table.RowHeaderCell>
|
||||||
|
|
||||||
|
{members.map(() => (
|
||||||
|
<Table.Cell />
|
||||||
|
))}
|
||||||
|
</Table.Row>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<PageWrapper color="crimson" size="100%">
|
<PageWrapper color="crimson" size="100%">
|
||||||
<Flex justify="center" gap="6" align="center">
|
<Flex justify="center" gap="6" align="center">
|
||||||
@@ -292,6 +304,7 @@ export default function Page() {
|
|||||||
</Table.Header>
|
</Table.Header>
|
||||||
|
|
||||||
<Table.Body>
|
<Table.Body>
|
||||||
|
<Title>Fire</Title>
|
||||||
<Row name="DPM" value="dpm" decimals={0} />
|
<Row name="DPM" value="dpm" decimals={0} />
|
||||||
<Row
|
<Row
|
||||||
name="Reload"
|
name="Reload"
|
||||||
@@ -365,6 +378,8 @@ export default function Page() {
|
|||||||
/>
|
/>
|
||||||
<Row name="Gun depression" value="gunDepression" decimals={1} />
|
<Row name="Gun depression" value="gunDepression" decimals={1} />
|
||||||
<Row name="Gun elevation" value="gunElevation" decimals={1} />
|
<Row name="Gun elevation" value="gunElevation" decimals={1} />
|
||||||
|
|
||||||
|
<Title>Maneuverability</Title>
|
||||||
<Row name="Speed forwards" value="speedForwards" decimals={0} />
|
<Row name="Speed forwards" value="speedForwards" decimals={0} />
|
||||||
<Row name="Speed backwards" value="speedBackwards" decimals={0} />
|
<Row name="Speed backwards" value="speedBackwards" decimals={0} />
|
||||||
<Row name="Engine power" value="enginePower" decimals={0} />
|
<Row name="Engine power" value="enginePower" decimals={0} />
|
||||||
@@ -383,6 +398,8 @@ export default function Page() {
|
|||||||
value="powerToWeightRatioSoftTerrain"
|
value="powerToWeightRatioSoftTerrain"
|
||||||
decimals={1}
|
decimals={1}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<Title>Survivability</Title>
|
||||||
<Row name="Health" value="health" decimals={0} />
|
<Row name="Health" value="health" decimals={0} />
|
||||||
<Row
|
<Row
|
||||||
name="Fire chance"
|
name="Fire chance"
|
||||||
|
|||||||
Reference in new issue
Block a user