✨ Legal pages working
This commit is contained in:
parent
4ec6e40fa2
commit
d01984dd48
@ -53,12 +53,5 @@ export default function DefaultLegalDashboard(props: IProps) {
|
|||||||
[legalUid],
|
[legalUid],
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!legalUid) {
|
|
||||||
router.push(
|
|
||||||
Module.getInstance()
|
|
||||||
.get()
|
|
||||||
.modules.pages.Legal.pages.LegalInformations.props.path.replace("[legalUid]", ELegalOptions.LEGAL_MENTIONS),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
return <DefaultDashboardWithList {...props} onSelectedBlock={onSelectedBlock} blocks={blocks} noPadding />;
|
return <DefaultDashboardWithList {...props} onSelectedBlock={onSelectedBlock} blocks={blocks} noPadding />;
|
||||||
}
|
}
|
||||||
|
@ -1,31 +1,11 @@
|
|||||||
@import "@Themes/constants.scss";
|
.pdf-viewer {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
min-height: 100%;
|
||||||
|
min-width: 100%;
|
||||||
|
|
||||||
.root {
|
.no-pdf-text {
|
||||||
.subtitle {
|
padding: 16px;
|
||||||
margin-top: 32px;
|
text-align: center;
|
||||||
}
|
|
||||||
|
|
||||||
.rights-container {
|
|
||||||
margin-top: 32px;
|
|
||||||
padding: 32px 16px;
|
|
||||||
border: 1px solid gray;
|
|
||||||
.select-all-container {
|
|
||||||
margin-top: 32px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rights {
|
|
||||||
margin-top: 32px;
|
|
||||||
display: grid;
|
|
||||||
grid-template-columns: repeat(2, 1fr);
|
|
||||||
gap: 32px;
|
|
||||||
|
|
||||||
@media (max-width: $screen-m) {
|
|
||||||
grid-template-columns: 1fr;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.save-container {
|
|
||||||
margin-top: 32px;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
import classes from "./classes.module.scss";
|
||||||
import DefaultLegalDashboard, { ELegalOptions } from "@Front/Components/LayoutTemplates/DefaultLegalDashboard";
|
import DefaultLegalDashboard, { ELegalOptions } from "@Front/Components/LayoutTemplates/DefaultLegalDashboard";
|
||||||
|
import Typography, { ETypo, ETypoColor } from "@Front/Components/DesignSystem/Typography";
|
||||||
|
import Link from "next/link";
|
||||||
|
|
||||||
const pdfLinks: Record<ELegalOptions, string> = {
|
const pdfLinks: Record<ELegalOptions, string> = {
|
||||||
"mentions-legales": "https://s3.fr-par.scw.cloud/lecoffre.io-bucket/footer/mentions_legales.pdf",
|
"mentions-legales": "https://s3.fr-par.scw.cloud/lecoffre.io-bucket/footer/mentions_legales.pdf",
|
||||||
@ -17,7 +19,16 @@ export default function LegalInformations() {
|
|||||||
const legalUidTyped = legalUid as ELegalOptions;
|
const legalUidTyped = legalUid as ELegalOptions;
|
||||||
return (
|
return (
|
||||||
<DefaultLegalDashboard>
|
<DefaultLegalDashboard>
|
||||||
<embed src={pdfLinks[legalUidTyped]} width="100%" height="100%" />
|
<object data={pdfLinks[legalUidTyped]} type="application/pdf" width="100%" height="100%" className={classes["pdf-viewer"]}>
|
||||||
|
<Typography typo={ETypo.TEXT_LG_LIGHT} className={classes["no-pdf-text"]}>
|
||||||
|
Votre navigateur ne prend pas en charge l'affichage des pdf
|
||||||
|
<Typography typo={ETypo.TEXT_LG_LIGHT} type="span">
|
||||||
|
<Link href={pdfLinks[legalUidTyped]} target="_blank" style={{ color: `var(${ETypoColor.COLOR_PRIMARY_500})` }}>
|
||||||
|
cliquez ici pour télécharger le pdf.
|
||||||
|
</Link>
|
||||||
|
</Typography>
|
||||||
|
</Typography>
|
||||||
|
</object>
|
||||||
</DefaultLegalDashboard>
|
</DefaultLegalDashboard>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -1,17 +0,0 @@
|
|||||||
@import "@Themes/constants.scss";
|
|
||||||
|
|
||||||
.root {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
flex-direction: column;
|
|
||||||
min-height: 100%;
|
|
||||||
|
|
||||||
.no-role-selected {
|
|
||||||
width: 100%;
|
|
||||||
|
|
||||||
.choose-a-role {
|
|
||||||
margin-top: 96px;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,26 +1,23 @@
|
|||||||
import Typography, { ETypo, ETypoColor } from "@Front/Components/DesignSystem/Typography";
|
import DefaultLegalDashboard, { ELegalOptions } from "@Front/Components/LayoutTemplates/DefaultLegalDashboard";
|
||||||
|
import { useRouter } from "next/router";
|
||||||
import BasePage from "../Base";
|
import Module from "@Front/Config/Module";
|
||||||
import classes from "./classes.module.scss";
|
import { useEffect } from "react";
|
||||||
import DefaultLegalDashboard from "@Front/Components/LayoutTemplates/DefaultLegalDashboard";
|
|
||||||
|
|
||||||
type IProps = {};
|
type IProps = {};
|
||||||
type IState = {};
|
|
||||||
export default class Collaborators extends BasePage<IProps, IState> {
|
export default function Legal(props: IProps) {
|
||||||
public override render(): JSX.Element {
|
const router = useRouter();
|
||||||
return (
|
const { legalUid } = router.query;
|
||||||
<DefaultLegalDashboard>
|
|
||||||
<div className={classes["root"]}>
|
useEffect(() => {
|
||||||
<div className={classes["no-role-selected"]}>
|
if (!legalUid && router.isReady) {
|
||||||
<Typography typo={ETypo.TITLE_H1}>Gestion des pages légales</Typography>
|
router.push(
|
||||||
<div className={classes["choose-a-role"]}>
|
Module.getInstance()
|
||||||
<Typography typo={ETypo.TEXT_LG_REGULAR} color={ETypoColor.COLOR_NEUTRAL_500}>
|
.get()
|
||||||
Sélectionnez un rôle
|
.modules.pages.Legal.pages.LegalInformations.props.path.replace("[legalUid]", ELegalOptions.LEGAL_MENTIONS),
|
||||||
</Typography>
|
);
|
||||||
</div>
|
}
|
||||||
</div>
|
}, [legalUid, router]);
|
||||||
</div>
|
|
||||||
</DefaultLegalDashboard>
|
return <DefaultLegalDashboard />;
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user