Skip to content

Commit

Permalink
feat: update .gitignore to include environment files, add cross-env d…
Browse files Browse the repository at this point in the history
…ependency, and modify resume download logic
  • Loading branch information
AhmedNassar7 committed Dec 4, 2024
1 parent acec091 commit e2234e3
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 8 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
.env
.env.* # Matches .env files with any suffix (e.g., .env.development, .env.test)
*-env # Matches any file ending with '-env' (e.g., test-env.js, validate-env.js)
.env.production
.env.development
test-env.js
validate-env.js

# Build and cache files
.parcel-cache/
Expand Down
22 changes: 21 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"scripts": {
"dev": "vite",
"build": "vite build",
"serve": "vite preview",
"lint": "eslint .",
"preview": "vite preview",
"format": "prettier --write .",
Expand All @@ -15,7 +16,7 @@
"lint-staged": "lint-staged",
"test": "jest",
"postinstall": "husky install",
"start": "vite",
"start": "cross-env NODE_ENV=development vite",
"predeploy": "npm run build",
"deploy": "gh-pages -d dist",
"preinstall": "npm install vite",
Expand All @@ -36,7 +37,6 @@
]
},
"dependencies": {
"@babel/compat-data": "^7.26.2",
"@fortawesome/fontawesome-svg-core": "^6.5.1",
"@fortawesome/free-brands-svg-icons": "^6.5.1",
"@fortawesome/free-regular-svg-icons": "^6.6.0",
Expand Down Expand Up @@ -79,13 +79,15 @@
"vite-plugin-pwa": "^0.21.0"
},
"devDependencies": {
"@babel/compat-data": "^7.26.2",
"@babel/core": "^7.26.0",
"@babel/preset-env": "^7.26.0",
"@eslint/js": "^9.9.1",
"@types/react": "^18.3.5",
"@types/react-dom": "^18.3.0",
"@types/react-scroll": "^1.8.10",
"@vitejs/plugin-react": "^4.3.3",
"cross-env": "^7.0.3",
"eslint": "^9.14.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.2.1",
Expand Down
17 changes: 12 additions & 5 deletions src/components/Resume/Resume.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ const Resume = () => {
],
};

const RESUME_URL = '/assets/PDFs/Ahmed_Nassar_Resume.pdf';

const handleResumeDownload = () => {
// Track resume download event
trackEvent({
Expand All @@ -166,16 +168,21 @@ const Resume = () => {
value: 1,
});

// Download resume
// Open resume in a new tab
// const newTab = window.open(RESUME_URL, '_blank');
// if (!newTab) {
// console.error(
// 'Failed to open a new tab. It might be blocked by the browser.',
// );
// }

// Trigger resume download
const link = document.createElement('a');
link.href = '/assets/PDFs/Ahmed_Nassar_Resume.pdf';
link.href = RESUME_URL;
link.download = 'Ahmed_Nassar_Resume.pdf';
document.body.appendChild(link);
link.click();
document.body.removeChild(link);

// Open resume in new tab
window.open('/assets/PDFs/Ahmed_Nassar_Resume.pdf', '_blank');
};

return (
Expand Down

0 comments on commit e2234e3

Please sign in to comment.