forked from Rabobank-Archive/extension
-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.tsx
executable file
·57 lines (54 loc) · 1.93 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import React, { Component } from "react";
import { HashRouter, Routes, Route } from "react-router-dom";
import * as ReactDOM from "react-dom";
import Repositories from "./Repositories";
import Overview from "./Overview";
import BuildPipelines from "./BuildPipelines";
import ReleasePipelines from "./ReleasePipelines";
import "azure-devops-ui/Core/override.css";
import * as SDK from "azure-devops-extension-sdk";
import { USE_AZDO_SDK } from "./services/Environment";
class App extends Component {
render() {
return (
<HashRouter>
<div className="flex-grow">
<Routes>
<Route
path="/"
element={
<span className="error">
No report specified.
</span>
}
/>
<Route
path="/build-pipelines"
element={<BuildPipelines />}
/>
<Route
path="/release-pipelines"
element={<ReleasePipelines />}
/>
<Route
path="/repositories"
element={<Repositories />}
/>
<Route path="/overview" element={<Overview />} />
</Routes>
</div>
</HashRouter>
);
}
}
if (USE_AZDO_SDK) {
SDK.init();
SDK.ready().then(() => {
// eslint-disable-next-line react/no-deprecated
ReactDOM.render(<App />, document.getElementById("root"));
SDK.notifyLoadSucceeded();
});
} else {
// eslint-disable-next-line react/no-deprecated
ReactDOM.render(<App />, document.getElementById("root"));
}