switch back to a functional component useContext to load context add proptypepull/73/head
parent
a1bab2ed73
commit
1dc30435ff
@ -1,22 +1,28 @@
|
|||||||
/* eslint react/prop-types: 0 */
|
import React, { useContext } from "react";
|
||||||
import React, { Component } from "react";
|
import PropTypes from 'prop-types';
|
||||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||||
import { faGoogleDrive } from "@fortawesome/free-brands-svg-icons";
|
import { faGoogleDrive } from "@fortawesome/free-brands-svg-icons";
|
||||||
|
import { AppContext } from "../../AppContext"
|
||||||
|
|
||||||
class Gform extends Component {
|
const Gform = (props) => {
|
||||||
render () {
|
const context = useContext(AppContext);
|
||||||
return (
|
console.log(context);
|
||||||
<a
|
|
||||||
className={this.props.className}
|
return (
|
||||||
href={this.context.feedbackForm}
|
<a
|
||||||
target="_blank"
|
className={props.className}
|
||||||
rel="noopener noreferrer"
|
href={context.feedbackForm}
|
||||||
>
|
target="_blank"
|
||||||
<FontAwesomeIcon icon={faGoogleDrive} className="mr-2" />
|
rel="noopener noreferrer"
|
||||||
Votre avis nous intéresse !
|
>
|
||||||
</a>
|
<FontAwesomeIcon icon={faGoogleDrive} className="mr-2" />
|
||||||
);
|
Votre avis nous intéresse !
|
||||||
}
|
</a>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Gform.propTypes = {
|
||||||
|
className: PropTypes.string,
|
||||||
|
};
|
||||||
|
|
||||||
export default Gform;
|
export default Gform;
|
||||||
|
Loading…
Reference in new issue