feat: peak recharge / usage / delta statistics for capacitor (#60)
This commit is contained in:
@@ -62,7 +62,7 @@
|
||||
"typescript-plugin-css-modules": "^5.0.2"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@eveshipfit/dogma-engine": "^2.3.2",
|
||||
"@eveshipfit/dogma-engine": "^2.4.0",
|
||||
"react": "^18.2.0",
|
||||
"react-dom": "^18.2.0"
|
||||
},
|
||||
|
||||
@@ -4,6 +4,7 @@ import React from "react";
|
||||
import { fullFit } from '../../.storybook/fits';
|
||||
|
||||
import { DogmaEngineProvider } from '../DogmaEngineProvider';
|
||||
import { EsiProvider } from '../EsiProvider';
|
||||
import { EveDataProvider } from '../EveDataProvider';
|
||||
import { ShipSnapshotProvider } from '../ShipSnapshotProvider';
|
||||
import { CalculationDetail } from './';
|
||||
@@ -17,14 +18,18 @@ const meta: Meta<typeof CalculationDetail> = {
|
||||
export default meta;
|
||||
type Story = StoryObj<typeof CalculationDetail>;
|
||||
|
||||
const withShipSnapshotProvider: Decorator<{source: "Ship" | { Item: number }}> = (Story, context) => {
|
||||
const useShipSnapshotProvider: Decorator<{source: "Ship" | { Item: number }}> = (Story, context) => {
|
||||
const [skills, setSkills] = React.useState<Record<string, number>>({});
|
||||
|
||||
return (
|
||||
<EveDataProvider>
|
||||
<DogmaEngineProvider>
|
||||
<ShipSnapshotProvider {...context.parameters.snapshot}>
|
||||
<Story {...context.args} />
|
||||
</ShipSnapshotProvider>
|
||||
</DogmaEngineProvider>
|
||||
<EsiProvider setSkills={setSkills}>
|
||||
<DogmaEngineProvider>
|
||||
<ShipSnapshotProvider {...context.parameters.snapshot} skills={skills}>
|
||||
<Story {...context.args} />
|
||||
</ShipSnapshotProvider>
|
||||
</DogmaEngineProvider>
|
||||
</EsiProvider>
|
||||
</EveDataProvider>
|
||||
);
|
||||
}
|
||||
@@ -33,11 +38,10 @@ export const Default: Story = {
|
||||
args: {
|
||||
source: "Ship",
|
||||
},
|
||||
decorators: [withShipSnapshotProvider],
|
||||
decorators: [useShipSnapshotProvider],
|
||||
parameters: {
|
||||
snapshot: {
|
||||
fit: fullFit,
|
||||
skills: {},
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
@@ -4,6 +4,7 @@ import React from "react";
|
||||
import { fullFit } from '../../.storybook/fits';
|
||||
|
||||
import { DogmaEngineProvider } from '../DogmaEngineProvider';
|
||||
import { EsiProvider } from '../EsiProvider';
|
||||
import { EveDataProvider } from '../EveDataProvider';
|
||||
import { ShipSnapshotProvider } from '../ShipSnapshotProvider';
|
||||
import { ShipFitExtended } from './';
|
||||
@@ -17,16 +18,20 @@ const meta: Meta<typeof ShipFitExtended> = {
|
||||
export default meta;
|
||||
type Story = StoryObj<typeof ShipFitExtended>;
|
||||
|
||||
const withShipSnapshotProvider: Decorator<Record<string, never>> = (Story, context) => {
|
||||
const useShipSnapshotProvider: Decorator<Record<string, never>> = (Story, context) => {
|
||||
const [skills, setSkills] = React.useState<Record<string, number>>({});
|
||||
|
||||
return (
|
||||
<EveDataProvider>
|
||||
<DogmaEngineProvider>
|
||||
<ShipSnapshotProvider {...context.parameters.snapshot}>
|
||||
<div style={{ width: context.args.width, height: context.args.width }}>
|
||||
<Story />
|
||||
</div>
|
||||
</ShipSnapshotProvider>
|
||||
</DogmaEngineProvider>
|
||||
<EsiProvider setSkills={setSkills}>
|
||||
<DogmaEngineProvider>
|
||||
<ShipSnapshotProvider {...context.parameters.snapshot} skills={skills}>
|
||||
<div style={{ width: context.args.width, height: context.args.width }}>
|
||||
<Story />
|
||||
</div>
|
||||
</ShipSnapshotProvider>
|
||||
</DogmaEngineProvider>
|
||||
</EsiProvider>
|
||||
</EveDataProvider>
|
||||
);
|
||||
}
|
||||
@@ -35,11 +40,10 @@ export const Default: Story = {
|
||||
args: {
|
||||
width: 730,
|
||||
},
|
||||
decorators: [withShipSnapshotProvider],
|
||||
decorators: [useShipSnapshotProvider],
|
||||
parameters: {
|
||||
snapshot: {
|
||||
fit: fullFit,
|
||||
skills: {},
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
@@ -4,6 +4,7 @@ import React from "react";
|
||||
import { fullFit } from '../../.storybook/fits';
|
||||
|
||||
import { DogmaEngineProvider } from '../DogmaEngineProvider';
|
||||
import { EsiProvider } from '../EsiProvider';
|
||||
import { EveDataProvider } from '../EveDataProvider';
|
||||
import { ShipSnapshotProvider } from '../ShipSnapshotProvider';
|
||||
import { ShipStatistics } from './';
|
||||
@@ -17,24 +18,27 @@ const meta: Meta<typeof ShipStatistics> = {
|
||||
export default meta;
|
||||
type Story = StoryObj<typeof ShipStatistics>;
|
||||
|
||||
const withShipSnapshotProvider: Decorator<Record<string, never>> = (Story, context) => {
|
||||
const useShipSnapshotProvider: Decorator<Record<string, never>> = (Story, context) => {
|
||||
const [skills, setSkills] = React.useState<Record<string, number>>({});
|
||||
|
||||
return (
|
||||
<EveDataProvider>
|
||||
<DogmaEngineProvider>
|
||||
<ShipSnapshotProvider {...context.parameters.snapshot}>
|
||||
<Story />
|
||||
</ShipSnapshotProvider>
|
||||
</DogmaEngineProvider>
|
||||
<EsiProvider setSkills={setSkills}>
|
||||
<DogmaEngineProvider>
|
||||
<ShipSnapshotProvider {...context.parameters.snapshot} skills={skills}>
|
||||
<Story />
|
||||
</ShipSnapshotProvider>
|
||||
</DogmaEngineProvider>
|
||||
</EsiProvider>
|
||||
</EveDataProvider>
|
||||
);
|
||||
}
|
||||
|
||||
export const Default: Story = {
|
||||
decorators: [withShipSnapshotProvider],
|
||||
decorators: [useShipSnapshotProvider],
|
||||
parameters: {
|
||||
snapshot: {
|
||||
fit: fullFit,
|
||||
skills: {},
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
@@ -16,16 +16,16 @@ import { Icon } from "../Icon";
|
||||
export const ShipStatistics = () => {
|
||||
return <div>
|
||||
<Category headerLabel="Capacitor" headerContent={
|
||||
<span>Stable</span>
|
||||
<span>?</span>
|
||||
}>
|
||||
<CategoryLine>
|
||||
<span>
|
||||
<ShipAttribute name="capacity" fixed={0} /> GJ / ? s
|
||||
<ShipAttribute name="capacitorCapacity" fixed={0} /> GJ / <ShipAttribute name="rechargeRate" fixed={2} divideBy={1000} /> s
|
||||
</span>
|
||||
</CategoryLine>
|
||||
<CategoryLine>
|
||||
<span>
|
||||
? GJ/s (100.0%)
|
||||
Δ <ShipAttribute name="capacitorPeakDelta" fixed={0} /> GJ/s (<ShipAttribute name="capacitorPeakDeltaPercentage" fixed={1} />%)
|
||||
</span>
|
||||
</CategoryLine>
|
||||
</Category>
|
||||
|
||||
@@ -1 +1 @@
|
||||
export const defaultDataUrl = "https://data.eveship.fit/v6.1-20231214/";
|
||||
export const defaultDataUrl = "https://data.eveship.fit/v7.0-20231214/";
|
||||
|
||||
Reference in New Issue
Block a user