From 4e9ebd7df2bba31167e4bdec79210a580a38fa30 Mon Sep 17 00:00:00 2001 From: Pierre-Louis Guhur Date: Sun, 6 Nov 2022 12:50:53 +0100 Subject: [PATCH] fix: optimize bootstrap --- pages/admin/new.tsx | 533 +----------------------------------- styles/scss/_bootstrap.scss | 52 +++- 2 files changed, 52 insertions(+), 533 deletions(-) diff --git a/pages/admin/new.tsx b/pages/admin/new.tsx index d577fef..8eafc30 100644 --- a/pages/admin/new.tsx +++ b/pages/admin/new.tsx @@ -32,7 +32,7 @@ const CreateElectionForm = () => { }; // at which creation step are we? - const [stepId, setStepId] = useState(2); + const [stepId, setStepId] = useState(0); const step = creationSteps[stepId]; let Step: JSX.Element; @@ -63,536 +63,5 @@ const CreateElectionForm = () => { ); }; -// -// { // -// } -// {waiting ? : ""} -//
-//
-// -// -// -//

Les candidats

-// -// -// -//

Paramètres du vote

-// -// -// -//

Confirmation

-// -// -//
-// -// -// -// -// -// -// -// -//
-// -// -//
-//
-//
-// -// -// -// -//
-//
Retour aux candidats
-// -// -// -//

Les candidats

-// -// -// -//

Paramètres du vote

-// -// -// -//

Confirmation

-// -// -//
-//
-//
{t("Vos paramètres")}
-// -// -// -// -// -// -// -// -//
-// -//
-// -//
-// -// -//

{t("No one will be able to see the result until the end date is reached or until all participants have voted.")}

-// -//
-// -//
-//
-//
-// -// -// -// -// -// -//
-//
-// -// -//
-//
-// { // setStartDate(date)} /> -// } -// {/* -// -// - {t("Starting date")} -// -// -// -// { -// setStart( -// new Date( -// timeMinusDate(start) + -// new Date(e.target.valueAsNumber).getTime() -// ) -// ); -// }} -// /> -// -// -// -// -// -// -// -// -// -// { -// setFinish( -// new Date( -// timeMinusDate(finish) + -// new Date(e.target.valueAsNumber).getTime() -// ) -// ); -// }} -// /> -// -// -// -// -// */} -//
-//
-// -// -// -// -// -// -// -// -//

{t("You can select here the number of grades for your election")}

-//
-// -//
-// -// -// -// -// -//

{t("Choisissez le nombre de mentions des votes.")}

-//
-// -// {badgesValues.map(f => ( -// -// -// ))} -//
-//

{t("Voici la liste des mentions de votre vote")}

-// {grades.map((mention, i) => { -// return ( -// -// {mention.label} -// -// ); -// })} -// -// -// -// -//
-//
-// -// -// -// -// -//

{t("You can select here the number of grades for your election")}

-// -// -//
-// {badgesValues.map(f => ( -// -// -// ))} -// -//
-// -// -// {grades.map((mention, i) => { -// return ( -// -// {mention.label} -// -// ); -// })} -// -//
-//
-// -// -// -// -// -// -// -// -//
-// -//
-// -//
-// -//

{t("Uniquement les personnes invités par mail pourront participé au vote")}

-//
-//
-// -// -// -// -// -// -//

{t("Copier-coller les emails des participants depuis un fichier Excel")}

-// -// -// -// -// -// -//

{t("À ")}

-// -// { /* { -// return isEmail(email); // return boolean -// }} -// getLabel={(email, index, removeEmail) => { -// return ( -//
-// {email} -// removeEmail(index)} -// > -// × -// -// -//
-// -// ); -// }} -// -// /> -// */} -//
-// -// -// -//
-//
-// -// -// -// -//
-// -// -// -//

{t("If you list voters' emails, only them will be able to access the election")}

-// { /* { -// return isEmail(email); // return boolean -// }} -// getLabel={(email, index, removeEmail) => { -// return ( -//
-// {email} -// removeEmail(index)} -// > -// × -// -//
-// ); -// }} -// />*/} -//
-// -// -// {t("Copier-coller les emails des participants depuis un fichier Excel")} -// -//
-// -//
-//
-// -// -// -//
-//
-// {check.ok ? ( -// -// ) : ( -//
-// -// -//
-// )} -//
-//
-//
-//
-// -// ); -// }; export default CreateElectionForm; -// -// const handleIsTimeLimited = (event) => { -// setTimeLimited(event.target.value === "1"); -// }; - -// const handleRestrictResultCheck = (event) => { -// setRestrictResult(event.target.value === "1"); -// }; -// const handleRestrictVote = (event) => { -// setRestrictVote(event.target.value === "1"); -// }; -// -// import {ReactMultiEmail, isEmail} from "react-multi-email"; -// import "react-multi-email/style.css"; -// import {toast, ToastContainer} from "react-toastify"; -// import "react-toastify/dist/ReactToastify.css"; -// -// -// -// // Retrieve the day and remove the time. Return a Date -// const dateMinusTime = (date) => -// new Date(getOnlyValidDate(date).getTime() - time(getOnlyValidDate(date))); -// -// const displayClockOptions = () => -// Array(24) -// .fill(1) -// .map((x, i) => ( -// -// )); -// -// switch (action.type) { -// case 'title': { -// election.title = action.value; -// return election; -// } -// case 'time': { -// election.endTime = action.value; -// return election; -// } -// -// } diff --git a/styles/scss/_bootstrap.scss b/styles/scss/_bootstrap.scss index 16dd020..018dd64 100644 --- a/styles/scss/_bootstrap.scss +++ b/styles/scss/_bootstrap.scss @@ -1 +1,51 @@ -@import "../../node_modules/bootstrap/scss/bootstrap"; +@import "../../node_modules/bootstrap/scss/mixins/banner"; +@include bsBanner(""); + + +// scss-docs-start import-stack +// Configuration +@import '../../node_modules/bootstrap/scss/functions'; +@import "../../node_modules/bootstrap/scss/variables"; +@import '../../node_modules/bootstrap/scss/maps'; +@import '../../node_modules/bootstrap/scss/mixins'; +@import '../../node_modules/bootstrap/scss/utilities'; + +// Layout & components +@import '../../node_modules/bootstrap/scss/root'; +@import '../../node_modules/bootstrap/scss/reboot'; +@import '../../node_modules/bootstrap/scss/type'; +// @import '../../node_modules/bootstrap/scss/images'; +@import '../../node_modules/bootstrap/scss/containers'; +@import '../../node_modules/bootstrap/scss/grid'; +// @import '../../node_modules/bootstrap/scss/tables'; +@import '../../node_modules/bootstrap/scss/forms'; +@import '../../node_modules/bootstrap/scss/buttons'; +// @import '../../node_modules/bootstrap/scss/transitions'; +// @import '../../node_modules/bootstrap/scss/dropdown'; +// @import '../../node_modules/bootstrap/scss/button-group'; +// @import '../../node_modules/bootstrap/scss/nav'; +// @import '../../node_modules/bootstrap/scss/navbar'; +// @import '../../node_modules/bootstrap/scss/card'; +// @import '../../node_modules/bootstrap/scss/accordion'; +// @import '../../node_modules/bootstrap/scss/breadcrumb'; +// @import '../../node_modules/bootstrap/scss/pagination'; +@import '../../node_modules/bootstrap/scss/badge'; +// @import '../../node_modules/bootstrap/scss/alert'; +// @import '../../node_modules/bootstrap/scss/progress'; +// @import '../../node_modules/bootstrap/scss/list-group'; +// @import '../../node_modules/bootstrap/scss/close'; +// @import '../../node_modules/bootstrap/scss/toasts'; +@import '../../node_modules/bootstrap/scss/modal'; +// @import '../../node_modules/bootstrap/scss/tooltip'; +// @import '../../node_modules/bootstrap/scss/popover'; +// @import '../../node_modules/bootstrap/scss/carousel'; +// @import '../../node_modules/bootstrap/scss/spinners'; +// @import '../../node_modules/bootstrap/scss/offcanvas'; +// @import '../../node_modules/bootstrap/scss/placeholders'; + +// Helpers +@import '../../node_modules/bootstrap/scss/helpers'; + +// Utilities +@import '../../node_modules/bootstrap/scss/utilities/api'; +// scss-docs-end import-stack