connect request form v2 to sidebar nav

Summary: If the GK is enabled, get the new litho support form from the sidebar!

Reviewed By: jknoxville

Differential Revision: D18639060

fbshipit-source-id: c10a32fc4725374dbd6d89e16944642d3124037e
This commit is contained in:
Michel Weststrate
2019-11-21 11:14:45 -08:00
committed by Facebook Github Bot
parent fef8d5a50f
commit e7ad713df8

View File

@@ -54,6 +54,7 @@ import {BackgroundColorProperty} from 'csstype';
import {StyledOtherComponent} from 'create-emotion-styled'; import {StyledOtherComponent} from 'create-emotion-styled';
import SupportRequestFormManager from '../fb-stubs/SupportRequestFormManager'; import SupportRequestFormManager from '../fb-stubs/SupportRequestFormManager';
import SupportRequestDetails from '../fb-stubs/SupportRequestDetails'; import SupportRequestDetails from '../fb-stubs/SupportRequestDetails';
import SupportRequestFormV2 from '../fb-stubs/SupportRequestFormV2';
type FlipperPlugins = typeof FlipperPlugin[]; type FlipperPlugins = typeof FlipperPlugin[];
type PluginsByCategory = [string, FlipperPlugins][]; type PluginsByCategory = [string, FlipperPlugins][];
@@ -405,27 +406,25 @@ class MainSidebar extends PureComponent<Props, State> {
</PluginName> </PluginName>
</ListItem> </ListItem>
)} )}
{this.state.showSupportForm && ( {this.state.showSupportForm &&
<ListItem (function() {
active={ const supportRequestFormImpl = GK.get('support_requests_v2')
staticView != null && staticView === SupportRequestFormManager ? SupportRequestFormV2
} : SupportRequestFormManager;
onClick={() => setStaticView(SupportRequestFormManager)}> const active = staticView && staticView === supportRequestFormImpl;
<PluginIcon return (
color={colors.light50} <ListItem
name={'app-dailies'} active={active}
isActive={ onClick={() => setStaticView(supportRequestFormImpl)}>
staticView != null && staticView === SupportRequestFormManager <PluginIcon
} color={colors.light50}
/> name={'app-dailies'}
<PluginName isActive={active}
isActive={ />
staticView != null && staticView === SupportRequestFormManager <PluginName isActive={active}>Litho Support Request</PluginName>
}> </ListItem>
Litho Support Request );
</PluginName> })()}
</ListItem>
)}
<ListItem <ListItem
onClick={() => this.props.setActiveSheet(ACTIVE_SHEET_PLUGINS)}> onClick={() => this.props.setActiveSheet(ACTIVE_SHEET_PLUGINS)}>
<PluginIcon <PluginIcon