Browse Source

fix(feedback-form): move link to process env (#47)

* fix(feedback-form): move link to process env

* fix(feedback-form): update .env with new env var

* fix(feedback-form): update .env with new env var

* fix(feedback-form): factor code into AppContext

I also switch on the option in eslintrc for node and commonjs
Otherwise, process is declared as undefined
master
guhur 2 years ago
committed by GitHub
parent
commit
0395ebd668
  1. 4
      .eslintrc.json
  2. 2
      src/AppContext.jsx
  3. 4
      src/components/banner/Gform.jsx

4
.eslintrc.json

@ -1,7 +1,9 @@
{
"env": {
"browser": true,
"es6": true
"es6": true,
"node": true,
"commonjs": true
},
"parser": "babel-eslint",
"extends": [

2
src/AppContext.jsx

@ -7,8 +7,8 @@ export const AppContext = createContext();
const AppContextProvider = ({ children }) => {
const defaultState = {
// eslint-disable-next-line no-undef
urlServer: process.env.REACT_APP_SERVER_URL,
feedbackForm: process.env.REACT_APP_FEEDBACK_FORM,
routesServer: {
setElection: "election/",
getElection: "election/get/:slug/",

4
src/components/banner/Gform.jsx

@ -7,7 +7,7 @@ const Gform = props => {
return (
<a
className={props.className}
href="https://docs.google.com/forms/d/1Y5ocQscSkHFZdniR7Lvc9mbkJYe9ZIC4w0tOvC4rDZo/viewform?edit_requested=true"
href={this.context.feedbackForm}
target="_blank"
rel="noopener noreferrer"
>
@ -18,5 +18,3 @@ const Gform = props => {
};
export default Gform;
//https://docs.google.com/forms/d/1Y5ocQscSkHFZdniR7Lvc9mbkJYe9ZIC4w0tOvC4rDZo/viewform?edit_requested=true
Loading…
Cancel
Save