-
Notifications
You must be signed in to change notification settings - Fork 291
/
index.tsx
42 lines (34 loc) · 1.47 KB
/
index.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
'use strict';
// This must be on top, do not change. Required by webpack.
import '../common/main';
// This must be on top, do not change. Required by webpack.
// eslint-disable-next-line import/order
import '../common/index.css';
import * as React from 'react';
import * as ReactDOM from 'react-dom';
import { Provider } from 'react-redux';
import { IVsCodeApi, PostOffice } from '../react-common/postOffice';
import { detectBaseTheme } from '../react-common/themeDetector';
import { createStore } from './redux/store';
import { getConnectedVariableViewPanel } from './variableViewPanel';
// This special function talks to vscode from a web panel
export declare function acquireVsCodeApi(): IVsCodeApi;
const baseTheme = detectBaseTheme();
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const testMode = (window as any).inTestMode;
// eslint-disable-next-line
const skipDefault = testMode ? false : typeof acquireVsCodeApi !== 'undefined';
// Create the redux store
const postOffice = new PostOffice();
const store = createStore(skipDefault, baseTheme, testMode, postOffice);
// Create a variable view panel connected to the redux store
const ConnectedVariableViewPanel = getConnectedVariableViewPanel();
/* eslint-disable */
ReactDOM.render(
<Provider store={store}>
<ConnectedVariableViewPanel />
</Provider>,
document.getElementById('root') as HTMLElement
);