Skip to content

Commit 2ed3493

Browse files
authored
Office UI Fabric - updated imports and DefaultButton
- updated imports for OUIFR to import controls granularly, not the whole library - `Button` is deprecated; replaced with `DefaultButton`
1 parent e993f77 commit 2ed3493

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

docs/spfx/extensions/guidance/using-custom-dialogs-with-spfx.md

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -103,16 +103,11 @@ In the extension manifest, configure the extension to have only one button. In t
103103
import * as React from 'react';
104104
import * as ReactDOM from 'react-dom';
105105
import { BaseDialog, IDialogConfiguration } from '@microsoft/sp-dialog';
106-
import {
107-
ColorPicker,
108-
PrimaryButton,
109-
Button,
110-
DialogFooter,
111-
DialogContent,
112-
IColor
113-
} from 'office-ui-fabric-react';
114-
115-
```
106+
import { PrimaryButton, DefaultButton } from 'office-ui-fabric-react/lib/Button';
107+
import { ColorPicker } from 'office-ui-fabric-react/lib/ColorPicker';
108+
import { DialogFooter, DialogContent } from 'office-ui-fabric-react/lib/Dialog';
109+
import { IColor } from 'office-ui-fabric-react/lib/Color';
110+
```
116111

117112
3. Add the following interface definition just under the import statements. This is used to pass information and functions between your ListView Command Set extension and your custom dialog box.
118113

@@ -146,7 +141,7 @@ class ColorPickerDialogContent extends React.Component<IColorPickerDialogContent
146141
>
147142
<ColorPicker color={this._pickedColor} onChange={this._onColorChange} />
148143
<DialogFooter>
149-
<Button text='Cancel' title='Cancel' onClick={this.props.close} />
144+
<DefaultButton text='Cancel' title='Cancel' onClick={this.props.close} />
150145
<PrimaryButton text='OK' title='OK' onClick={() => { this.props.submit(this._pickedColor); }} />
151146
</DialogFooter>
152147
</DialogContent>;

0 commit comments

Comments
 (0)