Merge pull request #1300 from siddharth-vaghasia/react-teams-message

Updated react-teams web part to display web part title like OOTB
This commit is contained in:
Hugo Bernier 2020-05-30 23:15:13 -04:00 committed by GitHub
commit 3546b6c4af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 4 deletions

View File

@ -27,7 +27,11 @@ export default class MyTeamsWebPart extends BaseClientSideWebPart <IMyTeamsWebPa
context: this.context,
webparttitle:this.properties.WebpartTitle,
showdescription:this.properties.ShowDescription,
openpopuponselectingchannel:this.properties.OpenPopupOnSelectingChannel
openpopuponselectingchannel:this.properties.OpenPopupOnSelectingChannel,
displayMode: this.displayMode,
updateProperty: (value: string) => {
this.properties.WebpartTitle = value;
}
}
);

View File

@ -1,8 +1,10 @@
import { WebPartContext } from "@microsoft/sp-webpart-base";
import { DisplayMode } from "@microsoft/sp-core-library";
export interface IMyTeamsProps {
context: WebPartContext;
webparttitle: string;
showdescription:boolean;
openpopuponselectingchannel:boolean;
displayMode:DisplayMode;
updateProperty:(value: string) => void;
}

View File

@ -6,6 +6,7 @@ import { ServiceProvider } from '../../../shared/services/ServiceProvider';
import { TreeView, ITreeItem, TreeItemActionsDisplayMode, TreeViewSelectionMode } from "@pnp/spfx-controls-react/lib/TreeView";
import { PrimaryButton, DefaultButton, Dialog, DialogFooter, DialogType, TextField, MessageBar,MessageBarType } from 'office-ui-fabric-react';
import { initializeIcons } from '@uifabric/icons';
import { WebPartTitle } from "@pnp/spfx-controls-react/lib/WebPartTitle";
export interface IMyTeamsState {
myteams: any[];
@ -127,9 +128,13 @@ export default class MyTeams extends React.Component<IMyTeamsProps, IMyTeamsStat
<React.Fragment>
<div className={styles.myTeams}>
<i className="ms-Icon ms-Icon--TeamsLogo" aria-hidden="true"></i>
<h1 className={styles.webpartitle}>
{/* <h1 className={styles.webpartitle}>
{this.props.webparttitle}</h1>
{this.props.webparttitle}</h1> */}
<WebPartTitle displayMode={this.props.displayMode}
title={this.props.webparttitle}
updateProperty={this.props.updateProperty} />
{this.state.showMessage &&
<React.Fragment>