Skip to content

Commit

Permalink
Merge pull request #89 from Z-100/feature/clean-up
Browse files Browse the repository at this point in the history
feature(update-projects-page): Clean code
  • Loading branch information
Z-100 authored Apr 2, 2024
2 parents c64371b + c981c22 commit 16c5527
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 20 deletions.
Binary file added public/android-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,14 +1,27 @@
import React, {useState} from 'react'
import React, {useRef, useState} from 'react'

export const ContactFormContainer = () => {

const [formData, setFormData] = useState({
name: '',
email: '',
phoneNumber: '',
message: '',
});

const openMail = (
message: string,
name: string,
phoneNumber: string,
) => {
const recipient = 'z100@zindustries.ch';
const subject = 'Interested in hiring';

message += `\n\nName: ${name}`;
if (phoneNumber) message += `\nPhone: ${phoneNumber}`;

window.location.href = `mailto:${recipient}?subject=${encodeURIComponent(subject)}&body=${encodeURIComponent(message)}`;
}

const handleChange = (e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {
const { name, value } = e.target;
setFormData({
Expand All @@ -21,22 +34,11 @@ export const ContactFormContainer = () => {
e.preventDefault();
const {name, phoneNumber, message} = formData;
openMail(message, name, phoneNumber);
resetForm();
};

const openMail = (
message: string,
name: string,
phoneNumber: string,
) => {
const recipient = 'z100@zindustries.ch';
const subject = 'Interested in hiring';

message += `\n\nName: ${name}`;
if (phoneNumber) {
message += `\nPhone: ${phoneNumber}`
}

window.location.href = `mailto:${recipient}?subject=${encodeURIComponent(subject)}&body=${encodeURIComponent(message)}`;
const resetForm = () => {
setFormData({name: '', phoneNumber: '', message: ''});
}

return (
Expand Down
4 changes: 2 additions & 2 deletions src/domain/mock-db/featured-projects-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const featuredProjectsData: Project[] = [
shortDesc: "Geo Reminder App",
desc: "Basically a location based reminder app",
url: "https://github.com/ZE-100/GeoPal",
img: "/logo171.png"
img: "/android-logo.png"
},
{
name: "BackFusion",
Expand All @@ -34,7 +34,7 @@ export const featuredProjectsData: Project[] = [
shortDesc: "Cute day counter app",
desc: "One of my first Android apps! It counts down days in a cute way",
url: "https://github.com/ZE-100/DayCounter",
img: "/logo171.png"
img: "/android-logo.png"
},
{
name: "More projects",
Expand Down
4 changes: 2 additions & 2 deletions src/domain/mock-db/socials-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const socialMediaElements: SocialMediaElement[] = [
},
{
name: "LinkedIn",
url: "https://linkedin.com/in/marvin-z-17aa-742a9",
url: "https://linkedin.com/in/marvin-z",
icon: FaLinkedin,
},
{
Expand All @@ -24,7 +24,7 @@ export const socialMediaElements: SocialMediaElement[] = [
},
{
name: "Website",
url: "https://vayan.vercel.app",
url: "https://vayan.zindustries.ch",
icon: FaReact,
},
];

0 comments on commit 16c5527

Please sign in to comment.