overleaf/services/web/frontend/stories/history/toggle-switch.stories.tsx
ilkin-overleaf 8e03a9a4f2 Merge pull request #13121 from overleaf/ii-history-react-change-list-stories
[web] History migration change list stories

GitOrigin-RevId: 1bc3ce12cb5c096ab45beae083181f8158596292
2023-05-23 08:05:36 +00:00

46 lines
1.1 KiB
TypeScript

import { useState } from 'react'
import ToggleSwitchComponent from '../../js/features/history/components/change-list/toggle-switch'
import { ScopeDecorator } from '../decorators/scope'
import { HistoryProvider } from '../../js/features/history/context/history-context'
export const HistoryAndLabelsToggleSwitch = () => {
const [labelsOnly, setLabelsOnly] = useState(false)
return (
<HistoryProvider>
<ToggleSwitchComponent
labelsOnly={labelsOnly}
setLabelsOnly={setLabelsOnly}
/>
</HistoryProvider>
)
}
export default {
title: 'History / Change list',
component: ToggleSwitchComponent,
argTypes: {
labelsOnly: {
table: {
disable: true,
},
},
setLabelsOnly: {
table: {
disable: true,
},
},
},
decorators: [
ScopeDecorator,
(Story: React.ComponentType) => (
<div className="history-react">
<div className="change-list">
<div className="history-header history-toggle-switch-container">
<Story />
</div>
</div>
</div>
),
],
}