mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Add sync menu storybook components
GitOrigin-RevId: 8fb5979e88ba601ef1a95852550a62c295b43f76
This commit is contained in:
parent
2b1e2be7ca
commit
a2c232643f
1 changed files with 35 additions and 0 deletions
|
@ -0,0 +1,35 @@
|
|||
import SyncMenu from '../../js/features/editor-left-menu/components/sync-menu'
|
||||
import { ScopeDecorator } from '../decorators/scope'
|
||||
import { useScope } from '../hooks/use-scope'
|
||||
|
||||
export default {
|
||||
title: 'Editor / Left Menu / Sync Menu',
|
||||
component: SyncMenu,
|
||||
decorators: [ScopeDecorator],
|
||||
}
|
||||
|
||||
export const WriteAccess = () => {
|
||||
window.metaAttributesCache.set('ol-anonymous', false)
|
||||
useScope({
|
||||
permissionsLevel: 'owner',
|
||||
})
|
||||
|
||||
return (
|
||||
<div id="left-menu" className="shown">
|
||||
<SyncMenu />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export const ReadOnlyAccess = () => {
|
||||
window.metaAttributesCache.set('ol-anonymous', false)
|
||||
useScope({
|
||||
permissionsLevel: 'readOnly',
|
||||
})
|
||||
|
||||
return (
|
||||
<div id="left-menu" className="shown">
|
||||
<SyncMenu />
|
||||
</div>
|
||||
)
|
||||
}
|
Loading…
Reference in a new issue