Fixed Confirm button on CareerSearch in Explorer
This commit is contained in:
parent
d42aaf1d7c
commit
17f18d255e
@ -61,7 +61,6 @@ const STATES = [
|
|||||||
{ name: 'Wyoming', code: 'WY' },
|
{ name: 'Wyoming', code: 'WY' },
|
||||||
];
|
];
|
||||||
|
|
||||||
// 2) Helper to convert state code => full name
|
|
||||||
function getFullStateName(code) {
|
function getFullStateName(code) {
|
||||||
const found = STATES.find((s) => s.code === code?.toUpperCase());
|
const found = STATES.find((s) => s.code === code?.toUpperCase());
|
||||||
return found ? found.name : '';
|
return found ? found.name : '';
|
||||||
@ -169,7 +168,6 @@ function CareerExplorer({ }) {
|
|||||||
fetchUserProfile();
|
fetchUserProfile();
|
||||||
}, [apiUrl]);
|
}, [apiUrl]);
|
||||||
|
|
||||||
// Load suggestions from Interest Inventory if provided (optional)
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (location.state?.careerSuggestions) {
|
if (location.state?.careerSuggestions) {
|
||||||
setCareerSuggestions(location.state.careerSuggestions);
|
setCareerSuggestions(location.state.careerSuggestions);
|
||||||
@ -207,13 +205,10 @@ function CareerExplorer({ }) {
|
|||||||
console.log('[handleCareerClick] career =>', career);
|
console.log('[handleCareerClick] career =>', career);
|
||||||
const socCode = career.code;
|
const socCode = career.code;
|
||||||
setSelectedCareer(career);
|
setSelectedCareer(career);
|
||||||
setLoading(true);
|
|
||||||
setError(null);
|
setError(null);
|
||||||
setCareerDetails({});
|
setCareerDetails({});
|
||||||
setSalaryData([]);
|
setSalaryData([]);
|
||||||
setEconomicProjections({});
|
setEconomicProjections({});
|
||||||
setError(null);
|
|
||||||
setLoading(true);
|
|
||||||
|
|
||||||
// We can set selectedCareer immediately so that our Modal condition is met.
|
// We can set selectedCareer immediately so that our Modal condition is met.
|
||||||
setSelectedCareer(career);
|
setSelectedCareer(career);
|
||||||
@ -221,7 +216,6 @@ function CareerExplorer({ }) {
|
|||||||
if (!socCode) {
|
if (!socCode) {
|
||||||
console.error('SOC Code is missing');
|
console.error('SOC Code is missing');
|
||||||
setError('SOC Code is missing');
|
setError('SOC Code is missing');
|
||||||
setLoading(false);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -382,7 +376,6 @@ function CareerExplorer({ }) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
const addCareerToList = (career) => {
|
const addCareerToList = (career) => {
|
||||||
const masterRatings = getCareerRatingsBySocCode(career.code);
|
const masterRatings = getCareerRatingsBySocCode(career.code);
|
||||||
|
|
||||||
@ -528,8 +521,12 @@ function CareerExplorer({ }) {
|
|||||||
<div className="flex justify-between items-center mb-4">
|
<div className="flex justify-between items-center mb-4">
|
||||||
<h2 className="text-xl font-semibold">Explore Careers</h2>
|
<h2 className="text-xl font-semibold">Explore Careers</h2>
|
||||||
<CareerSearch
|
<CareerSearch
|
||||||
onCareerSelected={(careerObj) => handleCareerClick(careerObj)}
|
onCareerSelected={(careerObj) => {
|
||||||
/>
|
console.log('[Dashboard] onCareerSelected =>', careerObj);
|
||||||
|
// Set the "pendingCareerForModal" so our useEffect fires
|
||||||
|
setPendingCareerForModal(careerObj);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h2 className="text-xl font-semibold mb-4">Career Comparison Matrix</h2>
|
<h2 className="text-xl font-semibold mb-4">Career Comparison Matrix</h2>
|
||||||
|
@ -3,15 +3,21 @@ import axios from 'axios';
|
|||||||
|
|
||||||
const apiUrl = process.env.REACT_APP_API_URL;
|
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);
|
const [error, setError] = useState(null);
|
||||||
|
|
||||||
console.log('CareerModal props:', { career, careerDetails, userState, areaTitle, userZipcode });
|
console.log('CareerModal props:', { career, careerDetails});
|
||||||
|
|
||||||
if (!careerDetails?.salaryData) {
|
if (!careerDetails?.salaryData) {
|
||||||
return <div>Loading career details...</div>;
|
return (
|
||||||
}
|
<div className="fixed inset-0 bg-gray-900 bg-opacity-70 flex justify-center items-center z-50">
|
||||||
|
<div className="bg-white rounded-lg shadow-lg p-6">
|
||||||
|
<p className="text-lg text-gray-700">Loading career details...</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
if (error) return <div>{error}</div>;
|
if (error) return <div>{error}</div>;
|
||||||
|
|
||||||
const calculateStabilityRating = (salaryData) => {
|
const calculateStabilityRating = (salaryData) => {
|
||||||
|
BIN
user_profile.db
BIN
user_profile.db
Binary file not shown.
Loading…
Reference in New Issue
Block a user