From e7ad713df8c9d5f8fcbd12687925c8517031b6b9 Mon Sep 17 00:00:00 2001 From: Michel Weststrate Date: Thu, 21 Nov 2019 11:14:45 -0800 Subject: [PATCH] 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 --- src/chrome/MainSidebar.tsx | 41 +++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/src/chrome/MainSidebar.tsx b/src/chrome/MainSidebar.tsx index 2b874caa7..c3d6705b6 100644 --- a/src/chrome/MainSidebar.tsx +++ b/src/chrome/MainSidebar.tsx @@ -54,6 +54,7 @@ import {BackgroundColorProperty} from 'csstype'; import {StyledOtherComponent} from 'create-emotion-styled'; import SupportRequestFormManager from '../fb-stubs/SupportRequestFormManager'; import SupportRequestDetails from '../fb-stubs/SupportRequestDetails'; +import SupportRequestFormV2 from '../fb-stubs/SupportRequestFormV2'; type FlipperPlugins = typeof FlipperPlugin[]; type PluginsByCategory = [string, FlipperPlugins][]; @@ -405,27 +406,25 @@ class MainSidebar extends PureComponent { )} - {this.state.showSupportForm && ( - setStaticView(SupportRequestFormManager)}> - - - Litho Support Request - - - )} + {this.state.showSupportForm && + (function() { + const supportRequestFormImpl = GK.get('support_requests_v2') + ? SupportRequestFormV2 + : SupportRequestFormManager; + const active = staticView && staticView === supportRequestFormImpl; + return ( + setStaticView(supportRequestFormImpl)}> + + Litho Support Request + + ); + })()} this.props.setActiveSheet(ACTIVE_SHEET_PLUGINS)}>