mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
a555f0d309
* Added project name, pdf toggle and share project buttons to navigation toolbar * Added PropTypes check to `useChatContext()` * React context updates for project name/rename, pdf view and share moda * Hide PDF button when pdfLayout != 'flat' GitOrigin-RevId: 3f4a1b072259df7148d3417cd22116702bdd79ac
46 lines
1.2 KiB
JavaScript
46 lines
1.2 KiB
JavaScript
import React from 'react'
|
|
import ToolbarHeader from '../js/features/editor-navigation-toolbar/components/toolbar-header'
|
|
|
|
import { setupContext } from './fixtures/context'
|
|
|
|
setupContext()
|
|
|
|
export const UpToThreeConnectedUsers = args => {
|
|
return <ToolbarHeader {...args} />
|
|
}
|
|
UpToThreeConnectedUsers.args = {
|
|
onlineUsers: ['a', 'c', 'd'].map(c => ({
|
|
user_id: c,
|
|
name: `${c}_user name`
|
|
}))
|
|
}
|
|
|
|
export const ManyConnectedUsers = args => {
|
|
return <ToolbarHeader {...args} />
|
|
}
|
|
ManyConnectedUsers.args = {
|
|
onlineUsers: ['a', 'c', 'd', 'e', 'f'].map(c => ({
|
|
user_id: c,
|
|
name: `${c}_user name`
|
|
}))
|
|
}
|
|
|
|
export default {
|
|
title: 'EditorNavigationToolbar',
|
|
component: ToolbarHeader,
|
|
argTypes: {
|
|
goToUser: { action: 'goToUser' },
|
|
renameProject: { action: 'renameProject' },
|
|
toggleHistoryOpen: { action: 'toggleHistoryOpen' },
|
|
toggleReviewPanelOpen: { action: 'toggleReviewPanelOpen' },
|
|
toggleChatOpen: { action: 'toggleChatOpen' },
|
|
togglePdfView: { action: 'togglePdfView' },
|
|
openShareModal: { action: 'openShareModal' },
|
|
onShowLeftMenuClick: { action: 'onShowLeftMenuClick' }
|
|
},
|
|
args: {
|
|
projectName: 'Overleaf Project',
|
|
onlineUsers: [{ user_id: 'abc', name: 'overleaf' }],
|
|
unreadMessageCount: 0
|
|
}
|
|
}
|