Skip to content

Commit b680200

Browse files
committed
refactor: rename NavigraphLogin component
1 parent 7f6427f commit b680200

File tree

3 files changed

+37
-37
lines changed

3 files changed

+37
-37
lines changed

examples/gauge/Components/NavigraphLogin.tsx renamed to examples/gauge/Components/InterfaceSample.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@ import { ComponentProps, DisplayComponent, EventBus, FSComponent, VNode } from "
22
import { CancelToken } from "navigraph/auth"
33
import { packages } from "../Lib/navigraph"
44
import { AuthService } from "../Services/AuthService"
5-
import "./NavigraphLogin.css"
5+
import "./InterfaceSample.css"
66
import { DownloadProgressPhase, NavigraphEventType, NavigraphNavdataInterface } from "@navigraph/msfs-navigation-data-interface"
77
import { Dropdown } from "./Dropdown"
88

9-
interface NavigraphLoginProps extends ComponentProps {
9+
interface InterfaceSampleProps extends ComponentProps {
1010
bus: EventBus
1111
}
1212

13-
export class NavigraphLogin extends DisplayComponent<NavigraphLoginProps> {
13+
export class InterfaceSample extends DisplayComponent<InterfaceSampleProps> {
1414
private readonly textRef = FSComponent.createRef<HTMLDivElement>()
1515
private readonly navdataTextRef = FSComponent.createRef<HTMLDivElement>()
1616
private readonly loginButtonRef = FSComponent.createRef<HTMLButtonElement>()
@@ -24,7 +24,7 @@ export class NavigraphLogin extends DisplayComponent<NavigraphLoginProps> {
2424

2525
private navdataInterface: NavigraphNavdataInterface
2626

27-
constructor(props: NavigraphLoginProps) {
27+
constructor(props: InterfaceSampleProps) {
2828
super(props)
2929

3030
this.navdataInterface = new NavigraphNavdataInterface()

examples/gauge/MyInstrument.tsx

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
1-
/// <reference types="@microsoft/msfs-types/Pages/VCockpit/Core/VCockpit" />
2-
3-
import { EventBus, FSComponent } from "@microsoft/msfs-sdk"
4-
import { NavigraphLogin } from "./Components/NavigraphLogin"
5-
import { AuthService } from "./Services/AuthService"
6-
import "./MyInstrument.css"
7-
8-
class MyInstrument extends BaseInstrument {
9-
private readonly bus: EventBus
10-
11-
constructor() {
12-
super()
13-
14-
this.bus = new EventBus()
15-
}
16-
17-
get templateID(): string {
18-
return "MyInstrument"
19-
}
20-
21-
get isInteractive(): boolean {
22-
return true
23-
}
24-
25-
public connectedCallback(): void {
26-
super.connectedCallback()
27-
28-
AuthService.init(this.bus)
29-
FSComponent.render(<NavigraphLogin bus={this.bus} />, document.getElementById("InstrumentContent"))
30-
}
31-
}
32-
33-
registerInstrument("my-instrument", MyInstrument)
1+
/// <reference types="@microsoft/msfs-types/Pages/VCockpit/Core/VCockpit" />
2+
3+
import { EventBus, FSComponent } from "@microsoft/msfs-sdk"
4+
import { InterfaceSample } from "./Components/InterfaceSample"
5+
import { AuthService } from "./Services/AuthService"
6+
import "./MyInstrument.css"
7+
8+
class MyInstrument extends BaseInstrument {
9+
private readonly bus: EventBus
10+
11+
constructor() {
12+
super()
13+
14+
this.bus = new EventBus()
15+
}
16+
17+
get templateID(): string {
18+
return "MyInstrument"
19+
}
20+
21+
get isInteractive(): boolean {
22+
return true
23+
}
24+
25+
public connectedCallback(): void {
26+
super.connectedCallback()
27+
28+
AuthService.init(this.bus)
29+
FSComponent.render(<InterfaceSample bus={this.bus} />, document.getElementById("InstrumentContent"))
30+
}
31+
}
32+
33+
registerInstrument("my-instrument", MyInstrument)

0 commit comments

Comments
 (0)