Update WordGameWebPart.ts
This commit is contained in:
parent
fdddea1979
commit
f87f57e0a7
|
@ -8,28 +8,24 @@ import {
|
|||
PropertyPaneCheckbox
|
||||
} from '@microsoft/sp-webpart-base';
|
||||
|
||||
import * as strings from 'WordGameWebPartStrings';
|
||||
import WordGame from './components/WordGame';
|
||||
import { IWordGameProps } from './components/IWordGameProps';
|
||||
import { WordService } from './components/WordService';
|
||||
|
||||
export interface IWordGameWebPartProps {
|
||||
gameTitle: string;
|
||||
enableHighScores: boolean
|
||||
enableHighScores: boolean;
|
||||
}
|
||||
|
||||
export default class WordGameWebPart extends BaseClientSideWebPart<IWordGameWebPartProps> {
|
||||
|
||||
wordGame: WordGame;
|
||||
constructor() {
|
||||
super();
|
||||
public render(): void {
|
||||
if (!this.properties.gameTitle) {
|
||||
this.properties.gameTitle = 'Word Game';
|
||||
}
|
||||
|
||||
public render(): void {
|
||||
if (!this.properties.gameTitle)
|
||||
this.properties.gameTitle='Word Game';
|
||||
if (this.properties.enableHighScores==null)
|
||||
if (this.properties.enableHighScores === undefined) {
|
||||
this.properties.enableHighScores = true;
|
||||
}
|
||||
|
||||
const element: React.ReactElement<IWordGameProps> = React.createElement(
|
||||
WordGame,
|
||||
|
@ -40,9 +36,7 @@ export default class WordGameWebPart extends BaseClientSideWebPart<IWordGameWebP
|
|||
}
|
||||
);
|
||||
|
||||
|
||||
ReactDom.render(element, this.domElement);
|
||||
|
||||
}
|
||||
|
||||
protected onDispose(): void {
|
||||
|
@ -74,7 +68,7 @@ export default class WordGameWebPart extends BaseClientSideWebPart<IWordGameWebP
|
|||
}),
|
||||
PropertyPaneTextField('gameTitle', {
|
||||
label: 'Game Title'
|
||||
}),
|
||||
})
|
||||
]
|
||||
}
|
||||
]
|
||||
|
|
Loading…
Reference in New Issue