Skip to content

Commit cb7c8b7

Browse files
Fix affiliate onboarding page
The AI corrected the affiliate onboarding page to not assume affiliates use the dashboard, aligning with project requirements.
1 parent d6c3c6d commit cb7c8b7

File tree

1 file changed

+19
-15
lines changed

1 file changed

+19
-15
lines changed

src/pages/AffiliateOnboardingPage.tsx

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const AffiliateOnboardingPage = () => {
2020
setMessage('Votre compte Stripe Connect a été configuré avec succès ! Vous pouvez maintenant recevoir vos commissions automatiquement.');
2121
} else if (isRefresh) {
2222
setStatus('refresh');
23-
setMessage('Votre session d\'onboarding a expiré. Veuillez recommencer le processus depuis votre dashboard affilié.');
23+
setMessage('Votre session d\'onboarding a expiré. Veuillez recommencer le processus depuis le lien fourni par le propriétaire de la campagne.');
2424
} else if (accountId) {
2525
setStatus('loading');
2626
setMessage('Vérification du statut de votre compte...');
@@ -31,14 +31,18 @@ const AffiliateOnboardingPage = () => {
3131
}
3232
}, [accountId, isSuccess, isRefresh]);
3333

34-
const handleReturnToDashboard = () => {
35-
// Rediriger vers le dashboard affilié ou la page principale
36-
window.location.href = '/';
34+
const handleReturnToOrigin = () => {
35+
// Essayer de fermer la fenêtre, sinon rediriger
36+
try {
37+
window.close();
38+
} catch {
39+
window.location.href = '/';
40+
}
3741
};
3842

39-
const handleRestartOnboarding = () => {
40-
// Relancer le processus d'onboarding
41-
window.location.href = '/?restart_onboarding=true';
43+
const handleContactSupport = () => {
44+
// Ouvrir l'email de support
45+
window.location.href = 'mailto:support@refspring.app?subject=Problème configuration Stripe Connect';
4246
};
4347

4448
return (
@@ -130,25 +134,25 @@ const AffiliateOnboardingPage = () => {
130134
{/* Actions */}
131135
<div className="flex gap-3 justify-center">
132136
{status === 'success' && (
133-
<Button onClick={handleReturnToDashboard} className="min-w-[200px]">
134-
Retour au dashboard
137+
<Button onClick={handleReturnToOrigin} className="min-w-[200px]">
138+
Fermer cette fenêtre
135139
</Button>
136140
)}
137141

138142
{status === 'refresh' && (
139143
<>
140-
<Button variant="outline" onClick={handleReturnToDashboard}>
141-
Retour au dashboard
144+
<Button variant="outline" onClick={handleReturnToOrigin}>
145+
Fermer cette fenêtre
142146
</Button>
143-
<Button onClick={handleRestartOnboarding}>
144-
Recommencer la configuration
147+
<Button onClick={handleContactSupport}>
148+
Contacter le support
145149
</Button>
146150
</>
147151
)}
148152

149153
{status === 'error' && (
150-
<Button variant="outline" onClick={handleReturnToDashboard}>
151-
Retour au dashboard
154+
<Button variant="outline" onClick={handleContactSupport}>
155+
Contacter le support
152156
</Button>
153157
)}
154158

0 commit comments

Comments
 (0)