Using an icon name instead of the component for registerProduct (#951)

This commit is contained in:
Jesús Espino 2021-08-12 17:06:09 +02:00 committed by GitHub
parent eca18c0660
commit a442f08ed3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 18 deletions

View file

@ -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/>, () => {

View file

@ -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;
}
}

View file

@ -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
}