diff --git a/src/pages/About/components/PersonalData.tsx b/src/pages/About/components/PersonalData.tsx
index aae9b5a..33a55db 100644
--- a/src/pages/About/components/PersonalData.tsx
+++ b/src/pages/About/components/PersonalData.tsx
@@ -1,5 +1,3 @@
-import React from "react";
-
//icons
import { MdLocationOn } from "react-icons/md";
import { HiOutlineMail } from "react-icons/hi";
diff --git a/src/pages/Home/HomePage.tsx b/src/pages/Home/HomePage.tsx
index 776a9b1..029991e 100644
--- a/src/pages/Home/HomePage.tsx
+++ b/src/pages/Home/HomePage.tsx
@@ -1,4 +1,3 @@
-import React from "react";
import FeaturedProjects from "./components/FeaturedProjects";
import ProjectSfit from "./components/ProjectSfit";
import HomeHeader from "./components/HomeHeader";
@@ -8,36 +7,6 @@ const HomePage = (): JSX.Element => {
return (
<>
diff --git a/src/pages/Home/components/FeaturedProjects.tsx b/src/pages/Home/components/FeaturedProjects.tsx
index 7aec455..e9c53b8 100644
--- a/src/pages/Home/components/FeaturedProjects.tsx
+++ b/src/pages/Home/components/FeaturedProjects.tsx
@@ -9,6 +9,7 @@ class FeaturedProjects extends React.Component {
static contextType = ProjectContext;
render() {
+ // @ts-ignore
const { featuredProjects, getProjectElements, loading } = this.context;
return (
diff --git a/src/pages/Home/components/HomeHeader.tsx b/src/pages/Home/components/HomeHeader.tsx
index bbc7bfe..752ffc0 100644
--- a/src/pages/Home/components/HomeHeader.tsx
+++ b/src/pages/Home/components/HomeHeader.tsx
@@ -24,7 +24,6 @@ const HomeHeader = (): JSX.Element => {
base[3].style.backgroundPositionY = offset * 0.3 + "px";
- console.log(base);
} catch (e) {
console.warn("Tet");
}
diff --git a/src/react-app-env.d.ts b/src/react-app-env.d.ts
deleted file mode 100644
index 6431bc5..0000000
--- a/src/react-app-env.d.ts
+++ /dev/null
@@ -1 +0,0 @@
-///
diff --git a/src/reportWebVitals.ts b/src/reportWebVitals.ts
new file mode 100644
index 0000000..49a2a16
--- /dev/null
+++ b/src/reportWebVitals.ts
@@ -0,0 +1,15 @@
+import { ReportHandler } from 'web-vitals';
+
+const reportWebVitals = (onPerfEntry?: ReportHandler) => {
+ if (onPerfEntry && onPerfEntry instanceof Function) {
+ import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
+ getCLS(onPerfEntry);
+ getFID(onPerfEntry);
+ getFCP(onPerfEntry);
+ getLCP(onPerfEntry);
+ getTTFB(onPerfEntry);
+ });
+ }
+};
+
+export default reportWebVitals;
diff --git a/src/styles/components/_header--home.scss b/src/styles/components/_header--home.scss
index 8d82b1a..58532ae 100644
--- a/src/styles/components/_header--home.scss
+++ b/src/styles/components/_header--home.scss
@@ -75,21 +75,22 @@
}
.header--home-overlay:nth-child(1) {
- background-image: url("../../images/base1.svg");
+ background-image: url("src/images/base1.svg");
+ z-index: -3;
}
.header--home-overlay:nth-child(2) {
- background-image: url("../../images/base2.svg");
+ background-image: url("src/images/base2.svg");
z-index: -3;
}
.header--home-overlay:nth-child(3) {
- background-image: url("../../images/base3.svg");
+ background-image: url("src/images/base3.svg");
z-index: -2;
}
.header--home-overlay:nth-child(4) {
- background-image: url("../../images/base4.svg");
+ background-image: url("src/images/base4.svg");
z-index: -1;
}
}
@@ -110,22 +111,22 @@
}
.header--home-overlay:nth-child(1) {
- background-image: url("../../images/base1.svg");
+ background-image: url("src/images/base1.svg");
}
.header--home-overlay:nth-child(2) {
background-color: $primary-pink;
- background-image: url("../../images/base2.svg");
+ background-image: url("src/images/base2.svg");
z-index: -3;
}
.header--home-overlay:nth-child(3) {
- background-image: url("../../images/base3.svg");
+ background-image: url("src/images/base3.svg");
z-index: -2;
}
.header--home-overlay:nth-child(4) {
- background-image: url("../../images/base4.svg");
+ background-image: url("src/images/base4.svg");
z-index: -1;
}
}
diff --git a/src/styles/main.scss b/src/styles/main.scss
index 588d1fb..ac5db10 100644
--- a/src/styles/main.scss
+++ b/src/styles/main.scss
@@ -1,30 +1,30 @@
// imports
-@import "~bootstrap/scss/bootstrap";
+@import 'node_modules/bootstrap/scss/bootstrap';
//abstracts
-@import "abstracts/variables";
+@import 'abstracts/variables';
//base
-@import "base/reset";
+@import 'base/reset';
//layout
-@import "layout/navbar";
-@import "layout/footer";
+@import 'layout/navbar';
+@import 'layout/footer';
//vendors
-@import "vendors/bootstrap";
-@import "vendors/spinner";
+@import 'vendors/bootstrap';
+@import 'vendors/spinner';
//pages
-@import "pages/home";
-@import "pages/projects";
-@import "pages/about";
-@import "pages/notfound";
+@import 'pages/home';
+@import 'pages/projects';
+@import 'pages/about';
+@import 'pages/notfound';
//components
-@import "components/header";
-@import "components/project-item";
-@import "components/home--info-overview";
+@import 'components/header';
+@import 'components/project-item';
+@import 'components/home--info-overview';
#single-project {
.gallery {
diff --git a/src/styles/pages/_about.scss b/src/styles/pages/_about.scss
index 0920b4c..74b4635 100644
--- a/src/styles/pages/_about.scss
+++ b/src/styles/pages/_about.scss
@@ -16,7 +16,7 @@
// background: whitesmoke;
background-color: $primary-pink;
// background-image: url("https://firebasestorage.googleapis.com/v0/b/portfolio-9dbc4.appspot.com/o/marble.svg?alt=media&token=143bbf78-7310-444f-bc50-cf26b8e08773");
- background-image: url("/media/marble.svg");
+ background-image: url('src/images/marble.svg');
background-size: cover;
background-repeat: no-repeat;
overflow: hidden;
diff --git a/tsconfig.app.json b/tsconfig.app.json
new file mode 100644
index 0000000..b364bc5
--- /dev/null
+++ b/tsconfig.app.json
@@ -0,0 +1,23 @@
+{
+ "extends": "./tsconfig.json",
+ "compilerOptions": {
+ "outDir": "./dist/out-tsc",
+ "types": [
+ "node",
+ "@nx/react/typings/cssmodule.d.ts",
+ "@nx/react/typings/image.d.ts",
+ "vite/client"
+ ]
+ },
+ "exclude": [
+ "src/**/*.spec.ts",
+ "src/**/*.test.ts",
+ "src/**/*.spec.tsx",
+ "src/**/*.test.tsx",
+ "src/**/*.spec.js",
+ "src/**/*.test.js",
+ "src/**/*.spec.jsx",
+ "src/**/*.test.jsx"
+ ],
+ "include": ["src/**/*.js", "src/**/*.jsx", "src/**/*.ts", "src/**/*.tsx"]
+}
diff --git a/tsconfig.json b/tsconfig.json
index af10394..15e2e4a 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -1,19 +1,36 @@
{
"compilerOptions": {
- "target": "es5",
- "lib": ["dom", "dom.iterable", "esnext"],
- "allowJs": true,
+ "rootDir": ".",
+ "sourceMap": true,
+ "declaration": false,
+ "moduleResolution": "node",
+ "emitDecoratorMetadata": true,
+ "experimentalDecorators": true,
+ "importHelpers": true,
+ "target": "es2015",
+ "module": "esnext",
+ "lib": ["es2020", "dom"],
"skipLibCheck": true,
- "esModuleInterop": true,
+ "skipDefaultLibCheck": true,
+ "baseUrl": ".",
+ "paths": {},
+ "jsx": "react-jsx",
+ "allowJs": false,
+ "esModuleInterop": false,
"allowSyntheticDefaultImports": true,
"strict": true,
- "forceConsistentCasingInFileNames": true,
- "module": "esnext",
- "moduleResolution": "node",
- "resolveJsonModule": true,
- "isolatedModules": true,
- "noEmit": true,
- "jsx": "react"
+ "types": ["vite/client", "vitest"]
},
- "include": ["src"]
+ "files": [],
+ "include": [],
+ "references": [
+ {
+ "path": "./tsconfig.app.json"
+ },
+ {
+ "path": "./tsconfig.spec.json"
+ }
+ ],
+ "compileOnSave": false,
+ "exclude": ["node_modules", "tmp"]
}
diff --git a/tsconfig.spec.json b/tsconfig.spec.json
new file mode 100644
index 0000000..40b5c50
--- /dev/null
+++ b/tsconfig.spec.json
@@ -0,0 +1,28 @@
+{
+ "extends": "./tsconfig.json",
+ "compilerOptions": {
+ "outDir": "./dist/out-tsc",
+ "types": [
+ "vitest/globals",
+ "vitest/importMeta",
+ "vite/client",
+ "node",
+ "vitest",
+ "@nx/react/typings/cssmodule.d.ts",
+ "@nx/react/typings/image.d.ts"
+ ]
+ },
+ "include": [
+ "vite.config.ts",
+ "vitest.config.ts",
+ "src/**/*.test.ts",
+ "src/**/*.spec.ts",
+ "src/**/*.test.tsx",
+ "src/**/*.spec.tsx",
+ "src/**/*.test.js",
+ "src/**/*.spec.js",
+ "src/**/*.test.jsx",
+ "src/**/*.spec.jsx",
+ "src/**/*.d.ts"
+ ]
+}
diff --git a/vite.config.ts b/vite.config.ts
new file mode 100644
index 0000000..3067001
--- /dev/null
+++ b/vite.config.ts
@@ -0,0 +1,49 @@
+///
+import { defineConfig } from 'vite';
+import react from '@vitejs/plugin-react';
+import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin';
+
+export default defineConfig({
+ root: __dirname,
+ cacheDir: './node_modules/.vite/.',
+
+ server: {
+ port: 4200,
+ host: 'localhost',
+ },
+
+ preview: {
+ port: 4300,
+ host: 'localhost',
+ },
+
+ plugins: [react(), nxViteTsPaths()],
+
+ // Uncomment this if you are using workers.
+ // worker: {
+ // plugins: [ nxViteTsPaths() ],
+ // },
+
+ build: {
+ outDir: './dist/portfolio',
+ reportCompressedSize: true,
+ commonjsOptions: {
+ transformMixedEsModules: true,
+ },
+ },
+
+ test: {
+ globals: true,
+ cache: {
+ dir: './node_modules/.vitest',
+ },
+ environment: 'jsdom',
+ include: ['src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
+
+ reporters: ['default'],
+ coverage: {
+ reportsDirectory: './coverage/portfolio',
+ provider: 'v8',
+ },
+ },
+});