From 18ac460e7df8ede3c883f0931c475de040f8438a Mon Sep 17 00:00:00 2001 From: Narottam Bisht Date: Wed, 4 Dec 2024 15:38:47 +0530 Subject: [PATCH 1/3] migrated firebase config values to new account firebase config values --- src/containers/About/index.js | 14 +++++++------- src/utils/FirebaseConfig.js | 16 ++++++++-------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/containers/About/index.js b/src/containers/About/index.js index f13a52f..e3bf8ea 100644 --- a/src/containers/About/index.js +++ b/src/containers/About/index.js @@ -12,7 +12,8 @@ const About = () => { useEffect(() => { firestoreDB.collection("about-info").onSnapshot(snapshot => { - snapshot.docs.map(doc => setAboutStore(doc.data())); + console.log(snapshot.docs.map(doc => doc.data())[0].future_goals); + setAboutStore(snapshot.docs.map(doc => doc.data())[0]); }); // eslint-disable-next-line react-hooks/exhaustive-deps }, []); @@ -35,20 +36,19 @@ const About = () => { - {aboutStore.future_goals && - aboutStore.future_goals.goals_array.map((_goal, index) => { - return ( + {aboutStore?.future_goals?.length && aboutStore.future_goals.map((_goal, index) => { + return ( + style={{ fontWeight: "bold" }}> {_goal.goal_title} {_goal.goal_description} - ) - })} + ) + })} diff --git a/src/utils/FirebaseConfig.js b/src/utils/FirebaseConfig.js index a95da90..5766dca 100644 --- a/src/utils/FirebaseConfig.js +++ b/src/utils/FirebaseConfig.js @@ -1,14 +1,14 @@ import firebase from "firebase"; const firebaseConfig = firebase.initializeApp({ - apiKey : "AIzaSyBNW35sc1XW4jz8km47M9R4n9hScEO-kvo", - authDomain : "narottam-portfolio.firebaseapp.com", - databaseURL : "https://narottam-portfolio.firebaseio.com", - projectId : "narottam-portfolio", - storageBucket : "narottam-portfolio.appspot.com", - messagingSenderId: "387012073941", - appId : "1:387012073941:web:a125957edf7307c366855c", - measurementId : "G-V3E6ZHHZVF", + databaseURL : "https://portfolio.firebaseio.com", + apiKey: "AIzaSyC3T0ZI9CDOi7GSnMW0vXkbwNlHkNFD4pQ", + authDomain: "portfolio-d5658.firebaseapp.com", + projectId: "portfolio-d5658", + storageBucket: "portfolio-d5658.appspot.com", + messagingSenderId: "166302306604", + appId: "1:166302306604:web:f10ff8ac69ab6c226e1c89", + measurementId: "G-HKCF6Q51Q5" }); const firestoreDB = firebaseConfig.firestore(); From ddc921693dfaa7d6224fdab9915ebb262dba6a44 Mon Sep 17 00:00:00 2001 From: narottambisht Date: Wed, 4 Dec 2024 16:43:55 +0530 Subject: [PATCH 2/3] fixed the styles and some other feat --- src/containers/About/index.js | 1 - src/containers/Home/index.js | 4 ++-- src/containers/Home/styles.js | 9 +++++++++ 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/containers/About/index.js b/src/containers/About/index.js index e3bf8ea..f4c4de0 100644 --- a/src/containers/About/index.js +++ b/src/containers/About/index.js @@ -12,7 +12,6 @@ const About = () => { useEffect(() => { firestoreDB.collection("about-info").onSnapshot(snapshot => { - console.log(snapshot.docs.map(doc => doc.data())[0].future_goals); setAboutStore(snapshot.docs.map(doc => doc.data())[0]); }); // eslint-disable-next-line react-hooks/exhaustive-deps diff --git a/src/containers/Home/index.js b/src/containers/Home/index.js index 598f7c7..3060a33 100644 --- a/src/containers/Home/index.js +++ b/src/containers/Home/index.js @@ -37,7 +37,7 @@ const Home = (props) => { - {`Hello! I am Narottam and I am a Team Lead working on web applications and web infrastructure. I have been working professionally for ${calcYearsOfExperience( + {`Hello! I am Narottam and I am a Tech Lead working on web applications and web infrastructure. I have been working professionally for ${calcYearsOfExperience( workExperience)} years but tinkering since a kid.`}

@@ -113,7 +113,7 @@ const Home = (props) => { { skill.skills_array.map((_skill, index) => { return ( - +
{_skill.skill_name}
) }) } diff --git a/src/containers/Home/styles.js b/src/containers/Home/styles.js index 170aa4d..cd2d45b 100644 --- a/src/containers/Home/styles.js +++ b/src/containers/Home/styles.js @@ -36,6 +36,15 @@ const homeStyles = makeStyles(theme => ({ }, marginTop: 15, marginBottom: 20 + }, + skillsPill: { + backgroundColor: 'red', + borderRadius: 10, + paddingRight: theme.spacing(2), + paddingLeft: theme.spacing(2), + paddingTop: 2, + paddingBottom: 2, + textAlign: 'center', } })); From 6993e09aef153d0ea188f976ff0f6ca56dc839a7 Mon Sep 17 00:00:00 2001 From: narottambisht Date: Fri, 3 Jan 2025 17:38:01 +0530 Subject: [PATCH 3/3] fixed the experience reversed not happening and ipsearch api failed call error --- src/containers/Home/index.js | 2 +- src/context/RootContext.js | 14 ++++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/containers/Home/index.js b/src/containers/Home/index.js index 3060a33..6f47952 100644 --- a/src/containers/Home/index.js +++ b/src/containers/Home/index.js @@ -62,7 +62,7 @@ const Home = (props) => { {workExperience.length > 0 && - workExperience.reverse().map((_workExperience, index) => { + workExperience.map((_workExperience, index) => { return (
diff --git a/src/context/RootContext.js b/src/context/RootContext.js index e500be1..794d271 100644 --- a/src/context/RootContext.js +++ b/src/context/RootContext.js @@ -6,10 +6,16 @@ export const RootContextProvider = props => { const [rootStore, setRootStore] = useState({ drawerOpen: false, theme: "dark" }); useEffect(() => { - async function fetchIpInfo () { - const ipInfo = await fetch("https://ipapi.co/json/"); - let ipInfoResponseJson = await ipInfo.json(); - setRootStore({ ...rootStore, ipInfo: ipInfoResponseJson }); + function fetchIpInfo () { + fetch("https://ipapi.co/json/").then(response => { + if (response.ok) { + let ipInfoResponseJson = response.json(); + setRootStore({ ...rootStore, ipInfo: ipInfoResponseJson }); + } + }).catch(error => { + console.log(error); + setRootStore({ ...rootStore, ipInfo: {} }); + }) } fetchIpInfo();