mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
0895e33235
[web] Actions dropdown history migration GitOrigin-RevId: 6b7055501c5eb1529b1794db92bb9f5f3faa6648
46 lines
1.1 KiB
TypeScript
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 LabelsOnlyToggleSwitch = () => {
|
|
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>
|
|
),
|
|
],
|
|
}
|