From da0bf169cb3ffd9bf3f47e39579c8af38d415c46 Mon Sep 17 00:00:00 2001 From: John Storey Date: Tue, 25 Feb 2020 22:52:54 -0500 Subject: [PATCH 1/2] adds location --- src/App.js | 20 ++++++++++---------- src/routes/vote.js | 12 ++++++++---- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/src/App.js b/src/App.js index 7ee6476..22965d7 100644 --- a/src/App.js +++ b/src/App.js @@ -1,20 +1,20 @@ /* eslint-disable jsx-a11y/accessible-emoji */ -import React from 'react'; +import React from "react"; import { BrowserRouter as Router, Route } from "react-router-dom"; -import './App.css'; -import './Shorthand.css'; -import Vote from './routes/vote' -import Landing from './routes/landing' -import GlobalWrapper from './stores/global' -import Toast from './components/Toast' -import 'semantic-ui-css/semantic.min.css' +import "./App.css"; +import "./Shorthand.css"; +import Vote from "./routes/vote"; +import Landing from "./routes/landing"; +import GlobalWrapper from "./stores/global"; +import Toast from "./components/Toast"; +import "semantic-ui-css/semantic.min.css"; function App() { - return ( + return ( - + {/*
Page Not Found
} /> */}
diff --git a/src/routes/vote.js b/src/routes/vote.js index f3b2dad..cdce219 100644 --- a/src/routes/vote.js +++ b/src/routes/vote.js @@ -128,13 +128,17 @@ function Vote({ match }) { // CATEGORY END const onSubmit = () => { + console.log("match.params.location", match.params.location); const base = new Airtable({ apiKey: process.env.REACT_APP_AIRTABLE_KEY }).base(match.params.baseId); base("votes").create( { uid: user.uid, - meta: JSON.stringify({ version: config.version }), + meta: JSON.stringify({ + version: config.version, + location: match.params.location + }), votes: JSON.stringify(allos) }, function(err, record) { @@ -187,9 +191,9 @@ function Vote({ match }) {
{/* */} + components={{ Highlight }} + jsx={config.welcomeText || null} + /> */}
From dcb1495ff17940a3622927fa41bcac408b555ab4 Mon Sep 17 00:00:00 2001 From: John Storey Date: Wed, 26 Feb 2020 09:33:32 -0500 Subject: [PATCH 2/2] updates --- src/routes/vote.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/routes/vote.js b/src/routes/vote.js index cdce219..5666cf6 100644 --- a/src/routes/vote.js +++ b/src/routes/vote.js @@ -128,16 +128,16 @@ function Vote({ match }) { // CATEGORY END const onSubmit = () => { - console.log("match.params.location", match.params.location); + const { location, baseId } = match.params; const base = new Airtable({ apiKey: process.env.REACT_APP_AIRTABLE_KEY - }).base(match.params.baseId); + }).base(baseId); base("votes").create( { uid: user.uid, meta: JSON.stringify({ version: config.version, - location: match.params.location + ...(location && { location }) }), votes: JSON.stringify(allos) },