Skip to content
This repository has been archived by the owner on Dec 23, 2021. It is now read-only.

Commit

Permalink
Remove tabs from webview
Browse files Browse the repository at this point in the history
  • Loading branch information
xnkevinnguyen committed Feb 14, 2020
1 parent 3de8c7f commit da37af1
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 134 deletions.
22 changes: 1 addition & 21 deletions src/view/App.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

import { PivotItem } from "office-ui-fabric-react";

import * as React from "react";
import "./App.css";
import { Tab } from "./components/tab/Tab";
import {
DEVICE_LIST_KEY,
VSCODE_MESSAGES_TO_WEBVIEW,
WEBVIEW_MESSAGES,
} from "./constants";
import { DEVICE_LIST_KEY, VSCODE_MESSAGES_TO_WEBVIEW } from "./constants";
import { Device } from "./container/device/Device";
import { sendMessage } from "./utils/MessageUtils";

interface IState {
currentDevice: string;
Expand Down Expand Up @@ -47,24 +39,12 @@ class App extends React.Component<{}, IState> {
return (
<div className="App">
<main className="App-main">
<Tab
handleTabClick={this.handleDeviceChange}
currentActiveDevice={this.state.currentDevice}
/>
<Device currentSelectedDevice={this.state.currentDevice} />
</main>
</div>
);
}

handleDeviceChange = (item?: PivotItem) => {
if (item && item.props && item.props.itemKey) {
sendMessage(WEBVIEW_MESSAGES.SWITCH_DEVICE, {
active_device: item.props.itemKey,
});
this.setState({ currentDevice: item.props.itemKey });
}
};
handleMessage = (event: any): void => {
const message = event.data;
console.log(JSON.stringify(message));
Expand Down
87 changes: 0 additions & 87 deletions src/view/__snapshots__/App.spec.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -7,93 +7,6 @@ exports[`App component should render correctly 1`] = `
<main
className="App-main"
>
<div
role="toolbar"
>
<div
className="ms-FocusZone css-56"
data-focuszone-id="FocusZone2"
onFocus={[Function]}
onKeyDown={[Function]}
onMouseDownCapture={[Function]}
>
<div
className="ms-Pivot ms-Pivot--tabs root-49"
role="tablist"
>
<button
aria-selected={true}
className="ms-Button ms-Button--action ms-Button--command ms-Pivot-link is-selected linkIsSelected-57"
data-content="CPX"
data-is-focusable={true}
id="Pivot1-Tab0"
name="CPX"
onClick={[Function]}
onKeyDown={[Function]}
onKeyPress={[Function]}
onKeyUp={[Function]}
onMouseDown={[Function]}
onMouseUp={[Function]}
role="tab"
type="button"
>
<span
className="ms-Button-flexContainer flexContainer-58"
data-automationid="splitbuttonprimary"
>
<span
className="ms-Pivot-linkContent linkContent-52"
>
<span
className="ms-Pivot-text text-53"
>
CPX
</span>
</span>
</span>
</button>
<button
aria-selected={false}
className="ms-Button ms-Button--action ms-Button--command ms-Pivot-link link-65"
data-content="micro:bit"
data-is-focusable={true}
id="Pivot1-Tab1"
name="micro:bit"
onClick={[Function]}
onKeyDown={[Function]}
onKeyPress={[Function]}
onKeyUp={[Function]}
onMouseDown={[Function]}
onMouseUp={[Function]}
role="tab"
type="button"
>
<span
className="ms-Button-flexContainer flexContainer-58"
data-automationid="splitbuttonprimary"
>
<span
className="ms-Pivot-linkContent linkContent-52"
>
<span
className="ms-Pivot-text text-53"
>
micro:bit
</span>
</span>
</span>
</button>
</div>
</div>
<div
aria-labelledby="Pivot1-Tab0"
role="tabpanel"
>
<div />
</div>
</div>
<div
className="device-container"
>
Expand Down
26 changes: 0 additions & 26 deletions src/view/components/tab/Tab.tsx

This file was deleted.

0 comments on commit da37af1

Please sign in to comment.