Advertisement
feighdead

onboarding.js (component)

Oct 24th, 2024
20
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. import { useNavigate } from 'react-router-dom';
  2. import { useState } from 'react';
  3.  
  4. const Onboarding = () => {
  5. const navigate = useNavigate();
  6. const [companyName, setCompanyName] = useState('');
  7.  
  8. const handleOnboardingComplete = (data) => {
  9. console.log("Onboarding complete, data:", data);
  10. navigate('/dashboard', {
  11. state: {
  12. company: data.company,
  13. role: data.role,
  14. resume: data.resume
  15. }
  16. });
  17. };
  18.  
  19. const handleCompanySubmit = () => {
  20. console.log("Company name submitted:", companyName);
  21. // Save this to state or pass it to the next step
  22. };
  23.  
  24. const handleCompanyChange = (e) => {
  25. const companyName = e.target.value;
  26. console.log("Company name input:", companyName);
  27. setCompanyName(companyName);
  28. };
  29.  
  30. // ... rest of your Onboarding component
  31.  
  32. return (
  33. <div>
  34. <input
  35. type="text"
  36. value={companyName}
  37. onChange={handleCompanyChange}
  38. placeholder="Enter company name"
  39. />
  40. <button onClick={handleCompanySubmit}>Submit</button>
  41. </div>
  42. );
  43. };
  44.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement