Skip to content

Commit a6f984e

Browse files
committed
dd
1 parent f1747d6 commit a6f984e

File tree

3 files changed

+1979
-375
lines changed

3 files changed

+1979
-375
lines changed

src/Page/PortfolioIdeas/PortfolioIdeas.jsx

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
import React, { useState } from 'react';
1+
import React, { useState, useEffect } from 'react';
22
import { Footer } from '../../components/Footer/Footer';
3+
import portfoliosData from './portfolio.json'; // Import the JSON file
34

45
const Navbar = () => {
56
return (
@@ -60,6 +61,10 @@ const PortfolioIdeas = () => {
6061
techStack: '',
6162
});
6263

64+
useEffect(() => {
65+
setPortfolios(portfoliosData); // Load portfolios from JSON file
66+
}, []);
67+
6368
const handleSubmit = (e) => {
6469
e.preventDefault();
6570
setPortfolios([...portfolios, newPortfolio]);
@@ -72,6 +77,7 @@ const PortfolioIdeas = () => {
7277
});
7378
setIsModalOpen(false);
7479
};
80+
7581
const filteredPortfolios = portfolios.filter((portfolio) =>
7682
portfolio.author.toLowerCase().includes(searchTerm.toLowerCase()),
7783
);

0 commit comments

Comments
 (0)