Skip to content

Commit

Permalink
fix storybook
Browse files Browse the repository at this point in the history
  • Loading branch information
thmsobrmlr committed Oct 27, 2023
1 parent c64fbc2 commit 2b10614
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions frontend/src/lib/components/Map/Map.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,26 +1,22 @@
import type { Meta, StoryObj } from '@storybook/react'
import { Marker } from 'maplibre-gl'

import { Map, MapComponent } from './Map'
import { Map } from './Map'

const coordinates: [number, number] = [0.119167, 52.205276]

const meta: Meta<typeof Map> = {
title: 'Components/Map',
component: Map,
tags: ['autodocs'],
}
type Story = StoryObj<typeof Map>

const coordinates: [number, number] = [0.119167, 52.205276]

export const Unavailable: Story = {}

export const Basic: Story = {
render: (args) => <MapComponent {...args} />,
// :TRICKY: We can't use markers in Storybook stories, as the Marker class is
// not JSON-serializable (circular structure).
args: {
center: coordinates,
markers: [new Marker({ color: 'var(--primary)' }).setLngLat(coordinates)],
className: 'h-60',
},
}
type Story = StoryObj<typeof Map>

export const Basic: Story = {}

export default meta

0 comments on commit 2b10614

Please sign in to comment.