Skip to content

Commit dda2df4

Browse files
committed
#316 - Removed color property
1 parent 66c1d07 commit dda2df4

File tree

3 files changed

+3
-10
lines changed

3 files changed

+3
-10
lines changed

docs/documentation/docs/controls/WebPartTitle.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ The WebPartTitle control can be configured with the following properties:
9393
| updateProperty | Function | yes | Function that you can pass to update the title in the root web part. |
9494
| className | string | no | Optional property to specify a custom class that allows you to change the web part title style. |
9595
| placeholder | string | no | Optional property to specify a custom placeholder to display when the title is editable. |
96-
| moreLink | Function \| JSX.Element | no | Optional property to render a _See all_ link in the web part title. |
96+
| themeVariant | IReadonlyTheme | no | The current loaded SharePoint theme/section background (More info: [Supporting section backgrounds](https://docs.microsoft.com/en-us/sharepoint/dev/spfx/web-parts/guidance/supporting-section-backgrounds)). |
97+
| moreLink | Function \| JSX.Element | no | Optional property to render a _See all_ link in the web part title. |
9798

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

src/controls/webPartTitle/WebPartTitle.test.tsx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,6 @@ describe('<WebPartTitle />', () => {
8989
done();
9090
});
9191

92-
it('Check color is used if specified', (done) => {
93-
webparttitle = mount(<WebPartTitle displayMode={DisplayMode.Edit} title={dummyTitle} updateProperty={dummyUpdateFnc} color={dummyColor} />);
94-
expect(webparttitle.find(`div.${styles.webPartTitle}`).prop('style')).property("color").to.equal(dummyColor);
95-
done();
96-
});
97-
9892
it('Check theme\'s color is used if specified', (done) => {
9993
webparttitle = mount(<WebPartTitle displayMode={DisplayMode.Edit} title={dummyTitle} updateProperty={dummyUpdateFnc} themeVariant={{ semanticColors: { bodyText: dummyColor }}} />);
10094
expect(webparttitle.find(`div.${styles.webPartTitle}`).prop('style')).property("color").to.equal(dummyColor);

src/controls/webPartTitle/WebPartTitle.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ export interface IWebPartTitleProps {
1212
placeholder?: string;
1313
moreLink?: JSX.Element | Function;
1414
themeVariant?: any; // TODO: type should be IReadonlyTheme from @microsoft/sp-component-base
15-
color?: string;
1615
}
1716

1817
/**
@@ -46,8 +45,7 @@ export class WebPartTitle extends React.Component<IWebPartTitleProps, {}> {
4645
*/
4746
public render(): React.ReactElement<IWebPartTitleProps> {
4847

49-
const color: string = (!!this.props.themeVariant && this.props.themeVariant.semanticColors.bodyText)
50-
|| this.props.color || null;
48+
const color: string = (!!this.props.themeVariant && this.props.themeVariant.semanticColors.bodyText) || null;
5149

5250
if (this.props.title || this.props.moreLink || this.props.displayMode === DisplayMode.Edit) {
5351
return (

0 commit comments

Comments
 (0)