Skip to content

Commit 44420be

Browse files
Merge pull request #1194 from fabiofranzini/placeholder-control-support-theme
Added Theme support for Placeholder control
2 parents 4f0d6b6 + 7bb3fe0 commit 44420be

File tree

8 files changed

+559
-533
lines changed

8 files changed

+559
-533
lines changed

docs/documentation/docs/controls/Placeholder.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ import { Placeholder } from "@pnp/spfx-controls-react/lib/Placeholder";
2020
iconText='Configure your web part'
2121
description='Please configure the web part.'
2222
buttonLabel='Configure'
23-
onConfigure={this._onConfigure} />
23+
onConfigure={this._onConfigure}
24+
theme={this.props.themeVariant} />
2425
```
2526

2627
- With custom element for `description`:
@@ -30,7 +31,8 @@ import { Placeholder } from "@pnp/spfx-controls-react/lib/Placeholder";
3031
iconText='Configure your web part'
3132
description={defaultClassNames => <span className={`${defaultClassNames} ${additionalStyles}`}>Please configure the web part.</span>}
3233
buttonLabel='Configure'
33-
onConfigure={this._onConfigure} />
34+
onConfigure={this._onConfigure}
35+
theme={this.props.themeVariant} />
3436
```
3537

3638
- With the `onConfigure` property you can define what it needs to do when you click on the button. Like for example opening the property pane:
@@ -50,7 +52,8 @@ Sample of using the `hideButton` functionality for hiding the button when page i
5052
description='Please configure the web part.'
5153
buttonLabel='Configure'
5254
hideButton={this.props.displayMode === DisplayMode.Read}
53-
onConfigure={this._onConfigure} />
55+
onConfigure={this._onConfigure}
56+
theme={this.props.themeVariant} />
5457
```
5558

5659
## Implementation
@@ -66,5 +69,6 @@ The placeholder control can be configured with the following properties:
6669
| iconText | string \| ((defaultClassNames: string) =&gt; React.ReactElement) | yes | Heading text or render function which is displayed next to the icon. |
6770
| hideButton | boolean | no | Specify if you want to hide the button. Default is `false`. |
6871
| onConfigure | function | no | onConfigure handler for the button. The button is optional. |
72+
| theme | IPartialTheme \| ITheme | no | Set Fluent UI Theme. If not set or set to null or not defined, the theme passed through context will be used, or the default theme of the page will be loaded. |
6973

7074
![](https://telemetry.sharepointpnp.com/sp-dev-fx-controls-react/wiki/controls/Placeholder)

0 commit comments

Comments
 (0)