Using an icon name instead of the component for registerProduct (#951)
This commit is contained in:
parent
eca18c0660
commit
a442f08ed3
3 changed files with 3 additions and 18 deletions
|
@ -31,14 +31,6 @@ import {PluginRegistry} from './types/mattermost-webapp'
|
|||
|
||||
import './plugin.scss'
|
||||
|
||||
const GlobalHeaderIcon = () => {
|
||||
return (
|
||||
<span className='FocalboardGlobalHeaderIcon'>
|
||||
<FocalboardIcon/>
|
||||
</span>
|
||||
)
|
||||
}
|
||||
|
||||
const MainApp = () => {
|
||||
useEffect(() => {
|
||||
document.body.classList.add('focalboard-body')
|
||||
|
@ -128,7 +120,7 @@ export default class Plugin {
|
|||
}, [])
|
||||
return <></>
|
||||
})
|
||||
this.registry.registerProduct('/boards', GlobalHeaderIcon, 'Boards', '/plug/focalboard/go-to-current-workspace', MainApp, HeaderComponent)
|
||||
this.registry.registerProduct('/boards', 'product-boards', 'Boards', '/plug/focalboard/go-to-current-workspace', MainApp, HeaderComponent)
|
||||
} else {
|
||||
windowAny.frontendBaseURL = '/plug/focalboard'
|
||||
this.channelHeaderButtonId = registry.registerChannelHeaderButtonAction(<FocalboardIcon/>, () => {
|
||||
|
|
|
@ -5,13 +5,6 @@
|
|||
align-items: center;
|
||||
}
|
||||
|
||||
.FocalboardGlobalHeaderIcon .LogoIcon {
|
||||
height: 20px;
|
||||
width: 20px;
|
||||
display: inline-block;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.focalboard-body .feature-global-header > header {
|
||||
z-index: 1000;
|
||||
}
|
||||
}
|
|
@ -6,7 +6,7 @@ export interface PluginRegistry {
|
|||
registerCustomRoute(route: string, component: React.ElementType)
|
||||
registerProductRoute(route: string, component: React.ElementType)
|
||||
unregisterComponent(componentId: string)
|
||||
registerProduct(baseURL: string, switcherIcon: React.ElementType, switcherText: string, switcherLinkURL: string, mainComponent: React.ElementType, headerCompoent: React.ElementType)
|
||||
registerProduct(baseURL: string, switcherIcon: string, switcherText: string, switcherLinkURL: string, mainComponent: React.ElementType, headerCompoent: React.ElementType)
|
||||
|
||||
// Add more if needed from https://developers.mattermost.com/extend/plugins/webapp/reference
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue