mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-24 20:41:01 +00:00
146a207fd1
[SettingsPage] Refactor Linking Section GitOrigin-RevId: 49aa27cdcb3669c59c9a9c46edd3249cee876dd0
46 lines
1.3 KiB
JavaScript
46 lines
1.3 KiB
JavaScript
import useFetchMock from '../hooks/use-fetch-mock'
|
|
import LinkingSection from '../../js/features/settings/components/linking-section'
|
|
import { setDefaultMeta, defaultSetupMocks } from './helpers/linking'
|
|
import { UserProvider } from '../../js/shared/context/user-context'
|
|
import { SSOProvider } from '../../js/features/settings/context/sso-context'
|
|
|
|
export const Section = args => {
|
|
useFetchMock(defaultSetupMocks)
|
|
setDefaultMeta()
|
|
|
|
return (
|
|
<UserProvider>
|
|
<SSOProvider>
|
|
<LinkingSection {...args} />
|
|
</SSOProvider>
|
|
</UserProvider>
|
|
)
|
|
}
|
|
|
|
export const SectionAllUnlinked = args => {
|
|
useFetchMock(defaultSetupMocks)
|
|
setDefaultMeta()
|
|
window.metaAttributesCache.set('ol-thirdPartyIds', {})
|
|
window.metaAttributesCache.set('ol-user', {
|
|
features: { github: true, dropbox: true, mendeley: true, zotero: true },
|
|
refProviders: {
|
|
mendeley: false,
|
|
zotero: false,
|
|
},
|
|
})
|
|
window.metaAttributesCache.set('ol-github', { enabled: false })
|
|
window.metaAttributesCache.set('ol-dropbox', { registered: false })
|
|
|
|
return (
|
|
<UserProvider>
|
|
<SSOProvider>
|
|
<LinkingSection {...args} />
|
|
</SSOProvider>
|
|
</UserProvider>
|
|
)
|
|
}
|
|
|
|
export default {
|
|
title: 'Account Settings / Linking',
|
|
component: LinkingSection,
|
|
}
|