Skip to content

Commit

Permalink
Experiments with Storybook.
Browse files Browse the repository at this point in the history
  • Loading branch information
fwaalkens committed Sep 11, 2023
1 parent 2fe1c0a commit 117d9d5
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ import { Meta, Title } from "@storybook/blocks";

<Title />

## This component is not **__"Storybook-ready"__**
## Overview of multiple battery components ##
<br />
> __Data:__ static
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ const meta: Meta<typeof BatteriesOverview> = {
component: BatteriesOverview,
decorators: [
(Story) => (
<MainLayout title="FAKE TITLE MAIN LAYOUT">
<Story />
<MainLayout title="Storybook">
<Story globals={Story}/>
</MainLayout>
)
]
Expand Down
4 changes: 4 additions & 0 deletions src/app/Marine2/components/boxes/Battery/Battery.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@ import { Meta, Title } from "@storybook/blocks";
<Title />

## Displays a Battery box

<br />

> __Data:__ static
1 change: 0 additions & 1 deletion src/app/Marine2/components/boxes/Battery/Battery.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ const Battery = ({ battery }: Props) => {

const [boxSize, setBoxSize] = useState<{ width: number; height: number }>({ width: 0, height: 0 })


const isSimpleBattery = !(state || state === 0)

if (isSimpleBattery) {
Expand Down
4 changes: 0 additions & 4 deletions src/app/Marine2/components/boxes/Charger/Charger.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import RadioButton from "../../ui/RadioButton"
import DeviceSettingModal from "../../ui/DeviceSettingModal/DeviceSettingModal"
import ValueOverview from "../../ui/ValueOverview"

/** Component niet Storybook ready */
const Charger = ({ instanceId, componentMode = "compact", compactBoxSize }: Props) => {
const chargerModeFormatter = (value: number) => {
switch (value) {
Expand Down Expand Up @@ -59,9 +58,6 @@ const Charger = ({ instanceId, componentMode = "compact", compactBoxSize }: Prop
setModeForSubmission(Number(mode))
}, [mode])


console.log('Hallo Charger!', mode, currentLimit, instanceId)

const closeModeModal = () => {
setIsModeModalOpen(false)
setModeForSubmission(Number(mode))
Expand Down
1 change: 1 addition & 0 deletions src/app/Marine2/components/boxes/EnergyAC/EnergyAC.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import ValueBox from "../../ui/ValueBox"
import ValueOverview from "../../ui/ValueOverview"

const EnergyAC = ({ mode = "compact", acLoads, compactBoxSize }: Props) => {

const { current, power, phases, voltage } = acLoads

const totalPower = power.reduce((total, power) => (power ? total + power : total))
Expand Down

0 comments on commit 117d9d5

Please sign in to comment.