You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
added new dark mode api documentation changes (SharePoint#9257)
* added new dark mode api documentation changes
* added changes to make it more readable
* removed unnecessary code to make it more readable
* added the note
* changed the version of the mentioned spfx package
* updated the link for API
---------
Co-authored-by: Altaf Khan <[email protected]>
Copy file name to clipboardExpand all lines: docs/spfx/viva/design/designing-quick-view.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -93,7 +93,7 @@ Currently dark themes are not supported for quick views on iOS and Android mobil
93
93
94
94
:::image type="content" source="../../../images/viva-design/img_quickview_ios_theme.jpg" alt-text="Screenshot that shows how a card viewed on mobile appears in light mode and dark mode.":::
95
95
96
-
We plan to introduce dark theme support in Quick View in Viva Connections Mobile for both iOS and Android in early Q4 of CY23. The API ([context.hostContext.theme](/javascript/api/sp-adaptive-card-extension-base/ihostcontext)) to get the theme in which Quick View is rendered of the Quick View will be available in SPFx 1.18.0 package.
96
+
We plan to introduce dark theme support in Quick View in Viva Connections Mobile for both iOS and Android in early Q4 of CY23. ([context.sdks.microsoftTeams.teamsJs.app.getContext()](/javascript/api/sp-adaptive-card-extension-base/ipartialsdks?view=sp-typescript-latest)) to get the theme in which Quick View is rendered of the Quick View will be available in SPFx 1.18.1 package.
97
97
98
98
:::image type="content" source="../../../images/viva-design/img_quickview_new_ios_theme.png" alt-text="Screenshot that shows how a card quickview viewed on mobile will appear in light mode and dark mode.":::
Copy file name to clipboardExpand all lines: docs/spfx/viva/get-started/making-quickview-compatable-darkmode-mobile.md
+45-4Lines changed: 45 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ ms.localizationpriority: high
11
11
12
12
To adapt to the dark mode release in Viva Connections Mobile, which is scheduled for early Q4 of Calender Year 23, make sure that your card contents look compatible with both light and dark mode.
13
13
14
-
An API ([context.hostContext.theme](/javascript/api/sp-adaptive-card-extension-base/ihostcontext)) will be available in SPFx 1.18.0 package to get the information about the theme of the mobile app. This helps with using associated assets like images compliant to the theme. If you want to use two different sets of data while keeping the existing view style, follow these steps:
14
+
An API ([context.sdks.microsoftTeams.teamsJs.app.getContext()](/javascript/api/sp-adaptive-card-extension-base/ipartialsdks?view=sp-typescript-latest)) will be available in SPFx 1.18.1 package to get the information about the theme of the mobile app. This helps with using associated assets like images compliant to the theme. If you want to use two different sets of data while keeping the existing view style, follow these steps:
15
15
16
16
- Let’s create a basic card with an image in Quick View. Locate and open the following file: **./src/adaptiveCardExtensions/helloWorld/quickView/template/QuickViewTemplate.json**.
17
17
- Replace the contents of this file with the following JSON:
@@ -53,7 +53,47 @@ An API ([context.hostContext.theme](/javascript/api/sp-adaptive-card-extension-b
53
53
}
54
54
```
55
55
56
-
- Locate and open the following file: **./src/adaptiveCardExtensions/helloWorld/quickView/QuickView.ts**.
56
+
- Locate and open the following file: **./src/adaptiveCardExtensions/helloWorld/helloWorldAdaptiveCardExtension.ts**.
57
+
- Add a new state variable **theme** to the existing interface **IHelloWorldAdaptiveCardExtensionState**.Since the theme API returns a promise, we need to use a state variable to determine the current theme.
@@ -114,4 +155,4 @@ public get data(): IQuickViewData {
114
155
Similarly, we can customize our icons, images, and other elements of Quick View to support both light and dark theme.
115
156
116
157
> [!NOTE]
117
-
> Please note that the value for ‘this.context.hostContext.theme’ is undefined for web and Teams app as they do not support dark theme and is only available for Viva Connections Mobile iOS and Android.
158
+
> Please note that the value for ‘this.context.sdks.microsoftTeams.teamsJs.app.getContext()’ is undefined for web and Teams app as they do not support dark theme and is only available for Viva Connections Mobile iOS and Android.
0 commit comments