|
1 |
| -import { FontIcon, Nav, ScrollablePane, TooltipDelay, TooltipHost } from '@fluentui/react' |
| 1 | +import { FontIcon, Nav, ScrollablePane, TooltipDelay, TooltipHost, Text, Stack } from '@fluentui/react' |
2 | 2 | import {
|
3 | 3 | IonButton,
|
4 | 4 | IonButtons,
|
5 | 5 | IonContent,
|
6 | 6 | IonHeader,
|
7 | 7 | IonMenu,
|
| 8 | + IonTitle, |
8 | 9 | IonToggle,
|
9 | 10 | IonToolbar,
|
10 | 11 | } from '@ionic/react'
|
@@ -133,45 +134,49 @@ export const FabricNav = () => {
|
133 | 134 | }
|
134 | 135 |
|
135 | 136 | return (
|
136 |
| - <IonMenu contentId='main'> |
| 137 | + <IonMenu contentId="main"> |
137 | 138 | <IonHeader>
|
138 | 139 | <IonToolbar>
|
139 |
| - <IonButtons slot='end'> |
140 |
| - <TooltipHost content={!isDark ? 'Switch to Dark Mode' : 'Switch to Light Mode'} delay={TooltipDelay.zero} > |
141 |
| - <IonToggle onClick={toggleDarkTheme} color='success' checked={isDark}/> |
| 140 | + <IonTitle> |
| 141 | + SP Editor |
| 142 | + <Text style={{ marginLeft: 4 }}>v.{chrome.runtime.getManifest().version}</Text> |
| 143 | + </IonTitle> |
| 144 | + <IonButtons slot="end"> |
| 145 | + <TooltipHost content={!isDark ? 'Switch to Dark Mode' : 'Switch to Light Mode'} delay={TooltipDelay.zero}> |
| 146 | + <IonToggle onClick={toggleDarkTheme} color="success" checked={isDark} /> |
142 | 147 | </TooltipHost>
|
143 |
| - <TooltipHost content='Reload SP Editor' delay={TooltipDelay.zero} > |
| 148 | + <TooltipHost content="Reload SP Editor" delay={TooltipDelay.zero}> |
144 | 149 | <IonButton onClick={() => document.location.reload()}>
|
145 |
| - <FontIcon iconName='Refresh' /> |
| 150 | + <FontIcon iconName="Refresh" /> |
146 | 151 | </IonButton>
|
147 | 152 | </TooltipHost>
|
148 | 153 | </IonButtons>
|
149 | 154 | </IonToolbar>
|
150 | 155 | </IonHeader>
|
151 | 156 | <IonContent no-bounce>
|
152 |
| - <ScrollablePane> |
153 |
| - <Nav |
154 |
| - selectedKey={selectedKey} |
155 |
| - onLinkClick={(event, element) => { |
156 |
| - if (event && element) { |
157 |
| - const menu = document.querySelector('ion-menu') as any |
158 |
| - menu && menu.close() |
159 |
| - event.preventDefault() |
160 |
| - if (element.key && selectedKey !== element.key) { |
161 |
| - dispatch(setLoading(false)) |
162 |
| - navigate(element.url); |
163 |
| - setSelectedKey(element.key) |
| 157 | + <ScrollablePane> |
| 158 | + <Nav |
| 159 | + selectedKey={selectedKey} |
| 160 | + onLinkClick={(event, element) => { |
| 161 | + if (event && element) { |
| 162 | + const menu = document.querySelector('ion-menu') as any; |
| 163 | + menu && menu.close(); |
| 164 | + event.preventDefault(); |
| 165 | + if (element.key && selectedKey !== element.key) { |
| 166 | + dispatch(setLoading(false)); |
| 167 | + navigate(element.url); |
| 168 | + setSelectedKey(element.key); |
| 169 | + } |
164 | 170 | }
|
165 |
| - } |
166 |
| - }} |
167 |
| - groups={[ |
168 |
| - { |
169 |
| - links: navLinks, |
170 |
| - }, |
171 |
| - ]} |
172 |
| - /> |
| 171 | + }} |
| 172 | + groups={[ |
| 173 | + { |
| 174 | + links: navLinks, |
| 175 | + }, |
| 176 | + ]} |
| 177 | + /> |
173 | 178 | </ScrollablePane>
|
174 | 179 | </IonContent>
|
175 | 180 | </IonMenu>
|
176 |
| - ) |
| 181 | + ); |
177 | 182 | };
|
0 commit comments