Mise à jour des pages d'accueil
This commit is contained in:
@@ -93,8 +93,8 @@ export default function FamilleEntreprises() {
|
||||
const [editTarget, setEditTarget] = useState(null); // membre à éditer
|
||||
|
||||
/* Formulaires */
|
||||
const emptyFam = { prenom: '', nom_famille: '' };
|
||||
const emptyEnt = { nom: '', type_fiscal: 'PM' };
|
||||
const emptyFam = { prenom: '', nom_famille: '', email: '' };
|
||||
const emptyEnt = { nom: '', type_fiscal: 'PM', email: '' };
|
||||
const [famForm, setFamForm] = useState(emptyFam);
|
||||
const [entForm, setEntForm] = useState(emptyEnt);
|
||||
const [saving, setSaving] = useState(false);
|
||||
@@ -116,10 +116,10 @@ export default function FamilleEntreprises() {
|
||||
setEditTarget(m);
|
||||
if (m.type === 'famille') {
|
||||
const restNom = m.prenom ? m.nom.replace(m.prenom, '').trim() : m.nom;
|
||||
setFamForm({ prenom: m.prenom || '', nom_famille: restNom });
|
||||
setFamForm({ prenom: m.prenom || '', nom_famille: restNom, email: m.email || '' });
|
||||
setModalFamille(true);
|
||||
} else {
|
||||
setEntForm({ nom: m.nom, type_fiscal: m.type_fiscal || 'PM' });
|
||||
setEntForm({ nom: m.nom, type_fiscal: m.type_fiscal || 'PM', email: m.email || '' });
|
||||
setModalEntreprise(true);
|
||||
}
|
||||
};
|
||||
@@ -142,6 +142,7 @@ export default function FamilleEntreprises() {
|
||||
prenom: famForm.prenom.trim() || null,
|
||||
type: 'famille',
|
||||
type_fiscal: 'PP',
|
||||
email: famForm.email.trim() || null,
|
||||
};
|
||||
if (editTarget) {
|
||||
await api.put(`/investisseurs/${editTarget.id}`, payload);
|
||||
@@ -163,6 +164,7 @@ export default function FamilleEntreprises() {
|
||||
prenom: null,
|
||||
type: 'entreprise',
|
||||
type_fiscal: entForm.type_fiscal,
|
||||
email: entForm.email.trim() || null,
|
||||
};
|
||||
if (editTarget) {
|
||||
await api.put(`/investisseurs/${editTarget.id}`, payload);
|
||||
@@ -279,6 +281,12 @@ export default function FamilleEntreprises() {
|
||||
onChange={e => setFamForm({ ...famForm, nom_famille: e.target.value })}
|
||||
placeholder="CROGUENNEC" />
|
||||
</div>
|
||||
<div className="modal-field">
|
||||
<label>Adresse e-mail <span className="text-muted" style={{ fontWeight: 400 }}>(optionnel)</span></label>
|
||||
<input type="email" value={famForm.email}
|
||||
onChange={e => setFamForm({ ...famForm, email: e.target.value })}
|
||||
placeholder="olivier@example.com" />
|
||||
</div>
|
||||
</form>
|
||||
</Modal>
|
||||
|
||||
@@ -317,6 +325,12 @@ export default function FamilleEntreprises() {
|
||||
<option value="SA">SA</option>
|
||||
</select>
|
||||
</div>
|
||||
<div className="modal-field">
|
||||
<label>Adresse e-mail <span className="text-muted" style={{ fontWeight: 400 }}>(optionnel)</span></label>
|
||||
<input type="email" value={entForm.email}
|
||||
onChange={e => setEntForm({ ...entForm, email: e.target.value })}
|
||||
placeholder="contact@entreprise.com" />
|
||||
</div>
|
||||
</form>
|
||||
</Modal>
|
||||
<ConfirmModal
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { useState, useEffect } from 'react';
|
||||
import { Link } from 'react-router-dom';
|
||||
import AuthBgCol from '../components/AuthBgCol.jsx';
|
||||
|
||||
export default function ForgotPassword() {
|
||||
const [email, setEmail] = useState('');
|
||||
@@ -35,39 +36,8 @@ export default function ForgotPassword() {
|
||||
return (
|
||||
<div style={{ display: 'flex', minHeight: '100dvh' }}>
|
||||
|
||||
{/* ── Colonne gauche — image ───────────────────────────── */}
|
||||
<div className="login-bg-col" style={{
|
||||
flex: '1 1 50%',
|
||||
display: 'none',
|
||||
position: 'relative',
|
||||
overflow: 'hidden',
|
||||
background: '#0d0d0d',
|
||||
}}>
|
||||
<img
|
||||
src="/login-bg.jpg"
|
||||
alt=""
|
||||
aria-hidden="true"
|
||||
onError={e => { e.target.style.display = 'none'; }}
|
||||
style={{
|
||||
position: 'absolute', inset: 0,
|
||||
width: '100%', height: '100%',
|
||||
objectFit: 'cover', opacity: 0.85,
|
||||
}}
|
||||
/>
|
||||
<div style={{
|
||||
position: 'absolute', bottom: 40, left: 40,
|
||||
color: '#fff',
|
||||
display: 'flex', alignItems: 'center', gap: 12,
|
||||
}}>
|
||||
{appInfo.iconUrl && (
|
||||
<img src={appInfo.iconUrl} alt="" width={36} height={36}
|
||||
style={{ borderRadius: 8, flexShrink: 0 }} />
|
||||
)}
|
||||
<span style={{ fontSize: 18, fontWeight: 600, letterSpacing: '-0.3px' }}>
|
||||
{appInfo.appName}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<AuthBgCol appInfo={appInfo} />
|
||||
|
||||
|
||||
{/* ── Colonne droite — formulaire ──────────────────────── */}
|
||||
<div style={{
|
||||
@@ -212,12 +182,6 @@ export default function ForgotPassword() {
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<style>{`
|
||||
@media (min-width: 768px) {
|
||||
.login-bg-col { display: block !important; }
|
||||
}
|
||||
`}</style>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ import { useState, useEffect, useRef } from 'react';
|
||||
import { Link, useNavigate } from 'react-router-dom';
|
||||
import { useAuth } from '../context/AuthContext.jsx';
|
||||
import { api } from '../api.js';
|
||||
import AuthBgCol from '../components/AuthBgCol.jsx';
|
||||
|
||||
// ── Helpers ────────────────────────────────────────────────────────────────
|
||||
const DEVICE_KEY = 'cl_device_token';
|
||||
@@ -12,25 +13,6 @@ function fmtCountdown(sec) {
|
||||
return `${m}:${s}`;
|
||||
}
|
||||
|
||||
// ── Colonne image gauche (partagée) ───────────────────────────────────────
|
||||
function BgCol({ appInfo }) {
|
||||
return (
|
||||
<div className="login-bg-col" style={{
|
||||
flex: '1 1 50%', display: 'none',
|
||||
position: 'relative', overflow: 'hidden', background: '#0d0d0d',
|
||||
}}>
|
||||
<img src="/login-bg.jpg" alt="" aria-hidden="true"
|
||||
onError={e => { e.target.style.display = 'none'; }}
|
||||
style={{ position: 'absolute', inset: 0, width: '100%', height: '100%', objectFit: 'cover', opacity: 0.85 }}
|
||||
/>
|
||||
<div style={{ position: 'absolute', bottom: 40, left: 40, color: '#fff', display: 'flex', alignItems: 'center', gap: 12 }}>
|
||||
{appInfo.iconUrl && <img src={appInfo.iconUrl} alt="" width={36} height={36} style={{ borderRadius: 8, flexShrink: 0 }} />}
|
||||
<span style={{ fontSize: 18, fontWeight: 600, letterSpacing: '-0.3px' }}>{appInfo.appName}</span>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
// ── Header logo (colonne droite) ──────────────────────────────────────────
|
||||
function AppHeader({ appInfo }) {
|
||||
return (
|
||||
@@ -188,7 +170,7 @@ export default function Login() {
|
||||
|
||||
return (
|
||||
<div style={{ display: 'flex', minHeight: '100dvh' }}>
|
||||
<BgCol appInfo={appInfo} />
|
||||
<AuthBgCol appInfo={appInfo} />
|
||||
|
||||
<div style={{
|
||||
flex: '1 1 50%', display: 'flex', flexDirection: 'column',
|
||||
@@ -381,9 +363,6 @@ export default function Login() {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<style>{`
|
||||
@media (min-width: 768px) { .login-bg-col { display: block !important; } }
|
||||
`}</style>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ import { useState, useEffect } from 'react';
|
||||
import { Link, useNavigate } from 'react-router-dom';
|
||||
import { useAuth } from '../context/AuthContext.jsx';
|
||||
import PasswordStrength from '../components/PasswordStrength.jsx';
|
||||
import AuthBgCol from '../components/AuthBgCol.jsx';
|
||||
|
||||
export default function Register() {
|
||||
const { register } = useAuth();
|
||||
@@ -39,39 +40,8 @@ export default function Register() {
|
||||
return (
|
||||
<div style={{ display: 'flex', minHeight: '100dvh' }}>
|
||||
|
||||
{/* ── Colonne gauche — image ───────────────────────────── */}
|
||||
<div className="login-bg-col" style={{
|
||||
flex: '1 1 50%',
|
||||
display: 'none',
|
||||
position: 'relative',
|
||||
overflow: 'hidden',
|
||||
background: '#0d0d0d',
|
||||
}}>
|
||||
<img
|
||||
src="/login-bg.jpg"
|
||||
alt=""
|
||||
aria-hidden="true"
|
||||
onError={e => { e.target.style.display = 'none'; }}
|
||||
style={{
|
||||
position: 'absolute', inset: 0,
|
||||
width: '100%', height: '100%',
|
||||
objectFit: 'cover', opacity: 0.85,
|
||||
}}
|
||||
/>
|
||||
<div style={{
|
||||
position: 'absolute', bottom: 40, left: 40,
|
||||
color: '#fff',
|
||||
display: 'flex', alignItems: 'center', gap: 12,
|
||||
}}>
|
||||
{appInfo.iconUrl && (
|
||||
<img src={appInfo.iconUrl} alt="" width={36} height={36}
|
||||
style={{ borderRadius: 8, flexShrink: 0 }} />
|
||||
)}
|
||||
<span style={{ fontSize: 18, fontWeight: 600, letterSpacing: '-0.3px' }}>
|
||||
{appInfo.appName}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<AuthBgCol appInfo={appInfo} />
|
||||
|
||||
|
||||
{/* ── Colonne droite — formulaire ──────────────────────── */}
|
||||
<div style={{
|
||||
@@ -255,12 +225,6 @@ export default function Register() {
|
||||
</>)} {/* fin verifyEmail ternaire */}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<style>{`
|
||||
@media (min-width: 768px) {
|
||||
.login-bg-col { display: block !important; }
|
||||
}
|
||||
`}</style>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { useState, useEffect } from 'react';
|
||||
import { Link, useNavigate, useSearchParams } from 'react-router-dom';
|
||||
import PasswordStrength from '../components/PasswordStrength.jsx';
|
||||
import AuthBgCol from '../components/AuthBgCol.jsx';
|
||||
|
||||
export default function ResetPassword() {
|
||||
const [params] = useSearchParams();
|
||||
@@ -42,39 +43,8 @@ export default function ResetPassword() {
|
||||
return (
|
||||
<div style={{ display: 'flex', minHeight: '100dvh' }}>
|
||||
|
||||
{/* ── Colonne gauche — image ───────────────────────────── */}
|
||||
<div className="login-bg-col" style={{
|
||||
flex: '1 1 50%',
|
||||
display: 'none',
|
||||
position: 'relative',
|
||||
overflow: 'hidden',
|
||||
background: '#0d0d0d',
|
||||
}}>
|
||||
<img
|
||||
src="/login-bg.jpg"
|
||||
alt=""
|
||||
aria-hidden="true"
|
||||
onError={e => { e.target.style.display = 'none'; }}
|
||||
style={{
|
||||
position: 'absolute', inset: 0,
|
||||
width: '100%', height: '100%',
|
||||
objectFit: 'cover', opacity: 0.85,
|
||||
}}
|
||||
/>
|
||||
<div style={{
|
||||
position: 'absolute', bottom: 40, left: 40,
|
||||
color: '#fff',
|
||||
display: 'flex', alignItems: 'center', gap: 12,
|
||||
}}>
|
||||
{appInfo.iconUrl && (
|
||||
<img src={appInfo.iconUrl} alt="" width={36} height={36}
|
||||
style={{ borderRadius: 8, flexShrink: 0 }} />
|
||||
)}
|
||||
<span style={{ fontSize: 18, fontWeight: 600, letterSpacing: '-0.3px' }}>
|
||||
{appInfo.appName}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<AuthBgCol appInfo={appInfo} />
|
||||
|
||||
|
||||
{/* ── Colonne droite — formulaire ──────────────────────── */}
|
||||
<div style={{
|
||||
@@ -245,12 +215,6 @@ export default function ResetPassword() {
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<style>{`
|
||||
@media (min-width: 768px) {
|
||||
.login-bg-col { display: block !important; }
|
||||
}
|
||||
`}</style>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { useState, useEffect } from 'react';
|
||||
import { Link, useSearchParams } from 'react-router-dom';
|
||||
import AuthBgCol from '../components/AuthBgCol.jsx';
|
||||
|
||||
export default function VerifyEmail() {
|
||||
const [params] = useSearchParams();
|
||||
@@ -26,19 +27,8 @@ export default function VerifyEmail() {
|
||||
return (
|
||||
<div style={{ display: 'flex', minHeight: '100dvh' }}>
|
||||
|
||||
<div className="login-bg-col" style={{
|
||||
flex: '1 1 50%', display: 'none', position: 'relative',
|
||||
overflow: 'hidden', background: '#0d0d0d',
|
||||
}}>
|
||||
<img src="/login-bg.jpg" alt="" aria-hidden="true"
|
||||
onError={e => { e.target.style.display = 'none'; }}
|
||||
style={{ position: 'absolute', inset: 0, width: '100%', height: '100%', objectFit: 'cover', opacity: 0.85 }}
|
||||
/>
|
||||
<div style={{ position: 'absolute', bottom: 40, left: 40, color: '#fff', display: 'flex', alignItems: 'center', gap: 12 }}>
|
||||
{appInfo.iconUrl && <img src={appInfo.iconUrl} alt="" width={36} height={36} style={{ borderRadius: 8 }} />}
|
||||
<span style={{ fontSize: 18, fontWeight: 600 }}>{appInfo.appName}</span>
|
||||
</div>
|
||||
</div>
|
||||
<AuthBgCol appInfo={appInfo} />
|
||||
|
||||
|
||||
<div style={{
|
||||
flex: '1 1 50%', display: 'flex', flexDirection: 'column',
|
||||
@@ -118,10 +108,6 @@ export default function VerifyEmail() {
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<style>{`
|
||||
@media (min-width: 768px) { .login-bg-col { display: block !important; } }
|
||||
`}</style>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user