Skip to content

Commit

Permalink
Merge pull request #9 from jeffn12/development
Browse files Browse the repository at this point in the history
Ready to Deploy New Features/Bug Fixes
  • Loading branch information
jeffn12 committed Aug 24, 2020
2 parents c1a924d + 0edbae3 commit 37b7e43
Show file tree
Hide file tree
Showing 15 changed files with 675 additions and 179 deletions.
222 changes: 120 additions & 102 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,16 @@
"dependencies": {
"@material-ui/core": "^4.11.0",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "^4.0.0-alpha.56",
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.5.0",
"@testing-library/user-event": "^7.2.1",
"axios": "^0.20.0",
"eslint": "^6.6.0",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-router-dom": "^5.2.0",
"react-scripts": "^3.4.2"
"react-scripts": "^3.4.3"
},
"scripts": {
"start": "react-scripts start",
Expand Down
2 changes: 1 addition & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link
rel="stylesheet"
href="https://fonts.googleapis.com/css?family=Roboto:400,700|Lora|Montserrat"
href="https://fonts.googleapis.com/css?family=Roboto:400,700|Lora|Montserrat:100,200,300,400,500,600,700,800,900"
/>
<title>Jeff Neuberger - Developer</title>
</head>
Expand Down
5 changes: 5 additions & 0 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import ProjectPage from "./components/ProjectPage";
import SkillsPage from "./components/SkillsPage";
import ContactPage from "./components/ContactPage";
import Footer from "./components/Footer";
import ContactMeFab from "./components/ContactMeFab";
// Material UI
import { Box } from "@material-ui/core";
import { makeStyles } from "@material-ui/styles";
Expand All @@ -28,15 +29,19 @@ function App() {
<AboutMe />
<ProjectPage />
<SkillsPage />
<ContactMeFab />
</Route>
<Route path="/about">
<AboutMe />
<ContactMeFab />
</Route>
<Route path="/projects">
<ProjectPage />
<ContactMeFab />
</Route>
<Route path="/skills">
<SkillsPage />
<ContactMeFab />
</Route>
<Route path="/contact" />
</Switch>
Expand Down
26 changes: 19 additions & 7 deletions src/components/AboutMe.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,32 @@ function AboutMe() {
align="right"
style={{
fontFamily: "Lora",
fontSize: "1.3rem",
fontSize: "1.4rem",
width: "80%"
}}
>
{ABOUT_ME}
I am a driven educator and lifelong learner leveraging my experience
in STEM and technology instruction to design and develop meaningful
software solutions. I feel that controlling your own path is the key
to truly opening the doors to long-lasting learning.
</Typography>
<br></br>
<Typography
align="right"
style={{
fontFamily: "Lora",
fontSize: "1.4rem",
width: "80%"
}}
>
My goal is to create software and web applications that support
learners on a large scale realize their own potential. I am passionate
about user feedback, data-driven decision making, and organizing
solutions in an intuitive and meaningful way.
</Typography>
</Box>
</>
);
}

export default AboutMe;

const ABOUT_ME = `I am a teacher turned software engineer, and I feel that controlling your own
path is the key to truly opening the doors to learning. I want to support learners on a large scale
realize their abilities through quality web applications. I am passionate about data, and
I truly love any project that involves a database!`;
8 changes: 4 additions & 4 deletions src/components/Background.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ function Background() {
window.removeEventListener("scroll", onScroll);
};
}, []);

return (
<>
<div
Expand All @@ -30,10 +29,10 @@ function Background() {
zIndex: -1
}}
>
<img
<div
alt="double doors open to possibilities"
style={{
opacity: opacity,
opacity: !isNaN(opacity) ? opacity : 1,
filter: `blur(${filter}px) brightness(0.7)`,
position: "absolute",
background: `url("https://images.unsplash.com/photo-1481277542470-605612bd2d61?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjE3MzYxfQ&auto=format&fit=crop&w=995&q=80") center center`,
Expand All @@ -43,7 +42,8 @@ function Background() {
left: "-10%",
right: "-10%",
width: "120%",
height: "120vh"
height: window.screen.height + 25,
backgroundAttachment: "scroll"
}}
/>
</div>
Expand Down
244 changes: 244 additions & 0 deletions src/components/ContactForm.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,244 @@
import React, { useState } from "react";
import axios from "axios";
// Material UI
import {
Box,
Button,
Typography,
TextField,
Dialog,
DialogActions,
DialogContent,
DialogTitle,
Snackbar
} from "@material-ui/core";
import DialogContextText from "@material-ui/core/DialogContentText";
import MuiAlert from "@material-ui/lab/Alert";
import { makeStyles } from "@material-ui/styles";

const SEND_MESSAGE_URI =
"https://ruwmvgzn17.execute-api.us-east-2.amazonaws.com/default/Contact-Me-Form";

function ContactForm() {
const Styles = useStyles();
const [name, setName] = useState("");
const [email, setEmail] = useState("");
const [message, setMessage] = useState("");
const [open, setOpen] = useState(false);
const [successOpen, setSuccessOpen] = useState(false);
const [failureOpen, setFailureOpen] = useState(false);

const handleSubmit = () => {
isValidEmail() ? sendMessage() : setOpen(true);
};

const isValidEmail = () => {
return /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(
email
);
};

const sendMessage = () => {
axios
.post(
SEND_MESSAGE_URI,
JSON.stringify({
sender: name,
email,
message
})
)
.then((res) => {
setSuccessOpen(true);
clearForm();
})
.catch((err) => console.log(err));
};

const handleSuccessClose = (event, reason) => {
if (reason === "clickaway") return;
setSuccessOpen(false);
};

const handleFailureClose = (event, reason) => {
if (reason === "clickaway") return;
setFailureOpen(false);
};

const clearForm = () => {
setEmail("");
setName("");
setMessage("");
};

return (
<Box className={Styles.root}>
<AlertDialog open={open} setOpen={setOpen} />
<Typography className={Styles.header}>Send Me A Message</Typography>
<TextField
id="name"
label="Name"
placeholder="Enter your name"
className={Styles.textbox}
InputProps={{
classes: { root: Styles.textboxFont }
}}
InputLabelProps={{
classes: { root: Styles.textboxFont }
}}
value={name}
onChange={(e) => setName(e.target.value)}
variant="outlined"
required
margin="dense"
/>
<TextField
id="email"
label="Email"
placeholder="Enter your email"
className={Styles.textbox}
InputProps={{
classes: { root: Styles.textboxFont }
}}
InputLabelProps={{
classes: { root: Styles.textboxFont }
}}
value={email}
onChange={(e) => setEmail(e.target.value)}
variant="outlined"
required
margin="dense"
/>
<TextField
id="message"
label="Message"
placeholder="Enter your message"
className={Styles.textbox}
InputProps={{
classes: { root: Styles.textboxFont }
}}
InputLabelProps={{
classes: { root: Styles.textboxFont }
}}
value={message}
onChange={(e) => setMessage(e.target.value)}
variant="outlined"
required
multiline
margin="dense"
rows={9}
/>
<Button
className={Styles.submitBtn}
disabled={name === "" || email === "" || message === ""}
fullWidth
onClick={handleSubmit}
>
SEND
</Button>
<Snackbar
open={successOpen}
autoHideDuration={6000}
onClose={handleSuccessClose}
>
<MuiAlert
elevation={6}
variant="filled"
onClose={handleSuccessClose}
severity="success"
>
Message Sent!
</MuiAlert>
</Snackbar>
<Snackbar
open={failureOpen}
autoHideDuration={6000}
onClose={handleFailureClose}
>
<MuiAlert
elevation={6}
variant="filled"
onClose={handleFailureClose}
severity="error"
>
Message not sent. Please try again.
</MuiAlert>
</Snackbar>
</Box>
);
}

export default ContactForm;

function AlertDialog({ open, setOpen }) {
const handleClose = () => {
setOpen(false);
};

return (
<Dialog
open={open}
onClose={handleClose}
aria-labelledby="alert-dialog-title"
aria-describedby="alert-dialog-description"
>
<DialogTitle id="alert-dialog-title">{"Invalid Email"}</DialogTitle>
<DialogContent>
<DialogContextText id="alert-dialog-description">
Please enter a valid email address and try again.
</DialogContextText>
</DialogContent>
<DialogActions>
<Button onClick={handleClose} color="primary" autoFocus>
OK
</Button>
</DialogActions>
</Dialog>
);
}

const useStyles = makeStyles({
root: {
width: "95%",
minWidth: "400px",
display: "flex",
padding: "1rem",
flexDirection: "column",
alignItems: "center",
backgroundColor: "rgba(120,120,120,0.7)",
borderRadius: "8px",
margin: "1rem"
},
header: {
fontFamily: "Montserrat",
fontWeight: 700,
fontSize: "2rem"
},
textbox: {
width: "95%",
"& label.Mui-focused": {
color: "black",
fontFamily: "Lora"
},
"& .MuiOutlinedInput-root": {
"& fieldset": {
borderColor: "black"
},
"&:hover fieldset": {
borderColor: "black"
},
"&.Mui-focused fieldset": {
borderColor: "black"
}
}
},
textboxFont: {
fontFamily: "Lora"
},
submitBtn: {
width: "95%",
margin: ".8rem 1rem",
backgroundColor: "#aaa",
fontFamily: "Montserrat"
}
});

0 comments on commit 37b7e43

Please sign in to comment.