diff --git a/src/components/pages/OnboardingWizard.tsx b/src/components/pages/OnboardingWizard.tsx index f1d198e..ffad8ec 100644 --- a/src/components/pages/OnboardingWizard.tsx +++ b/src/components/pages/OnboardingWizard.tsx @@ -3,53 +3,28 @@ import { useSeller } from '../../context/SellerContext'; export default function OnboardingWizard() { const { - profileStep, setProfileStep, - setIsProfileComplete, setCurrentPage, - businessType, setBusinessType, - gstin, setGstin, - storeSlug, setStoreSlug, - supportEmail, setSupportEmail, - supportPhone, setSupportPhone, - selectedCategories, setSelectedCategories, - saveProfileBackend + saveProfileBackend, + setIsProfileComplete, + setCurrentPage } = useSeller(); const handleNext = () => { - const isLastStep = profileStep === 3; - saveProfileBackend(isLastStep) + saveProfileBackend(true) .then(() => { - if (!isLastStep) { - setProfileStep(profileStep + 1); - } else { - setIsProfileComplete(true); - setCurrentPage('dashboard'); - } + setIsProfileComplete(true); + setCurrentPage('dashboard'); }) .catch((err: Error) => { alert("Failed to save progress: " + err.message); }); }; - const handleBack = () => { - if (profileStep > 1) { - setProfileStep(profileStep - 1); - } - }; - - const toggleCategory = (cat: string) => { - if (selectedCategories.includes(cat)) { - setSelectedCategories(selectedCategories.filter((c: string) => c !== cat)); - } else { - setSelectedCategories([...selectedCategories, cat]); - } - }; - const renderStep1 = () => (
{/* Left Column (Text) */}

- Welcome to Tradhox — Step 1 of 3 + Welcome to Tradhox

Every Piece You List Keeps a Craft Alive @@ -81,7 +56,7 @@ export default function OnboardingWizard() {
@@ -131,132 +106,10 @@ export default function OnboardingWizard() {

); - const renderStep2 = () => ( -
-
-
-

- Step 2 of 3 -

-

- Business Details -

- -
- -
-
- -
-
-
- -
- -
- setGstin(e.target.value)} /> - receipt_long -
-
- -
-
-
- -
- setSupportEmail(e.target.value)} /> - mail -
-
-
-
-
- -
- setSupportPhone(e.target.value)} /> - phone -
-
-
-
- -
- -
-

- tradhox.com/store/ -

-

- setStoreSlug(e.target.value)} /> -

-
-
- -
- - -
-
-
-
- ); - - const renderStep3 = () => { - const availableCategories = ['Textiles & Apparel', 'Home Decor', 'Jewelry', 'Art & Collectibles', 'Beauty & Wellness', 'Food & Beverages']; - - return ( -
-
-
-

- Step 3 of 3 -

-

- What do you sell? -

-

Select all categories that apply to your handcrafted products.

- -
- {availableCategories.map(cat => ( -
-
toggleCategory(cat)} - style={{ border: selectedCategories.includes(cat) ? '2px solid var(--bulma-primary)' : '2px solid transparent' }} - > - - - {selectedCategories.includes(cat) ? 'check_circle' : 'circle'} - - - - {cat} - -
-
- ))} -
- -
- - -
-
-
-
- ); - }; - return (
- {profileStep === 1 && renderStep1()} - {profileStep === 2 && renderStep2()} - {profileStep === 3 && renderStep3()} + {renderStep1()}
); diff --git a/src/context/SellerContext.tsx b/src/context/SellerContext.tsx index 6614212..23e3b72 100644 --- a/src/context/SellerContext.tsx +++ b/src/context/SellerContext.tsx @@ -584,11 +584,11 @@ export const SellerProvider: React.FC<{children: React.ReactNode}> = ({ children categories: selectedCategories, aadhar_file: aadharFile, pan_file: panFile, - aadhar_s3_key: aadharS3Key || 'suppliers/default/aadhar.pdf', - pan_s3_key: panS3Key || 'suppliers/default/pan.pdf', + aadhar_s3_key: aadharS3Key || null, + pan_s3_key: panS3Key || null, store_name: storeName, store_logo: storeLogo || 'https://images.unsplash.com/photo-1513519245088-0e12902e5a38?auto=format&fit=crop&q=80&w=800', - logo_s3_key: logoS3Key || 'suppliers/default/logo.jpg', + logo_s3_key: logoS3Key || null, business_bio: businessBio, street: address.street, city: address.city,