Files
supabase/apps/studio/components/ui/DatePicker/DatePicker.stories.tsx
Ivan Vasilov 436bdb10ae chore: Move the studio app to apps/studio (#18915)
* Move all studio files from /studio to /apps/studio.

* Move studio specific prettier ignores.

* Fix the ui references from studio.

* Fix the css imports.

* Fix all package.json issues.

* Fix the prettier setup for the studio app.

* Add .turbo folder to prettierignore.

* Fix the github workflows.
2023-11-15 12:38:55 +01:00

36 lines
773 B
TypeScript

import React, { useState } from 'react'
import { DatePicker } from '.'
import ReactDatePicker from 'react-datepicker'
export default {
title: 'Data/DatePicker',
component: DatePicker,
}
export const Default = (args: any) => (
<div style={{ margin: '0 auto', minHeight: '420px', marginTop: '220px' }}>
<DatePicker />
</div>
)
export const Simple = () => {
const [startDate, setStartDate] = useState(new Date())
const [endDate, setEndDate] = useState(null)
const onChange = (dates: any) => {
const [start, end] = dates
setStartDate(start)
setEndDate(end)
}
return (
<ReactDatePicker
selected={startDate}
onChange={onChange}
startDate={startDate}
endDate={endDate}
selectsRange
inline
/>
)
}