mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-26 09:42:53 +00:00
42fe453096
GitOrigin-RevId: 0f4c43eeb0182e7288566eff1ceed861bb9c4338
37 lines
890 B
TypeScript
37 lines
890 B
TypeScript
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)
|
|
window.metaAttributesCache.set('ol-gitBridgeEnabled', true)
|
|
useScope({
|
|
permissionsLevel: 'owner',
|
|
})
|
|
|
|
return (
|
|
<div id="left-menu" className="shown">
|
|
<SyncMenu />
|
|
</div>
|
|
)
|
|
}
|
|
|
|
export const ReadOnlyAccess = () => {
|
|
window.metaAttributesCache.set('ol-anonymous', false)
|
|
window.metaAttributesCache.set('ol-gitBridgeEnabled', true)
|
|
useScope({
|
|
permissionsLevel: 'readOnly',
|
|
})
|
|
|
|
return (
|
|
<div id="left-menu" className="shown">
|
|
<SyncMenu />
|
|
</div>
|
|
)
|
|
}
|