Fix Outlook registration links
This commit is contained in:
1 parent
e170d57577
commit
15bc6f063d
5 files changed
+73
-16
No files matched your search
@@ -3,6 +3,7 @@ import { useEffect } from 'react';
|
||||
import Header from './components/Header.jsx';
|
||||
import Footer from './components/Footer.jsx';
|
||||
import Home from './pages/Home.jsx';
|
||||
import Inscription from './pages/Inscription.jsx';
|
||||
import Annuaire from './pages/Annuaire.jsx';
|
||||
import Association from './pages/Association.jsx';
|
||||
import RencontresPassees from './pages/RencontresPassees.jsx';
|
||||
@@ -33,6 +34,7 @@ export default function App() {
|
||||
<div style={{ flex: 1 }}>
|
||||
<Routes>
|
||||
<Route path="/" element={<Home />} />
|
||||
<Route path="/inscription/:id" element={<Inscription />} />
|
||||
<Route path="/annuaire" element={<Annuaire />} />
|
||||
<Route path="/rencontres-passees" element={<RencontresPassees />} />
|
||||
<Route path="/association" element={<Association />} />
|
||||
|
||||
@@ -6,7 +6,7 @@ import { api, dateParts } from '../lib/api.js';
|
||||
import Modal from '../components/Modal.jsx';
|
||||
import PastEventCard from '../components/PastEventCard.jsx';
|
||||
|
||||
function InscriptionModal({ rencontre, onClose, onDone }) {
|
||||
export function InscriptionModal({ rencontre, onClose, onDone }) {
|
||||
const { user, login } = useAuth();
|
||||
const [context, setContext] = useState(null);
|
||||
const [participants, setParticipants] = useState(['']);
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
import { useEffect, useState } from 'react';
|
||||
import { useNavigate, useParams } from 'react-router-dom';
|
||||
import { api } from '../lib/api.js';
|
||||
import { InscriptionModal } from './Home.jsx';
|
||||
|
||||
export default function Inscription() {
|
||||
const { id } = useParams();
|
||||
const navigate = useNavigate();
|
||||
const [rencontre, setRencontre] = useState(null);
|
||||
const [error, setError] = useState('');
|
||||
|
||||
useEffect(() => {
|
||||
api.get(`/api/public/rencontres/${id}`)
|
||||
.then((data) => setRencontre(data.rencontre))
|
||||
.catch((err) => setError(err.message));
|
||||
}, [id]);
|
||||
|
||||
const close = () => navigate('/', { replace: true });
|
||||
|
||||
if (error) {
|
||||
return (
|
||||
<main className="container" style={{ minHeight: '60vh', padding: '80px 32px', textAlign: 'center' }}>
|
||||
<h1 className="serif" style={{ fontSize: 30, marginBottom: 12 }}>Inscription indisponible</h1>
|
||||
<p className="error-text">{error}</p>
|
||||
<button className="btn btn-dark" style={{ marginTop: 24 }} onClick={close}>Retour à l'accueil</button>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
|
||||
if (!rencontre) return <main style={{ minHeight: '60vh' }} />;
|
||||
|
||||
return (
|
||||
<main style={{ minHeight: '60vh' }}>
|
||||
<InscriptionModal rencontre={rencontre} onClose={close} />
|
||||
</main>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user