✨ Legal pages working
This commit is contained in:
parent
4ec6e40fa2
commit
d01984dd48
@ -53,12 +53,5 @@ export default function DefaultLegalDashboard(props: IProps) {
|
||||
[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 />;
|
||||
}
|
||||
|
@ -1,31 +1,11 @@
|
||||
@import "@Themes/constants.scss";
|
||||
.pdf-viewer {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
min-height: 100%;
|
||||
min-width: 100%;
|
||||
|
||||
.root {
|
||||
.subtitle {
|
||||
margin-top: 32px;
|
||||
}
|
||||
|
||||
.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;
|
||||
}
|
||||
.no-pdf-text {
|
||||
padding: 16px;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,9 @@
|
||||
import { useRouter } from "next/router";
|
||||
import React from "react";
|
||||
|
||||
import classes from "./classes.module.scss";
|
||||
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> = {
|
||||
"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;
|
||||
return (
|
||||
<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>
|
||||
);
|
||||
}
|
||||
|
@ -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 BasePage from "../Base";
|
||||
import classes from "./classes.module.scss";
|
||||
import DefaultLegalDashboard from "@Front/Components/LayoutTemplates/DefaultLegalDashboard";
|
||||
import DefaultLegalDashboard, { ELegalOptions } from "@Front/Components/LayoutTemplates/DefaultLegalDashboard";
|
||||
import { useRouter } from "next/router";
|
||||
import Module from "@Front/Config/Module";
|
||||
import { useEffect } from "react";
|
||||
|
||||
type IProps = {};
|
||||
type IState = {};
|
||||
export default class Collaborators extends BasePage<IProps, IState> {
|
||||
public override render(): JSX.Element {
|
||||
return (
|
||||
<DefaultLegalDashboard>
|
||||
<div className={classes["root"]}>
|
||||
<div className={classes["no-role-selected"]}>
|
||||
<Typography typo={ETypo.TITLE_H1}>Gestion des pages légales</Typography>
|
||||
<div className={classes["choose-a-role"]}>
|
||||
<Typography typo={ETypo.TEXT_LG_REGULAR} color={ETypoColor.COLOR_NEUTRAL_500}>
|
||||
Sélectionnez un rôle
|
||||
</Typography>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</DefaultLegalDashboard>
|
||||
);
|
||||
}
|
||||
|
||||
export default function Legal(props: IProps) {
|
||||
const router = useRouter();
|
||||
const { legalUid } = router.query;
|
||||
|
||||
useEffect(() => {
|
||||
if (!legalUid && router.isReady) {
|
||||
router.push(
|
||||
Module.getInstance()
|
||||
.get()
|
||||
.modules.pages.Legal.pages.LegalInformations.props.path.replace("[legalUid]", ELegalOptions.LEGAL_MENTIONS),
|
||||
);
|
||||
}
|
||||
}, [legalUid, router]);
|
||||
|
||||
return <DefaultLegalDashboard />;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user