diff --git a/Pierre b/Pierre new file mode 160000 index 0000000..b23f5d7 --- /dev/null +++ b/Pierre @@ -0,0 +1 @@ +Subproject commit b23f5d7a8a65adfed2dd4225d13e76714514934d diff --git a/client/public/BSF_Image.jpg b/client/public/BSF_Image.jpg new file mode 100644 index 0000000..3fcdd0b Binary files /dev/null and b/client/public/BSF_Image.jpg differ diff --git a/client/public/index.html b/client/public/index.html index d79ba00..1710b8a 100644 --- a/client/public/index.html +++ b/client/public/index.html @@ -11,6 +11,7 @@ +
` diff --git a/client/src/components/App/App.css b/client/src/components/App/App.css index abe8f84..5d61567 100644 --- a/client/src/components/App/App.css +++ b/client/src/components/App/App.css @@ -1,11 +1,33 @@ body { margin:0 10px; } + +#BSF_Logo{ + padding: 50px; + padding-bottom: 100px; + display: flex; + width: 50%; + margin-left: auto; + margin-right: auto; +} + .App { - font-family: Arial, Helvetica, sans-serif; + font-family: 'Montserrat',sans-serif; max-width:600px; margin: auto; } + +.addEntry{ + margin-left: auto; + margin-right: auto; + width: 500px; + padding: 40px; + background: white; + box-sizing: border-box; + box-shadow: 0 15px 25px rgba(28, 28, 28, 0.6); + border-radius: 10px; +} + #userInput { display: flex; flex-direction: column; @@ -15,13 +37,15 @@ body { margin: auto; } #userInput input{ - width: 90%; - margin: 10px; - padding: 10px; - font-size: 2rem; - border-radius: 5px; - color: #333; - background-color:rgba(135, 206, 235, 0.3); + width: 100%; + padding: 10px 0; + font-size: 16px; + color: black; + margin-bottom: 30px; + border: none; + border-bottom: 1px solid black; + outline: none; + background: transparent; } #firstLastName { display: grid; @@ -41,6 +65,20 @@ body { padding: 10px; width: 50%; margin: 10px auto; + color: white; + background-color: rgb(175, 20, 20);; +} +#editButton{ + color: white; + background-color: rgb(175, 20, 20); +} +.update{ + color: white; + background-color: rgb(175, 20, 20); +} +.delete{ + color: white; + background-color: rgb(175, 20, 20); } .editField{ margin: 20px 0; @@ -74,10 +112,26 @@ body { } #doneButton{ display: none; + color: white; + background-color: rgb(175, 20, 20); } #editPasscodeInput{ visibility: hidden; + width: 50%; + padding: 10px 0; + font-size: 16px; + color: black; + margin-bottom: 30px; + border: none; + border-bottom: 1px solid black; + outline: none; + background: transparent } #submitEmailsButton{ display: none; + color: white; + background-color: rgb(175, 20, 20); +} +#addEntryLine{ + padding-bottom: 100px; } \ No newline at end of file diff --git a/client/src/components/App/App.js b/client/src/components/App/App.js index 23871d7..de08474 100644 --- a/client/src/components/App/App.js +++ b/client/src/components/App/App.js @@ -1,6 +1,7 @@ import React from 'react'; import './App.css'; import AddEntry from '../AddEntry.jsx'; +import BanEntry from '../BanEntry.jsx'; import CurrentEntries from '../CurrentEntries.jsx'; import Footer from '../Footer.jsx' @@ -8,10 +9,9 @@ function App() { return (
-

Entries

-
+


) + + })} +

Banned Entries

+ {bannedentryList.map((val, k) => { + return (
+
{val.last_name}, {val.first_name} {val.email_address}
+ +
+ + + setNewEmail(e.target.value)} />
@@ -163,6 +324,11 @@ const CurrentEntries = () => {
+ + + + + ) diff --git a/server/index.js b/server/index.js index b7ac4ce..8841879 100644 --- a/server/index.js +++ b/server/index.js @@ -17,7 +17,7 @@ app.use(cors()) app.use(express.json()) app.use(bodyParser.urlencoded({extended: true})) -// READ +// READ Add app.get("/api/read", (req, res) => { const sqlSelect = "SELECT * FROM volunteers;" db.query(sqlSelect, (err, result) => { @@ -28,7 +28,7 @@ app.get("/api/read", (req, res) => { }) }) -// CREATE +// CREATE Add app.post("/api/create", (req, res) => { const fn = req.body.first const ln = req.body.last @@ -41,7 +41,53 @@ app.post("/api/create", (req, res) => { }) }) -// DELETE + + +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + + +app.post("/api/addtoban", (req, res) => { + const fn = req.body.first + const ln = req.body.last + const ea = req.body.email + const sqlInsert = "INSERT INTO banned (first_name, last_name, email_address) VALUES (?,?,?);" + db.query(sqlInsert, [fn, ln, ea], (err, result) => { + if(err) throw err + console.log("Server posted: ", fn, ln) + res.send(result) + }) +}) + + +app.delete("/api/deleteban/:emailAddress", (req, res) => { + const ea = req.params.emailAddress; + console.log(ea) + const sqlDelete = "DELETE FROM banned WHERE email_address = ?"; + db.query(sqlDelete, [ea], (err, result) => { + if(err) throw err + console.log("Server: deleted: ", ea) + res.send(result) + }) +}) + +// READ Add +app.get("/api/readbanned", (req, res) => { + const sqlSelect = "SELECT * FROM banned;" + db.query(sqlSelect, (err, result) => { + if(err){ + throw err; + } + res.send(result); + }) +}) + + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + + + + +// DELETE Add app.delete("/api/delete/:emailAddress", (req, res) => { const ea = req.params.emailAddress; console.log(ea) @@ -53,7 +99,7 @@ app.delete("/api/delete/:emailAddress", (req, res) => { }) }) -// UPDATE +// UPDATE Add app.put("/api/update", (req, res) => { // console.log(req) @@ -68,6 +114,8 @@ app.put("/api/update", (req, res) => { }) }) + + const PORT = process.env.EXPRESSPORT; const msg = `Running on PORT ${PORT}` app.get("/", (req, res) => {