From 2c976546c773e315c0f2d087e1efa69e78f72626 Mon Sep 17 00:00:00 2001 From: Anton Nikolaev Date: Tue, 14 Dec 2021 09:03:02 -0800 Subject: [PATCH] Redirect to Support Entry Point Reviewed By: mweststrate Differential Revision: D33091179 fbshipit-source-id: da0c3e5fc21eef1693f7da2d00d90347bf2e0b51 --- .../src/fb-stubs/createPaste.tsx | 12 ++++++++++ .../src/fb-stubs/openSupportRequestForm.tsx | 22 +++++++++++++++++++ .../src/sandy-chrome/LeftRail.tsx | 11 +++++++++- 3 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 desktop/flipper-ui-core/src/fb-stubs/openSupportRequestForm.tsx diff --git a/desktop/flipper-ui-core/src/fb-stubs/createPaste.tsx b/desktop/flipper-ui-core/src/fb-stubs/createPaste.tsx index 172def06b..6606e3e2c 100644 --- a/desktop/flipper-ui-core/src/fb-stubs/createPaste.tsx +++ b/desktop/flipper-ui-core/src/fb-stubs/createPaste.tsx @@ -12,3 +12,15 @@ export default function createPaste( ): Promise { return Promise.reject(new Error('Not implemented!')); } + +export type CreatePasteResult = { + number: number; + url: string; +}; + +export async function createPasteWithDetails(_details: { + title?: string; + content: string; +}): Promise { + return Promise.reject(new Error('Not implemented!')); +} diff --git a/desktop/flipper-ui-core/src/fb-stubs/openSupportRequestForm.tsx b/desktop/flipper-ui-core/src/fb-stubs/openSupportRequestForm.tsx new file mode 100644 index 000000000..e15928a7e --- /dev/null +++ b/desktop/flipper-ui-core/src/fb-stubs/openSupportRequestForm.tsx @@ -0,0 +1,22 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + */ + +import {State} from '../reducers'; + +export type SupportRequestDetails = { + title?: string; + whatAlreadyTried?: string; +}; + +export default function openSupportRequestForm( + _state: State, + _details?: SupportRequestDetails, +): void { + throw new Error('Not implemented!'); +} diff --git a/desktop/flipper-ui-core/src/sandy-chrome/LeftRail.tsx b/desktop/flipper-ui-core/src/sandy-chrome/LeftRail.tsx index c1be6d0a9..524564ae5 100644 --- a/desktop/flipper-ui-core/src/sandy-chrome/LeftRail.tsx +++ b/desktop/flipper-ui-core/src/sandy-chrome/LeftRail.tsx @@ -67,6 +67,7 @@ import { import {openDeeplinkDialog} from '../deeplink'; import {css} from '@emotion/css'; import {getRenderHostInstance} from '../RenderHost'; +import openSupportRequestForm from '../fb-stubs/openSupportRequestForm'; const LeftRailButtonElem = styled(Button)<{kind?: 'small'}>(({kind}) => ({ width: kind === 'small' ? 32 : 36, @@ -240,6 +241,8 @@ function ExtrasMenu() { const {showWelcomeAtStartup} = settings; const [welcomeVisible, setWelcomeVisible] = useState(showWelcomeAtStartup); + const fullState = useStore((state) => state); + return ( <> Feedback