diff --git a/src/components/CareerExplorer.js b/src/components/CareerExplorer.js index 9977509..0aa854e 100644 --- a/src/components/CareerExplorer.js +++ b/src/components/CareerExplorer.js @@ -61,7 +61,6 @@ const STATES = [ { name: 'Wyoming', code: 'WY' }, ]; -// 2) Helper to convert state code => full name function getFullStateName(code) { const found = STATES.find((s) => s.code === code?.toUpperCase()); return found ? found.name : ''; @@ -142,7 +141,7 @@ function CareerExplorer({ }) { } else { // No inventory => no suggestions (or do something else here) setCareerSuggestions([]); - } + } // 4) Check if all priorities are answered const priorities = profileData.career_priorities @@ -168,8 +167,7 @@ function CareerExplorer({ }) { fetchUserProfile(); }, [apiUrl]); - - // Load suggestions from Interest Inventory if provided (optional) + useEffect(() => { if (location.state?.careerSuggestions) { setCareerSuggestions(location.state.careerSuggestions); @@ -207,13 +205,10 @@ function CareerExplorer({ }) { console.log('[handleCareerClick] career =>', career); const socCode = career.code; setSelectedCareer(career); - setLoading(true); setError(null); setCareerDetails({}); setSalaryData([]); setEconomicProjections({}); - setError(null); - setLoading(true); // We can set selectedCareer immediately so that our Modal condition is met. setSelectedCareer(career); @@ -221,7 +216,6 @@ function CareerExplorer({ }) { if (!socCode) { console.error('SOC Code is missing'); setError('SOC Code is missing'); - setLoading(false); return; } @@ -382,7 +376,6 @@ function CareerExplorer({ }) { } }; - const addCareerToList = (career) => { const masterRatings = getCareerRatingsBySocCode(career.code); @@ -528,8 +521,12 @@ function CareerExplorer({ }) {

Explore Careers

handleCareerClick(careerObj)} - /> + onCareerSelected={(careerObj) => { + console.log('[Dashboard] onCareerSelected =>', careerObj); + // Set the "pendingCareerForModal" so our useEffect fires + setPendingCareerForModal(careerObj); + }} + />

Career Comparison Matrix

diff --git a/src/components/CareerModal.js b/src/components/CareerModal.js index cb08ec2..2e4e420 100644 --- a/src/components/CareerModal.js +++ b/src/components/CareerModal.js @@ -3,15 +3,21 @@ import axios from 'axios'; const apiUrl = process.env.REACT_APP_API_URL; -function CareerModal({ career, careerDetails, userState, areaTitle, userZipcode, closeModal, addCareerToList }) { +function CareerModal({ career, careerDetails, closeModal, addCareerToList }) { const [error, setError] = useState(null); - console.log('CareerModal props:', { career, careerDetails, userState, areaTitle, userZipcode }); + console.log('CareerModal props:', { career, careerDetails}); if (!careerDetails?.salaryData) { - return
Loading career details...
; - } + return ( +
+
+

Loading career details...

+
+
+ ); +} if (error) return
{error}
; const calculateStabilityRating = (salaryData) => { diff --git a/user_profile.db b/user_profile.db index fbd2469..71f3857 100644 Binary files a/user_profile.db and b/user_profile.db differ