fix: url for links

pull/89/head
Pierre-Louis Guhur 1 year ago
parent 461674e923
commit 9a41f72e70

@ -48,28 +48,24 @@ const CandidateField = ({
: 'border border-dashed border-2 border-light border-opacity-25';
return (
<Row
className={`${activeClass} align-items-center ${className}`}
<div
className={`${activeClass} d-flex justify-content-between align-items-center ${className}`}
{...props}
>
<Col onClick={toggleSet} role="button" className="col-10 me-auto">
<Row className="gx-3">
<Col className="col-2 justify-content-start align-items-center d-flex">
<Image
src={image}
width={24}
height={24}
className={`${image == defaultAvatar ? 'default-avatar' : ''
} bg-primary`}
alt={t('common.thumbnail')}
/>
</Col>
<Col className="col-10 fw-bold">
{candidate.name ? candidate.name : t('admin.add-candidate')}
</Col>
</Row>
</Col>
<Col role="button" className="col-2 text-end">
<div onClick={toggleSet} role="button" className="py-3 flex-fill d-flex align-items-center ">
<Image
src={image}
width={24}
height={24}
className={`${image == defaultAvatar ? 'default-avatar' : ''
} bg-primary`}
alt={t('common.thumbnail')}
/>
<div className="ps-2 fw-bold">
{candidate.name ? candidate.name : t('admin.add-candidate')}
</div>
</div>
<div role="button" className="text-end">
{active ? (
<FontAwesomeIcon
icon={faTrashCan}
@ -79,7 +75,7 @@ const CandidateField = ({
) : (
<FontAwesomeIcon icon={faPlus} onClick={addCandidate} />
)}
</Col>
</div>
<CandidateModalSet
toggle={toggleSet}
isOpen={modalSet}
@ -90,7 +86,7 @@ const CandidateField = ({
isOpen={modalDel}
position={position}
/>
</Row>
</div >
);
};

@ -54,7 +54,7 @@ const CandidatesField = ({onSubmit}) => {
<CandidateField
key={index}
position={index}
className="px-1 py-3 my-3"
className="px-4 my-3"
/>
);
})}

@ -60,7 +60,7 @@ const CandidatesField = () => {
<CandidateField
position={i}
key={i}
className="text-primary m-0 py-2"
className="text-primary m-0"
/>
))}
</Container>

@ -19,7 +19,6 @@ const Order = () => {
value: !election.randomOrder,
});
};
console.log(election.randomOrder)
return (
<>

@ -57,7 +57,7 @@ export const sendAdminMail = async (
urlAdmin: URL,
) => {
/**
* Send an invitation mail using a micro-service with Netlify
* Send a reminder to admink panel
*/
if (!mail || !validateMail(mail)) {
throw new Error('Incorrect format for the email');

@ -4,25 +4,25 @@
import {getWindowUrl, displayRef} from './utils';
export const CREATE_ELECTION = '/admin/new/';
export const BALLOT = '/ballot/';
export const CREATE_ELECTION = '/admin/new';
export const BALLOT = '/ballot';
export const ENDED_VOTE = '/ballot/end';
export const VOTE = '/vote/';
export const RESULTS = '/result/';
export const VOTE = '/vote';
export const RESULTS = '/result';
export const getUrlVote = (electionRef: string | number, token?: string): URL => {
const origin = getWindowUrl();
const ref = typeof electionRef === "string" ? electionRef : electionRef.toString();
if (token)
return new URL(`/${VOTE}/${displayRef(ref)}/${token}`, origin);
return new URL(`/${VOTE}/${displayRef(ref)}`, origin);
return new URL(`${VOTE}/${displayRef(ref)}/${token}`, origin);
return new URL(`${VOTE}/${displayRef(ref)}`, origin);
}
export const getUrlResults = (electionRef: string | number): URL => {
const origin = getWindowUrl();
const ref = typeof electionRef === "string" ? electionRef : electionRef.toString();
return new URL(`/${RESULTS}/${displayRef(ref)}`, origin);
return new URL(`${RESULTS}/${displayRef(ref)}`, origin);
}
export const getUrlAdmin = (electionRef: string | number, adminToken: string): URL => {

Loading…
Cancel
Save