Merge pull request #2190 from yhabersaat/react-quotes-spfx-upgrade
react-quotes - Upgrade sample to SPFx v1.13.1 (Node.js 14)
This commit is contained in:
commit
0b055b56ad
|
@ -1,25 +0,0 @@
|
||||||
# EditorConfig helps developers define and maintain consistent
|
|
||||||
# coding styles between different editors and IDEs
|
|
||||||
# editorconfig.org
|
|
||||||
|
|
||||||
root = true
|
|
||||||
|
|
||||||
|
|
||||||
[*]
|
|
||||||
|
|
||||||
# change these settings to your own preference
|
|
||||||
indent_style = space
|
|
||||||
indent_size = 2
|
|
||||||
|
|
||||||
# we recommend you to keep these unchanged
|
|
||||||
end_of_line = lf
|
|
||||||
charset = utf-8
|
|
||||||
trim_trailing_whitespace = true
|
|
||||||
insert_final_newline = true
|
|
||||||
|
|
||||||
[*.md]
|
|
||||||
trim_trailing_whitespace = false
|
|
||||||
|
|
||||||
[{package,bower}.json]
|
|
||||||
indent_style = space
|
|
||||||
indent_size = 2
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
!dist
|
||||||
|
config
|
||||||
|
|
||||||
|
gulpfile.js
|
||||||
|
|
||||||
|
release
|
||||||
|
src
|
||||||
|
temp
|
||||||
|
|
||||||
|
tsconfig.json
|
||||||
|
tslint.json
|
||||||
|
|
||||||
|
*.log
|
||||||
|
|
||||||
|
.yo-rc.json
|
||||||
|
.vscode
|
|
@ -4,23 +4,7 @@
|
||||||
* Chrome browser: https://aka.ms/spfx-debugger-extensions
|
* Chrome browser: https://aka.ms/spfx-debugger-extensions
|
||||||
*/
|
*/
|
||||||
"version": "0.2.0",
|
"version": "0.2.0",
|
||||||
"configurations": [{
|
"configurations": [
|
||||||
"name": "Local workbench",
|
|
||||||
"type": "chrome",
|
|
||||||
"request": "launch",
|
|
||||||
"url": "https://localhost:4321/temp/workbench.html",
|
|
||||||
"webRoot": "${workspaceRoot}",
|
|
||||||
"sourceMaps": true,
|
|
||||||
"sourceMapPathOverrides": {
|
|
||||||
"webpack:///.././src/*": "${webRoot}/src/*",
|
|
||||||
"webpack:///../../../src/*": "${webRoot}/src/*",
|
|
||||||
"webpack:///../../../../src/*": "${webRoot}/src/*",
|
|
||||||
"webpack:///../../../../../src/*": "${webRoot}/src/*"
|
|
||||||
},
|
|
||||||
"runtimeArgs": [
|
|
||||||
"--remote-debugging-port=9222"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "Hosted workbench",
|
"name": "Hosted workbench",
|
||||||
"type": "chrome",
|
"type": "chrome",
|
||||||
|
|
|
@ -2,11 +2,11 @@
|
||||||
"@microsoft/generator-sharepoint": {
|
"@microsoft/generator-sharepoint": {
|
||||||
"isCreatingSolution": true,
|
"isCreatingSolution": true,
|
||||||
"environment": "spo",
|
"environment": "spo",
|
||||||
"version": "1.9.1",
|
"version": "1.13.1",
|
||||||
"libraryName": "react-quotes",
|
"libraryName": "react-quotes",
|
||||||
"libraryId": "aa9211b8-e9b8-44bf-a804-af2db58bc03e",
|
"libraryId": "aa9211b8-e9b8-44bf-a804-af2db58bc03e",
|
||||||
"packageManager": "npm",
|
"packageManager": "npm",
|
||||||
"isDomainIsolated": false,
|
"isDomainIsolated": false,
|
||||||
"componentType": "webpart"
|
"componentType": "webpart"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,12 +9,11 @@ This web part displays a quote of the day by querying a third-party api or can d
|
||||||
|
|
||||||
# Compatibility
|
# Compatibility
|
||||||
|
|
||||||
![SPFx 1.9.1](https://img.shields.io/badge/SPFx-1.9.1-green.svg)
|
![SPFx 1.13.1](https://img.shields.io/badge/SPFx-1.13.1-green.svg)
|
||||||
![Node.js v10 | v8](https://img.shields.io/badge/Node.js-v10%20%7C%20v8-green.svg)
|
![Node.js v14](https://img.shields.io/badge/Node.js-v14-green.svg)
|
||||||
![Compatible with SharePoint Online](https://img.shields.io/badge/SharePoint%20Online-Compatible-green.svg)
|
![Compatible with SharePoint Online](https://img.shields.io/badge/SharePoint%20Online-Compatible-green.svg)
|
||||||
![Does not work with with SharePoint 2019](https://img.shields.io/badge/SharePoint%20Server%202019-Incompatible-red.svg)
|
![Does not work with with SharePoint 2019](https://img.shields.io/badge/SharePoint%20Server%202019-Incompatible-red.svg)
|
||||||
![Does not work with SharePoint 2016 (Feature Pack 2)](https://img.shields.io/badge/SharePoint%20Server%202016%20(Feature%20Pack%202)-Incompatible-red.svg "SharePoint Server 2016 Feature Pack 2 requires SPFx 1.1")
|
![Does not work with SharePoint 2016 (Feature Pack 2)](https://img.shields.io/badge/SharePoint%20Server%202016%20(Feature%20Pack%202)-Incompatible-red.svg "SharePoint Server 2016 Feature Pack 2 requires SPFx 1.1")
|
||||||
![Local Workbench Compatible](https://img.shields.io/badge/Local%20Workbench-Compatible-green.svg)
|
|
||||||
![Hosted Workbench Compatible](https://img.shields.io/badge/Hosted%20Workbench-Compatible-green.svg)
|
![Hosted Workbench Compatible](https://img.shields.io/badge/Hosted%20Workbench-Compatible-green.svg)
|
||||||
|
|
||||||
## Applies to
|
## Applies to
|
||||||
|
@ -25,12 +24,14 @@ This web part displays a quote of the day by querying a third-party api or can d
|
||||||
|
|
||||||
Solution|Author(s)
|
Solution|Author(s)
|
||||||
--------|---------
|
--------|---------
|
||||||
react-quotes | Zach Roberts
|
react-quotes | [Zach Roberts](https://github.com/zachroberts8668)
|
||||||
|
react-quotes | [Yves Habersaat](https://github.com/yhabersaat)
|
||||||
|
|
||||||
## Version history
|
## Version history
|
||||||
|
|
||||||
Version|Date|Comments
|
Version|Date|Comments
|
||||||
-------|----|--------
|
-------|----|--------
|
||||||
|
1.1| December 31, 2021| Upgraded for SPFx v1.13.1
|
||||||
1.0| November 11, 2019| Initial Release
|
1.0| November 11, 2019| Initial Release
|
||||||
|
|
||||||
## Minimal Path to Awesome
|
## Minimal Path to Awesome
|
||||||
|
@ -47,9 +48,27 @@ Version|Date|Comments
|
||||||
This web part loads a random quote from a third-party api (https://favqs.com/api). Additionally a quote can be entered manually and the text color of the quote and author can be adjusted through the web part properties.
|
This web part loads a random quote from a third-party api (https://favqs.com/api). Additionally a quote can be entered manually and the text color of the quote and author can be adjusted through the web part properties.
|
||||||
|
|
||||||
|
|
||||||
|
## Help
|
||||||
|
|
||||||
|
|
||||||
|
We do not support samples, but this community is always willing to help, and we want to improve these samples. We use GitHub to track issues, which makes it easy for community members to volunteer their time and help resolve issues.
|
||||||
|
|
||||||
|
If you're having issues building the solution, please run [spfx doctor](https://pnp.github.io/cli-microsoft365/cmd/spfx/spfx-doctor/) from within the solution folder to diagnose incompatibility issues with your environment.
|
||||||
|
|
||||||
|
You can try looking at [issues related to this sample](https://github.com/pnp/sp-dev-fx-webparts/issues?q=label%3A%22sample%3A%20react-quotes%22) to see if anybody else is having the same issues.
|
||||||
|
|
||||||
|
You can also try looking at [discussions related to this sample](https://github.com/pnp/sp-dev-fx-webparts/discussions?discussions_q=react-quotes) and see what the community is saying.
|
||||||
|
|
||||||
|
If you encounter any issues while using this sample, [create a new issue](https://github.com/pnp/sp-dev-fx-webparts/issues/new?assignees=&labels=Needs%3A+Triage+%3Amag%3A%2Ctype%3Abug-suspected%2Csample%3A%20react-quotes&template=bug-report.yml&sample=react-quotes&authors=@zachroberts8668 @yhabersaat&title=react-quotes%20-%20).
|
||||||
|
|
||||||
|
For questions regarding this sample, [create a new question](https://github.com/pnp/sp-dev-fx-webparts/issues/new?assignees=&labels=Needs%3A+Triage+%3Amag%3A%2Ctype%3Aquestion%2Csample%3A%20react-quotes&template=question.yml&sample=react-quotes&authors=@zachroberts8668 @yhabersaat&title=react-quotes%20-%20).
|
||||||
|
|
||||||
|
Finally, if you have an idea for improvement, [make a suggestion](https://github.com/pnp/sp-dev-fx-webparts/issues/new?assignees=&labels=Needs%3A+Triage+%3Amag%3A%2Ctype%3Aenhancement%2Csample%3A%20react-quotes&template=suggestion.yml&sample=react-quotes&authors=@zachroberts8668 @yhabersaat&title=react-quotes%20-%20).
|
||||||
|
|
||||||
|
|
||||||
## Disclaimer
|
## Disclaimer
|
||||||
|
|
||||||
**THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.**
|
**THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.**
|
||||||
|
|
||||||
|
|
||||||
<img src="https://pnptelemetry.azurewebsites.net/sp-dev-fx-webparts/samples/readme-template" />
|
<img src="https://pnptelemetry.azurewebsites.net/sp-dev-fx-webparts/samples/react-quotes" />
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
"This webpart displays a quote of the day by querying a third-party api or can display a quote entered manually into the webpart property pane."
|
"This webpart displays a quote of the day by querying a third-party api or can display a quote entered manually into the webpart property pane."
|
||||||
],
|
],
|
||||||
"creationDateTime": "2019-11-11",
|
"creationDateTime": "2019-11-11",
|
||||||
"updateDateTime": "2019-11-11",
|
"updateDateTime": "2022-01-01",
|
||||||
"products": [
|
"products": [
|
||||||
"SharePoint"
|
"SharePoint"
|
||||||
],
|
],
|
||||||
|
@ -20,7 +20,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": "SPFX-VERSION",
|
"key": "SPFX-VERSION",
|
||||||
"value": "1.9.1"
|
"value": "1.13.1"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": "PNPCONTROLS",
|
"key": "PNPCONTROLS",
|
||||||
|
@ -41,6 +41,11 @@
|
||||||
"company": "",
|
"company": "",
|
||||||
"pictureUrl": "https://github.com/zachroberts8668.png",
|
"pictureUrl": "https://github.com/zachroberts8668.png",
|
||||||
"name": "Zach Roberts"
|
"name": "Zach Roberts"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"gitHubAccount": "yhabersaat",
|
||||||
|
"pictureUrl": "https://github.com/yhabersaat",
|
||||||
|
"name": "Yves Habersaat"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"references": [
|
"references": [
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"$schema": "https://developer.microsoft.com/json-schemas/spfx-build/deploy-azure-storage.schema.json",
|
"$schema": "https://developer.microsoft.com/json-schemas/spfx-build/deploy-azure-storage.schema.json",
|
||||||
"workingDir": "./temp/deploy/",
|
"workingDir": "./release/assets/",
|
||||||
"account": "<!-- STORAGE ACCOUNT NAME -->",
|
"account": "<!-- STORAGE ACCOUNT NAME -->",
|
||||||
"container": "react-quotes",
|
"container": "react-quotes",
|
||||||
"accessKey": "<!-- ACCESS KEY -->"
|
"accessKey": "<!-- ACCESS KEY -->"
|
||||||
|
|
|
@ -3,9 +3,16 @@
|
||||||
"solution": {
|
"solution": {
|
||||||
"name": "react-quotes-client-side-solution",
|
"name": "react-quotes-client-side-solution",
|
||||||
"id": "aa9211b8-e9b8-44bf-a804-af2db58bc03e",
|
"id": "aa9211b8-e9b8-44bf-a804-af2db58bc03e",
|
||||||
"version": "1.0.0.0",
|
"version": "1.1.0.0",
|
||||||
"includeClientSideAssets": true,
|
"includeClientSideAssets": true,
|
||||||
"isDomainIsolated": false
|
"isDomainIsolated": false,
|
||||||
|
"developer": {
|
||||||
|
"name": "Zach Roberts",
|
||||||
|
"privacyUrl": "",
|
||||||
|
"termsOfUseUrl": "",
|
||||||
|
"websiteUrl": "",
|
||||||
|
"mpnId": ""
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"paths": {
|
"paths": {
|
||||||
"zippedPackage": "solution/react-quotes.sppkg"
|
"zippedPackage": "solution/react-quotes.sppkg"
|
||||||
|
|
|
@ -2,9 +2,5 @@
|
||||||
"$schema": "https://developer.microsoft.com/json-schemas/core-build/serve.schema.json",
|
"$schema": "https://developer.microsoft.com/json-schemas/core-build/serve.schema.json",
|
||||||
"port": 4321,
|
"port": 4321,
|
||||||
"https": true,
|
"https": true,
|
||||||
"initialPage": "https://localhost:5432/workbench",
|
"initialPage": "https://enter-your-SharePoint-site/_layouts/workbench.aspx"
|
||||||
"api": {
|
|
||||||
"port": 5432,
|
|
||||||
"entryPath": "node_modules/@microsoft/sp-webpart-workbench/lib/api/"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,4 +4,13 @@ const gulp = require('gulp');
|
||||||
const build = require('@microsoft/sp-build-web');
|
const build = require('@microsoft/sp-build-web');
|
||||||
build.addSuppression(`Warning - [sass] The local CSS class 'ms-Grid' is not camelCase and will not be type-safe.`);
|
build.addSuppression(`Warning - [sass] The local CSS class 'ms-Grid' is not camelCase and will not be type-safe.`);
|
||||||
|
|
||||||
|
var getTasks = build.rig.getTasks;
|
||||||
|
build.rig.getTasks = function () {
|
||||||
|
var result = getTasks.call(build.rig);
|
||||||
|
|
||||||
|
result.set('serve', result.get('serve-deprecated'));
|
||||||
|
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
|
||||||
build.initialize(gulp);
|
build.initialize(gulp);
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -12,32 +12,27 @@
|
||||||
"test": "gulp test"
|
"test": "gulp test"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@microsoft/sp-core-library": "1.9.1",
|
"@microsoft/sp-core-library": "1.13.1",
|
||||||
"@microsoft/sp-lodash-subset": "1.9.1",
|
"@microsoft/sp-lodash-subset": "1.13.1",
|
||||||
"@microsoft/sp-office-ui-fabric-core": "1.9.1",
|
"@microsoft/sp-office-ui-fabric-core": "1.13.1",
|
||||||
"@microsoft/sp-webpart-base": "1.9.1",
|
"@microsoft/sp-property-pane": "1.13.1",
|
||||||
|
"@microsoft/sp-webpart-base": "1.13.1",
|
||||||
"@pnp/spfx-property-controls": "1.16.0",
|
"@pnp/spfx-property-controls": "1.16.0",
|
||||||
"@types/es6-promise": "0.0.33",
|
|
||||||
"@types/react": "16.8.8",
|
|
||||||
"@types/react-dom": "16.8.3",
|
|
||||||
"@types/webpack-env": "1.13.1",
|
|
||||||
"axios": "^0.19.0",
|
"axios": "^0.19.0",
|
||||||
"office-ui-fabric-react": "6.189.2",
|
"office-ui-fabric-react": "7.174.1",
|
||||||
"react": "16.8.5",
|
"react": "16.13.1",
|
||||||
"react-dom": "16.8.5"
|
"react-dom": "16.13.1"
|
||||||
},
|
|
||||||
"resolutions": {
|
|
||||||
"@types/react": "16.8.8"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@microsoft/sp-build-web": "1.9.1",
|
"@types/react": "16.8.8",
|
||||||
"@microsoft/sp-tslint-rules": "1.9.1",
|
"@types/react-dom": "^17.0.11",
|
||||||
"@microsoft/sp-module-interfaces": "1.9.1",
|
"@microsoft/sp-build-web": "1.13.1",
|
||||||
"@microsoft/sp-webpart-workbench": "1.9.1",
|
"@microsoft/sp-module-interfaces": "1.13.1",
|
||||||
"@microsoft/rush-stack-compiler-2.9": "0.7.16",
|
"@microsoft/sp-tslint-rules": "1.13.1",
|
||||||
"gulp": "~3.9.1",
|
"@microsoft/rush-stack-compiler-3.9": "0.4.47",
|
||||||
"@types/chai": "3.4.34",
|
"@types/es6-promise": "0.0.33",
|
||||||
"@types/mocha": "2.2.38",
|
"@types/webpack-env": "1.13.1",
|
||||||
"ajv": "~5.2.2"
|
"ajv": "~5.2.2",
|
||||||
|
"gulp": "4.0.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,17 +1,12 @@
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import * as ReactDom from 'react-dom';
|
import * as ReactDom from 'react-dom';
|
||||||
import { Version } from '@microsoft/sp-core-library';
|
import { Version } from '@microsoft/sp-core-library';
|
||||||
import {
|
import { BaseClientSideWebPart } from '@microsoft/sp-webpart-base';
|
||||||
BaseClientSideWebPart,
|
|
||||||
IPropertyPaneConfiguration,
|
|
||||||
PropertyPaneTextField
|
|
||||||
} from '@microsoft/sp-webpart-base';
|
|
||||||
|
|
||||||
import * as strings from 'ReactQuotesWebPartStrings';
|
import * as strings from 'ReactQuotesWebPartStrings';
|
||||||
import ReactQuotes from './components/ReactQuotes';
|
import ReactQuotes from './components/ReactQuotes';
|
||||||
import { IReactQuotesProps } from './components/IReactQuotesProps';
|
import { IReactQuotesProps } from './components/IReactQuotesProps';
|
||||||
import { PropertyFieldColorPicker, PropertyFieldColorPickerStyle } from '@pnp/spfx-property-controls/lib/PropertyFieldColorPicker';
|
import { PropertyFieldColorPicker } from '@pnp/spfx-property-controls/lib/PropertyFieldColorPicker';
|
||||||
import { PropertyPaneToggle } from '@microsoft/sp-property-pane';
|
import { PropertyPaneToggle, IPropertyPaneConfiguration, PropertyPaneTextField } from '@microsoft/sp-property-pane';
|
||||||
|
|
||||||
export interface IReactQuotesWebPartProps {
|
export interface IReactQuotesWebPartProps {
|
||||||
description: string;
|
description: string;
|
||||||
|
@ -25,7 +20,7 @@ export interface IReactQuotesWebPartProps {
|
||||||
export default class ReactQuotesWebPart extends BaseClientSideWebPart<IReactQuotesWebPartProps> {
|
export default class ReactQuotesWebPart extends BaseClientSideWebPart<IReactQuotesWebPartProps> {
|
||||||
|
|
||||||
public render(): void {
|
public render(): void {
|
||||||
const element: React.ReactElement<IReactQuotesProps > = React.createElement(
|
const element: React.ReactElement<IReactQuotesProps> = React.createElement(
|
||||||
ReactQuotes,
|
ReactQuotes,
|
||||||
{
|
{
|
||||||
description: this.properties.description,
|
description: this.properties.description,
|
||||||
|
|
|
@ -2,13 +2,12 @@ import * as React from 'react';
|
||||||
import styles from './ReactQuotes.module.scss';
|
import styles from './ReactQuotes.module.scss';
|
||||||
import { IReactQuotesProps } from './IReactQuotesProps';
|
import { IReactQuotesProps } from './IReactQuotesProps';
|
||||||
import { IReactQuotesState } from './IReactQuotesState';
|
import { IReactQuotesState } from './IReactQuotesState';
|
||||||
import { escape } from '@microsoft/sp-lodash-subset';
|
import { Spinner } from 'office-ui-fabric-react/lib/Spinner';
|
||||||
import { Spinner } from 'office-ui-fabric-react/lib/spinner';
|
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
|
||||||
export default class ReactQuotes extends React.Component<IReactQuotesProps, IReactQuotesState> {
|
export default class ReactQuotes extends React.Component<IReactQuotesProps, IReactQuotesState> {
|
||||||
|
|
||||||
constructor(props: IReactQuotesProps){
|
constructor(props: IReactQuotesProps) {
|
||||||
super(props);
|
super(props);
|
||||||
|
|
||||||
this.state = {
|
this.state = {
|
||||||
|
@ -20,26 +19,26 @@ export default class ReactQuotes extends React.Component<IReactQuotesProps, IRea
|
||||||
|
|
||||||
public render(): React.ReactElement<IReactQuotesProps> {
|
public render(): React.ReactElement<IReactQuotesProps> {
|
||||||
return (
|
return (
|
||||||
<div className={ styles.reactQuotes }>
|
<div className={styles.reactQuotes}>
|
||||||
<h2>{this.props.description}</h2>
|
<h2>{this.props.description}</h2>
|
||||||
{this.state.loading !== true ?
|
{this.state.loading !== true ?
|
||||||
//If state is loading show spinner otherwise show quote
|
//If state is loading show spinner otherwise show quote
|
||||||
<div>
|
|
||||||
{this.props.manual !== true ?
|
|
||||||
//If manual quote is not on then show quote generated from third party
|
|
||||||
<div>
|
<div>
|
||||||
<h3 style={{color: this.props.quoteColor}}>"<i>{this.state.quote}</i>"</h3>
|
{this.props.manual !== true ?
|
||||||
<h5 style={{color: this.props.authorColor}}>- {this.state.author}</h5>
|
//If manual quote is not on then show quote generated from third party
|
||||||
|
<div>
|
||||||
|
<h3 style={{ color: this.props.quoteColor }}>"<i>{this.state.quote}</i>"</h3>
|
||||||
|
<h5 style={{ color: this.props.authorColor }}>- {this.state.author}</h5>
|
||||||
|
</div>
|
||||||
|
: //Show Manual quote
|
||||||
|
<div>
|
||||||
|
<h3 style={{ color: this.props.quoteColor }}>"<i>{this.props.manualQuote}</i>"</h3>
|
||||||
|
<h5 style={{ color: this.props.authorColor }}>- {this.props.manualAuthor}</h5>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
: //Show Manual quote
|
:
|
||||||
<div>
|
<div>
|
||||||
<h3 style={{color: this.props.quoteColor}}>"<i>{this.props.manualQuote}</i>"</h3>
|
|
||||||
<h5 style={{color: this.props.authorColor}}>- {this.props.manualAuthor}</h5>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
:
|
|
||||||
<div>
|
|
||||||
<Spinner label="Loading quote..." />
|
<Spinner label="Loading quote..." />
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
@ -47,9 +46,9 @@ export default class ReactQuotes extends React.Component<IReactQuotesProps, IRea
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public componentDidMount() {
|
public componentDidMount() {
|
||||||
console.log(this.props.manual);
|
console.log(this.props.manual);
|
||||||
this.setState({loading: true});
|
this.setState({ loading: true });
|
||||||
axios.get('https://favqs.com/api/qotd').then(res => {
|
axios.get('https://favqs.com/api/qotd').then(res => {
|
||||||
const quote = res.data.quote.body;
|
const quote = res.data.quote.body;
|
||||||
const author = res.data.quote.author;
|
const author = res.data.quote.author;
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 10 KiB |
Binary file not shown.
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 542 B |
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"extends": "./node_modules/@microsoft/rush-stack-compiler-2.9/includes/tsconfig-web.json",
|
"extends": "./node_modules/@microsoft/rush-stack-compiler-3.9/includes/tsconfig-web.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"target": "es5",
|
"target": "es5",
|
||||||
"forceConsistentCasingInFileNames": true,
|
"forceConsistentCasingInFileNames": true,
|
||||||
|
@ -19,20 +19,17 @@
|
||||||
"./node_modules/@microsoft"
|
"./node_modules/@microsoft"
|
||||||
],
|
],
|
||||||
"types": [
|
"types": [
|
||||||
"es6-promise",
|
|
||||||
"webpack-env"
|
"webpack-env"
|
||||||
],
|
],
|
||||||
"lib": [
|
"lib": [
|
||||||
"es5",
|
"es5",
|
||||||
"dom",
|
"dom",
|
||||||
"es2015.collection"
|
"es2015.collection",
|
||||||
|
"es2015.promise"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"include": [
|
"include": [
|
||||||
"src/**/*.ts"
|
"src/**/*.ts",
|
||||||
],
|
"src/**/*.tsx"
|
||||||
"exclude": [
|
|
||||||
"node_modules",
|
|
||||||
"lib"
|
|
||||||
]
|
]
|
||||||
}
|
}
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"extends": "@microsoft/sp-tslint-rules/base-tslint.json",
|
"extends": "./node_modules/@microsoft/sp-tslint-rules/base-tslint.json",
|
||||||
"rules": {
|
"rules": {
|
||||||
"class-name": false,
|
"class-name": false,
|
||||||
"export-name": false,
|
"export-name": false,
|
||||||
|
@ -17,7 +17,6 @@
|
||||||
"no-switch-case-fall-through": true,
|
"no-switch-case-fall-through": true,
|
||||||
"no-unnecessary-semicolons": true,
|
"no-unnecessary-semicolons": true,
|
||||||
"no-unused-expression": true,
|
"no-unused-expression": true,
|
||||||
"no-use-before-declare": true,
|
|
||||||
"no-with-statement": true,
|
"no-with-statement": true,
|
||||||
"semicolon": true,
|
"semicolon": true,
|
||||||
"trailing-comma": false,
|
"trailing-comma": false,
|
||||||
|
|
Loading…
Reference in New Issue