accueil full ok
This commit is contained in:
parent
5432b19604
commit
38bafc63f6
@ -11,6 +11,8 @@ import {
|
||||
Box,
|
||||
CircularProgress,
|
||||
} from "@mui/material";
|
||||
import ReactQuill from "react-quill";
|
||||
import "react-quill/dist/quill.snow.css";
|
||||
|
||||
const GestionPageAccueil = () => {
|
||||
const navigate = useNavigate();
|
||||
@ -28,6 +30,14 @@ const GestionPageAccueil = () => {
|
||||
const [constructNote, setConstructNote] = useState("");
|
||||
const [constructText, setConstructText] = useState("");
|
||||
|
||||
const [expertiseTitle, setexpertiseTitle] = useState("");
|
||||
const [expertise1Title, setexpertise1Title] = useState("");
|
||||
const [expertise1Text, setexpertise1Text] = useState("");
|
||||
const [expertise2Title, setexpertise2Title] = useState("");
|
||||
const [expertise2Text, setexpertise2Text] = useState("");
|
||||
const [expertise3Title, setexpertise3Title] = useState("");
|
||||
const [expertise3Text, setexpertise3Text] = useState("");
|
||||
|
||||
// ✅ Redirection si non connecté
|
||||
useEffect(() => {
|
||||
if (!getToken()) {
|
||||
@ -73,6 +83,16 @@ const GestionPageAccueil = () => {
|
||||
setConstructNote(data.acf?.gdc_construct?.construct_note || "");
|
||||
setConstructText(data.acf?.gdc_construct?.construct_text || "");
|
||||
|
||||
// ✅ Expertises
|
||||
|
||||
setexpertiseTitle(data.acf?.titre_expertise || "");
|
||||
setexpertise1Title(data.acf?.gdc_expert?.titre_expertise_1 || "");
|
||||
setexpertise1Text(data.acf?.gdc_expert?.text_expertise_1 || "");
|
||||
setexpertise2Title(data.acf?.gdc_expert?.titre_expertise_2 || "");
|
||||
setexpertise2Text(data.acf?.gdc_expert?.text_expertise_2 || "");
|
||||
setexpertise3Title(data.acf?.gdc_expert?.titre_expertise_3 || "");
|
||||
setexpertise3Text(data.acf?.gdc_expert?.text_expertise_3 || "");
|
||||
|
||||
setLoading(false);
|
||||
} catch (error) {
|
||||
console.error("❌ Erreur chargement ACF :", error);
|
||||
@ -98,6 +118,15 @@ const GestionPageAccueil = () => {
|
||||
construct_note: constructNote,
|
||||
construct_text: constructText,
|
||||
},
|
||||
gdc_expert: {
|
||||
titre_expertise: expertiseTitle,
|
||||
titre_expertise_1: expertise1Title,
|
||||
text_expertise_1: expertise1Text,
|
||||
titre_expertise_2: expertise2Title,
|
||||
text_expertise_2: expertise2Text,
|
||||
titre_expertise_3: expertise3Title,
|
||||
text_expertise_3: expertise3Text,
|
||||
},
|
||||
};
|
||||
|
||||
await updateHomePageACF(13, newData);
|
||||
@ -128,7 +157,6 @@ const GestionPageAccueil = () => {
|
||||
|
||||
// ✅ Missions
|
||||
|
||||
|
||||
const addMission = () => {
|
||||
setMissions([
|
||||
...missions,
|
||||
@ -325,27 +353,122 @@ const GestionPageAccueil = () => {
|
||||
sx={{ mb: 2 }}
|
||||
/>
|
||||
|
||||
<TextField
|
||||
label="Texte Construct"
|
||||
fullWidth
|
||||
multiline
|
||||
rows={4}
|
||||
variant="outlined"
|
||||
<Typography sx={{ mb: 1, fontWeight: "bold" }}>
|
||||
Texte Construct
|
||||
</Typography>
|
||||
<ReactQuill
|
||||
theme="snow"
|
||||
value={constructText}
|
||||
onChange={(e) => setConstructText(e.target.value)}
|
||||
sx={{ mb: 2 }}
|
||||
onChange={setConstructText}
|
||||
style={{
|
||||
marginBottom: "20px",
|
||||
backgroundColor: "#fff",
|
||||
borderRadius: "8px",
|
||||
}}
|
||||
/>
|
||||
|
||||
<TextField
|
||||
label="Note formation"
|
||||
fullWidth
|
||||
variant="outlined"
|
||||
|
||||
<Typography sx={{ mb: 1, fontWeight: "bold" }}>
|
||||
Notes
|
||||
</Typography>
|
||||
<ReactQuill
|
||||
theme="snow"
|
||||
value={constructNote}
|
||||
onChange={(e) => setConstructNote(e.target.value)}
|
||||
sx={{ mb: 2 }}
|
||||
onChange={setConstructNote}
|
||||
style={{
|
||||
marginBottom: "20px",
|
||||
backgroundColor: "#fff",
|
||||
borderRadius: "8px",
|
||||
}}
|
||||
/>
|
||||
</Paper>
|
||||
|
||||
{/* ✅ Bloc Expertises */}
|
||||
<Paper elevation={3} sx={{ marginTop: "30px", padding: "20px" }}>
|
||||
<Typography variant="h4" sx={{ marginBottom: "10px" }}>
|
||||
🔧 Zone Expertises
|
||||
</Typography>
|
||||
|
||||
<Paper elevation={3} sx={{ marginTop: "30px", padding: "20px" }}>
|
||||
<TextField
|
||||
label="Titre h2"
|
||||
fullWidth
|
||||
variant="outlined"
|
||||
value={expertiseTitle}
|
||||
onChange={(e) => setexpertiseTitle(e.target.value)}
|
||||
sx={{ mb: 2 }}
|
||||
/>
|
||||
</Paper>
|
||||
|
||||
<Paper elevation={3} sx={{ marginTop: "30px", padding: "20px" }}>
|
||||
<TextField
|
||||
label="Titre h2"
|
||||
fullWidth
|
||||
variant="outlined"
|
||||
value={expertise1Title}
|
||||
onChange={(e) => setexpertise1Title(e.target.value)}
|
||||
sx={{ mb: 2 }}
|
||||
/>
|
||||
|
||||
<Typography sx={{ mb: 1, fontWeight: "bold" }}>Texte h2</Typography>
|
||||
<ReactQuill
|
||||
theme="snow"
|
||||
value={expertise1Text}
|
||||
onChange={setexpertise1Text}
|
||||
style={{
|
||||
marginBottom: "20px",
|
||||
backgroundColor: "#fff",
|
||||
borderRadius: "8px",
|
||||
}}
|
||||
/>
|
||||
</Paper>
|
||||
|
||||
<Paper elevation={3} sx={{ marginTop: "30px", padding: "20px" }}>
|
||||
<TextField
|
||||
label="Titre h2"
|
||||
fullWidth
|
||||
variant="outlined"
|
||||
value={expertise2Title}
|
||||
onChange={(e) => setexpertise2Title(e.target.value)}
|
||||
sx={{ mb: 2 }}
|
||||
/>
|
||||
|
||||
<Typography sx={{ mb: 1, fontWeight: "bold" }}>Texte h2</Typography>
|
||||
<ReactQuill
|
||||
theme="snow"
|
||||
value={expertise2Text}
|
||||
onChange={setexpertise2Text}
|
||||
style={{
|
||||
marginBottom: "20px",
|
||||
backgroundColor: "#fff",
|
||||
borderRadius: "8px",
|
||||
}}
|
||||
/>
|
||||
</Paper>
|
||||
|
||||
<Paper elevation={3} sx={{ marginTop: "30px", padding: "20px" }}>
|
||||
<TextField
|
||||
label="Titre h2"
|
||||
fullWidth
|
||||
variant="outlined"
|
||||
value={expertise3Title}
|
||||
onChange={(e) => setexpertise3Title(e.target.value)}
|
||||
sx={{ mb: 2 }}
|
||||
/>
|
||||
|
||||
<Typography sx={{ mb: 1, fontWeight: "bold" }}>Texte h2</Typography>
|
||||
<ReactQuill
|
||||
theme="snow"
|
||||
value={expertise3Text}
|
||||
onChange={setexpertise3Text}
|
||||
style={{
|
||||
marginBottom: "20px",
|
||||
backgroundColor: "#fff",
|
||||
borderRadius: "8px",
|
||||
}}
|
||||
/>
|
||||
</Paper>
|
||||
</Paper>
|
||||
|
||||
{/* ✅ Actions */}
|
||||
<Paper elevation={3} sx={{ marginTop: "30px", padding: "20px" }}>
|
||||
<Button
|
||||
|
||||
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user