-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdashboard.js
More file actions
70 lines (59 loc) · 2.08 KB
/
Copy pathdashboard.js
File metadata and controls
70 lines (59 loc) · 2.08 KB
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
58
59
60
61
62
63
64
65
66
67
68
69
70
import {
createBrandImage,
createButton,
createCard,
openExternalUrl,
safeGetChildrenSize,
text,
} from "../core/ui.js";
export function createDashboardPage(onNavigate) {
const root = new Windows.UI.Xaml.Controls.StackPanel();
root.Spacing = 14;
root.Children.Append(text("NativeScript for Windows", 42));
const subtitle = text(
"Build native desktop apps with JavaScript, first-class WinRT interop, and a runtime that feels fast and direct.",
16,
);
subtitle.TextWrapping = Windows.UI.Xaml.TextWrapping.Wrap;
root.Children.Append(subtitle);
root.Children.Append(createBrandImage(380, 200));
root.Children.Append(
createCard(
"Single JavaScript Runtime",
"Use one language across startup, UI composition, interop calls, and event binding.",
),
);
root.Children.Append(
createCard(
"Real Native Controls",
"NavigationView, ToggleSwitch, SplitView, and every WinRT type are available directly from JavaScript.",
),
);
root.Children.Append(
createCard(
"Production-minded Tooling",
"Build from Rust crates, test with sample apps, and iterate quickly without leaving native APIs behind.",
),
);
const ctaRow = new Windows.UI.Xaml.Controls.StackPanel();
ctaRow.Orientation = Windows.UI.Xaml.Controls.Orientation.Horizontal;
ctaRow.Spacing = 8;
ctaRow.Children.Append(
createButton("Explore Components Demo", function () {
if (typeof onNavigate === "function") {
onNavigate("components");
}
}),
);
ctaRow.Children.Append(
createButton("Visit NativeScript.org", function () {
openExternalUrl("https://nativescript.org");
}),
);
root.Children.Append(ctaRow);
root.Children.Append(
text("Copy the patterns from each tab to build your own native app shell.", 13),
);
console.log("NativeScriptWindowsDemo: dashboard children", safeGetChildrenSize(root));
return root;
}