Make support form and plugin manager accessible
Summary: This diff makes the plugin manager and support form accessible from Sandy. Actually converting them is TODO in T78698507 / T78698498 Reviewed By: cekkaewnumchai Differential Revision: D24620558 fbshipit-source-id: c689d95b638b77ad504915a117e909cf0d88b841
This commit is contained in:
committed by
Facebook GitHub Bot
parent
3484f321af
commit
aef3672235
@@ -24,6 +24,8 @@ import {
|
|||||||
import {SidebarLeft, SidebarRight} from './SandyIcons';
|
import {SidebarLeft, SidebarRight} from './SandyIcons';
|
||||||
import {useDispatch, useStore} from '../utils/useStore';
|
import {useDispatch, useStore} from '../utils/useStore';
|
||||||
import {
|
import {
|
||||||
|
ACTIVE_SHEET_PLUGINS,
|
||||||
|
setActiveSheet,
|
||||||
toggleLeftSidebarVisible,
|
toggleLeftSidebarVisible,
|
||||||
toggleRightSidebarVisible,
|
toggleRightSidebarVisible,
|
||||||
} from '../reducers/application';
|
} from '../reducers/application';
|
||||||
@@ -40,6 +42,10 @@ import config from '../fb-stubs/config';
|
|||||||
import styled from '@emotion/styled';
|
import styled from '@emotion/styled';
|
||||||
import {showEmulatorLauncher} from './appinspect/LaunchEmulator';
|
import {showEmulatorLauncher} from './appinspect/LaunchEmulator';
|
||||||
import {useStore as useReduxStore} from 'react-redux';
|
import {useStore as useReduxStore} from 'react-redux';
|
||||||
|
import SupportRequestFormV2 from '../fb-stubs/SupportRequestFormV2';
|
||||||
|
import {setStaticView} from '../reducers/connections';
|
||||||
|
import {getInstance} from '../fb-stubs/Logger';
|
||||||
|
import {isStaticViewActive} from '../chrome/mainsidebar/sidebarUtils';
|
||||||
|
|
||||||
const LeftRailButtonElem = styled(Button)<{kind?: 'small'}>(({kind}) => ({
|
const LeftRailButtonElem = styled(Button)<{kind?: 'small'}>(({kind}) => ({
|
||||||
width: kind === 'small' ? 32 : 36,
|
width: kind === 'small' ? 32 : 36,
|
||||||
@@ -107,6 +113,7 @@ export function LeftRail({
|
|||||||
toplevelSelection,
|
toplevelSelection,
|
||||||
setToplevelSelection,
|
setToplevelSelection,
|
||||||
}: ToplevelProps) {
|
}: ToplevelProps) {
|
||||||
|
const dispatch = useDispatch();
|
||||||
return (
|
return (
|
||||||
<Layout.Container borderRight padv={12} width={48}>
|
<Layout.Container borderRight padv={12} width={48}>
|
||||||
<Layout.Bottom>
|
<Layout.Bottom>
|
||||||
@@ -119,7 +126,13 @@ export function LeftRail({
|
|||||||
setToplevelSelection('appinspect');
|
setToplevelSelection('appinspect');
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<LeftRailButton icon={<AppstoreOutlined />} title="Plugin Manager" />
|
<LeftRailButton
|
||||||
|
icon={<AppstoreOutlined />}
|
||||||
|
title="Plugin Manager"
|
||||||
|
onClick={() => {
|
||||||
|
dispatch(setActiveSheet(ACTIVE_SHEET_PLUGINS));
|
||||||
|
}}
|
||||||
|
/>
|
||||||
<NotificationButton
|
<NotificationButton
|
||||||
toplevelSelection={toplevelSelection}
|
toplevelSelection={toplevelSelection}
|
||||||
setToplevelSelection={setToplevelSelection}
|
setToplevelSelection={setToplevelSelection}
|
||||||
@@ -135,11 +148,7 @@ export function LeftRail({
|
|||||||
<SetupDoctorButton />
|
<SetupDoctorButton />
|
||||||
<WelcomeScreenButton />
|
<WelcomeScreenButton />
|
||||||
<ShowSettingsButton />
|
<ShowSettingsButton />
|
||||||
<LeftRailButton
|
<SupportFormButton />
|
||||||
icon={<BugOutlined />}
|
|
||||||
small
|
|
||||||
title="Feedback / Bug Reporter"
|
|
||||||
/>
|
|
||||||
<RightSidebarToggleButton />
|
<RightSidebarToggleButton />
|
||||||
<LeftSidebarToggleButton />
|
<LeftSidebarToggleButton />
|
||||||
{config.showLogin && <LoginButton />}
|
{config.showLogin && <LoginButton />}
|
||||||
@@ -282,6 +291,27 @@ function ShowSettingsButton() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function SupportFormButton() {
|
||||||
|
const dispatch = useDispatch();
|
||||||
|
const staticView = useStore((state) => state.connections.staticView);
|
||||||
|
// const isVisible =
|
||||||
|
return (
|
||||||
|
<LeftRailButton
|
||||||
|
icon={<BugOutlined />}
|
||||||
|
small
|
||||||
|
title="Feedback / Bug Reporter"
|
||||||
|
selected={isStaticViewActive(staticView, SupportRequestFormV2)}
|
||||||
|
onClick={() => {
|
||||||
|
getInstance().track('usage', 'support-form-source', {
|
||||||
|
source: 'sidebar',
|
||||||
|
group: undefined,
|
||||||
|
});
|
||||||
|
dispatch(setStaticView(SupportRequestFormV2));
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
function WelcomeScreenButton() {
|
function WelcomeScreenButton() {
|
||||||
const settings = useStore((state) => state.settingsState);
|
const settings = useStore((state) => state.settingsState);
|
||||||
const {showWelcomeAtStartup} = settings;
|
const {showWelcomeAtStartup} = settings;
|
||||||
|
|||||||
Reference in New Issue
Block a user