Skip to content

Commit

Permalink
contact form reset
Browse files Browse the repository at this point in the history
  • Loading branch information
erlisakulla committed Apr 20, 2021
1 parent 592fb38 commit d6f1a26
Show file tree
Hide file tree
Showing 7 changed files with 113 additions and 15 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,4 @@ build/

.env

notes.txt
TODO.md
ignore/
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

## Framework: React

## TODO
- [ ] Add SSR using Next or Gatsby

## Styles
* Fonts: Poppins, IBM Plex Serif
* Color theme: pink, blue, dark grey
Expand Down
1 change: 0 additions & 1 deletion src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ function App() {
<Helmet>
<title>Erlisa Kulla | Website</title>
<meta name="description" content="Software Developer and Artist with a great passion for learning and creative exploration."/>
<base target="_blank" href="https://www.erlisakulla.com"/>
</Helmet>

<Navbar/>
Expand Down
4 changes: 4 additions & 0 deletions src/main/Home/HomePage.css
Original file line number Diff line number Diff line change
Expand Up @@ -431,3 +431,7 @@ h3 {
transform: translateY(15px);
border-radius: 4px;
}

#bmw-paper {
cursor: pointer;
}
4 changes: 2 additions & 2 deletions src/main/sections/CanDo.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,8 @@ export const CanDoList = () => {
</Grid>
<Grid item xs={10}>
Python
<Tooltip title="6/10" placement="right" arrow>
<Progress percent={60} showInfo={false} strokeColor="grey" trailColor="#dbdbdb"/>
<Tooltip title="5/10" placement="right" arrow>
<Progress percent={50} showInfo={false} strokeColor="grey" trailColor="#dbdbdb"/>
</Tooltip>
</Grid>

Expand Down
41 changes: 36 additions & 5 deletions src/main/sections/ContactMe.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,25 @@ class ContactMe extends React.Component {
super(props);

this.sendEmail = this.sendEmail.bind(this);
this.onChangeInput = this.onChangeInput.bind(this);

this.state = {
first_name: '',
last_name: '',
email: '',
subject: '',
message: '',
}
};

sendEmail(e) {
e.preventDefault();
emailjs.sendForm('gmail', process.env.REACT_APP_TEMPLATE_ID, e.target, process.env.REACT_APP_USER_ID)
.then((result) => {
console.log(result.text);
notification.open({
message: 'Your email was sent successfully!',
description:
'Thank you for your email. I will get back to you as soon as possible :)'
'I will get back to you as soon as possible :)'
});
}, (error) => {
notification.open({
Expand All @@ -28,13 +36,26 @@ class ContactMe extends React.Component {
console.log(error.data);
}
);
e.target.reset();

this.setState({
first_name: '',
last_name: '',
email: '',
subject: '',
message: '',
});
}

onChangeInput(e) {
const cred = this.state;
cred[e.target.name] = e.target.value;
this.setState(cred);
}

render() {
return (
<div id="contact-form-cont">
<form name="complex-form" action="#" method="post" onSubmit={this.sendEmail}>
<form name="complex-form" method="post" onSubmit={this.sendEmail}>
<Grid container spacing={3}>
<Grid item xs={12} md={6}>
<Form.Item style={{ marginBottom: 0 }}>
Expand All @@ -48,6 +69,8 @@ class ContactMe extends React.Component {
name="first_name"
id="fname"
placeholder="First Name"
value={this.state.first_name}
onChange={this.onChangeInput}
/>
</Form.Item>
</Grid>
Expand All @@ -61,6 +84,8 @@ class ContactMe extends React.Component {
name="last_name"
id="lname"
placeholder="Last Name"
value={this.state.last_name}
onChange={this.onChangeInput}
/>
</Form.Item>
</Grid>
Expand All @@ -78,6 +103,8 @@ class ContactMe extends React.Component {
name="email"
placeholder="Email"
type="email"
value={this.state.email}
onChange={this.onChangeInput}
/>
</Form.Item>
</Form.Item>
Expand All @@ -91,6 +118,8 @@ class ContactMe extends React.Component {
id="subject"
name="subject"
placeholder="Subject"
value={this.state.subject}
onChange={this.onChangeInput}
/>
</Form.Item>
</Form.Item>
Expand All @@ -102,11 +131,13 @@ class ContactMe extends React.Component {
noStyle
rules={[{ required: true }]}
>
<Input.TextArea
<textarea className="ant-input"
required
name="message"
id="message"
placeholder="If you simply want to say hi, you want to collaborate, or you want to ask me something, don't hesitate to message me..."
value={this.state.message}
onChange={this.onChangeInput}
/>
</Form.Item>
</Form.Item>
Expand Down
72 changes: 67 additions & 5 deletions src/main/sections/Experience.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import React, { useState } from 'react';
import { makeStyles } from '@material-ui/core/styles';
import Timeline from '@material-ui/lab/Timeline';
import TimelineItem from '@material-ui/lab/TimelineItem';
Expand All @@ -7,11 +7,12 @@ import TimelineConnector from '@material-ui/lab/TimelineConnector';
import TimelineContent from '@material-ui/lab/TimelineContent';
import TimelineOppositeContent from '@material-ui/lab/TimelineOppositeContent';
import TimelineDot from '@material-ui/lab/TimelineDot';
import { Paper, Grid } from '@material-ui/core';
import { Paper, Grid, Collapse } from '@material-ui/core';
import bmw from '../../img/bmw-logo.png';
import jsc from '../../img/jsc-logo.jpg';
import idmc from '../../img/idmc-logo.jpg';
import { FiGlobe } from 'react-icons/fi';
import { FiChevronDown, FiChevronUp } from 'react-icons/fi';

const useStyles = makeStyles((theme) => ({
paper: {
Expand All @@ -25,6 +26,22 @@ const useStyles = makeStyles((theme) => ({
export default function CustomizedTimeline() {
const classes = useStyles();

const [expandBMW, setBMWExpand] = useState(false);
const [expandJSC, setJSCExpand] = useState(false);
const [expandIDMC, setIDMCxpand] = useState(false);

const handleExpandClick1 = () => {
setBMWExpand(!expandBMW);
};

const handleExpandClick2 = () => {
setJSCExpand(!expandJSC);
};

const handleExpandClick3 = () => {
setIDMCxpand(!expandIDMC);
};

return (
<Timeline align="alternate">
<div className="time">June - July 2021</div>
Expand All @@ -37,7 +54,7 @@ export default function CustomizedTimeline() {
<TimelineConnector/>
</TimelineSeparator>
<TimelineContent>
<Paper elevation={3} className={classes.paper} id="bmw-paper">
<Paper elevation={3} className={classes.paper} id="bmw-paper" onClick={handleExpandClick1}>
<Grid container spacing={3}>
<Grid item xs={3}>
<img id="bmw-logo" src={bmw} alt="bmw-logo"/>
Expand All @@ -50,6 +67,10 @@ export default function CustomizedTimeline() {
</p>
</Grid>
</Grid>

{/* <Collapse in={expandBMW} timeout="auto" unmountOnExit id="ui-ux-skills">
Hello
</Collapse> */}
</Paper>
<br/>
</TimelineContent>
Expand All @@ -58,7 +79,7 @@ export default function CustomizedTimeline() {
<div className="time">April 2020 - March 2021</div>
<TimelineItem>
<TimelineOppositeContent>
<Paper elevation={3} className={classes.paper} id="bmw-paper">
<Paper elevation={3} className={classes.paper} id="bmw-paper" onClick={handleExpandClick2}>
<Grid container spacing={3}>
<Grid item xs={9}>
<h5>Head of Marketing and Design</h5>
Expand All @@ -72,6 +93,28 @@ export default function CustomizedTimeline() {
<img id="jsc-logo" src={jsc} alt="jsc-logo"/>
</Grid>
</Grid>

<Collapse in={expandJSC} timeout="auto" unmountOnExit id="ui-ux-skills">
<ul style={{listStyle:'circle', fontSize:'13px', lineHeight:'1.5', paddingTop:'10px', paddingRight:'10px', paddingBottom:'15px'}}>
<li>
Recruiting and leading the Marketing Team for JSC 2021
</li>
<li>
Creating visual content: logo design, social media posts, brochures, posters, flyers, videos, recruitment material etc.
</li>
<li>
Designing and managing the JSC website
</li>
</ul>
</Collapse>

<div style={{textAlign:'center', color:'none'}}>
{
(expandJSC === false) ?
<FiChevronDown size={25} id="backend-expand-arrow"/> :
<FiChevronUp size={25} id="backend-expand-arrow"/>
}
</div>
</Paper>
<br/>
</TimelineOppositeContent>
Expand All @@ -93,7 +136,7 @@ export default function CustomizedTimeline() {
<TimelineDot color="secondary" id="disappear"/>
</TimelineSeparator>
<TimelineContent>
<Paper elevation={3} className={classes.paper} id="bmw-paper">
<Paper elevation={3} className={classes.paper} id="bmw-paper" onClick={handleExpandClick3}>
<Grid container spacing={3}>
<Grid item xs={3}>
<img id="idmc-logo" src={idmc} alt="idmc-logo"/>
Expand All @@ -106,6 +149,25 @@ export default function CustomizedTimeline() {
</p>
</Grid>
</Grid>

<Collapse in={expandIDMC} timeout="auto" unmountOnExit id="ui-ux-skills">
<ul style={{listStyle:'circle', fontSize:'13px', lineHeight:'1.5', paddingTop:'10px', paddingRight:'10px', paddingBottom:'15px'}}>
<li>
Created several videos for their project called “Communist Terminologue”
</li>
<li>
Animated a 4-minute-long video titled “The Train of Dictatorship” and won 1st place at their national contest
</li>
</ul>
</Collapse>

<div style={{textAlign:'center', color:'none'}}>
{
(expandIDMC === false) ?
<FiChevronDown size={25} id="backend-expand-arrow"/> :
<FiChevronUp size={25} id="backend-expand-arrow"/>
}
</div>
</Paper>
</TimelineContent>
</TimelineItem>
Expand Down

0 comments on commit d6f1a26

Please sign in to comment.