microsoft/qdk

Public

mirrored fromhttps://github.com/microsoft/qdkAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
9831093db0098b3a3e55cbadf3929222d7dd4805

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

source/playground/src/nav.tsx

58lines · modecode

1// Copyright (c) Microsoft Corporation.
2// Licensed under the MIT License.
3
4export function Nav(props: {
5 selected: string;
6 navSelected: (name: string) => void;
7 katas: string[];
8 samples: string[];
9 namespaces: string[];
10}) {
11 function onSelected(name: string) {
12 props.navSelected(name);
13 }
14
15 return (
16 <nav class="nav-column">
17 <div class="nav-1">Samples</div>
18
19 {props.samples.map((name) => (
20 <div
21 class={
22 "nav-2 nav-selectable" +
23 (props.selected === "sample-" + name ? " nav-current" : "")
24 }
25 onClick={() => onSelected("sample-" + name)}
26 >
27 {name}
28 </div>
29 ))}
30
31 <div class="nav-1">Tutorials</div>
32 {props.katas.map((name) => (
33 <div
34 class={
35 "nav-2 nav-selectable" +
36 (props.selected === name ? " nav-current" : "")
37 }
38 onClick={() => onSelected(name)}
39 >
40 {name}
41 </div>
42 ))}
43
44 <div class="nav-1">Documentation</div>
45 {props.namespaces.map((name) => (
46 <div
47 class={
48 "nav-2 nav-selectable" +
49 (props.selected === name ? " nav-current" : "")
50 }
51 onClick={() => onSelected(name)}
52 >
53 {name}
54 </div>
55 ))}
56 </nav>
57 );
58}
59