✨ Legal pages working
This commit is contained in:
parent
c707910f8d
commit
4ec6e40fa2
@ -15,6 +15,10 @@
|
|||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
padding: var(--spacing-lg, 24px);
|
padding: var(--spacing-lg, 24px);
|
||||||
|
|
||||||
|
&[data-no-padding] {
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
@media (max-width: $screen-m) {
|
@media (max-width: $screen-m) {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
@ -13,19 +13,29 @@ export type IPropsDashboardWithList = {
|
|||||||
backArrowUrl?: string;
|
backArrowUrl?: string;
|
||||||
mobileBackText?: string;
|
mobileBackText?: string;
|
||||||
headerConnected?: boolean;
|
headerConnected?: boolean;
|
||||||
|
noPadding?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
type IProps = IPropsDashboardWithList & ISearchBlockListProps;
|
type IProps = IPropsDashboardWithList & ISearchBlockListProps;
|
||||||
|
|
||||||
export default function DefaultDashboardWithList(props: IProps) {
|
export default function DefaultDashboardWithList(props: IProps) {
|
||||||
const { hasBackArrow, backArrowUrl, children, blocks, onSelectedBlock, headerConnected = true, bottomButton } = props;
|
const {
|
||||||
|
hasBackArrow,
|
||||||
|
backArrowUrl,
|
||||||
|
children,
|
||||||
|
blocks,
|
||||||
|
onSelectedBlock,
|
||||||
|
headerConnected = true,
|
||||||
|
bottomButton,
|
||||||
|
noPadding = false,
|
||||||
|
} = props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={classes["root"]}>
|
<div className={classes["root"]}>
|
||||||
<Header isUserConnected={headerConnected} />
|
<Header isUserConnected={headerConnected} />
|
||||||
<div className={classes["content"]}>
|
<div className={classes["content"]}>
|
||||||
<SearchBlockList blocks={blocks} onSelectedBlock={onSelectedBlock} bottomButton={bottomButton} />
|
<SearchBlockList blocks={blocks} onSelectedBlock={onSelectedBlock} bottomButton={bottomButton} />
|
||||||
<div className={classes["right-side"]}>
|
<div className={classes["right-side"]} data-no-padding={noPadding}>
|
||||||
{hasBackArrow && (
|
{hasBackArrow && (
|
||||||
<div className={classes["back-arrow-desktop"]}>
|
<div className={classes["back-arrow-desktop"]}>
|
||||||
<BackArrow url={backArrowUrl ?? ""} />
|
<BackArrow url={backArrowUrl ?? ""} />
|
||||||
|
@ -0,0 +1,64 @@
|
|||||||
|
import { IBlock } from "@Front/Components/DesignSystem/SearchBlockList/BlockList/Block";
|
||||||
|
import { useRouter } from "next/router";
|
||||||
|
import DefaultDashboardWithList, { IPropsDashboardWithList } from "../DefaultDashboardWithList";
|
||||||
|
import { useMemo } from "react";
|
||||||
|
import Module from "@Front/Config/Module";
|
||||||
|
|
||||||
|
type IProps = IPropsDashboardWithList;
|
||||||
|
|
||||||
|
export enum ELegalOptions {
|
||||||
|
LEGAL_MENTIONS = "mentions-legales",
|
||||||
|
CGU = "cgu",
|
||||||
|
CGS = "cgs",
|
||||||
|
POLITIQUE_DE_CONFIDENTIALITE = "politique-de-confidentialite",
|
||||||
|
POLITIQUE_DE_GESTION_DES_COOKIES = "politique-de-gestion-des-cookies",
|
||||||
|
}
|
||||||
|
|
||||||
|
export default function DefaultLegalDashboard(props: IProps) {
|
||||||
|
const router = useRouter();
|
||||||
|
const { legalUid } = router.query;
|
||||||
|
|
||||||
|
const onSelectedBlock = (block: IBlock) => {
|
||||||
|
router.push(Module.getInstance().get().modules.pages.Legal.pages.LegalInformations.props.path.replace("[legalUid]", block.id));
|
||||||
|
};
|
||||||
|
|
||||||
|
const blocks: IBlock[] = useMemo<IBlock[]>(
|
||||||
|
() => [
|
||||||
|
{
|
||||||
|
id: ELegalOptions.LEGAL_MENTIONS,
|
||||||
|
primaryText: "Mentions légales",
|
||||||
|
isActive: legalUid === ELegalOptions.LEGAL_MENTIONS,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: ELegalOptions.CGU,
|
||||||
|
primaryText: "CGU",
|
||||||
|
isActive: legalUid === ELegalOptions.CGU,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: ELegalOptions.CGS,
|
||||||
|
primaryText: "CGS",
|
||||||
|
isActive: legalUid === ELegalOptions.CGS,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: ELegalOptions.POLITIQUE_DE_CONFIDENTIALITE,
|
||||||
|
primaryText: "Politique de confidentialité",
|
||||||
|
isActive: legalUid === ELegalOptions.POLITIQUE_DE_CONFIDENTIALITE,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: ELegalOptions.POLITIQUE_DE_GESTION_DES_COOKIES,
|
||||||
|
primaryText: "Politique de gestion des cookies",
|
||||||
|
isActive: legalUid === ELegalOptions.POLITIQUE_DE_GESTION_DES_COOKIES,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
[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,21 +1,16 @@
|
|||||||
import Folders, { IGetFoldersParams } from "@Front/Api/LeCoffreApi/Notary/Folders/Folders";
|
import Folders, { IGetFoldersParams } from "@Front/Api/LeCoffreApi/Notary/Folders/Folders";
|
||||||
import EFolderStatus from "le-coffre-resources/dist/Customer/EFolderStatus";
|
import EFolderStatus from "le-coffre-resources/dist/Customer/EFolderStatus";
|
||||||
import { OfficeFolder } from "le-coffre-resources/dist/Notary";
|
import { OfficeFolder } from "le-coffre-resources/dist/Notary";
|
||||||
import React, { ReactNode, useCallback, useEffect } from "react";
|
import React, { useCallback, useEffect } from "react";
|
||||||
import { EDocumentStatus } from "le-coffre-resources/dist/Notary/Document";
|
import { EDocumentStatus } from "le-coffre-resources/dist/Notary/Document";
|
||||||
|
|
||||||
import Module from "@Front/Config/Module";
|
import Module from "@Front/Config/Module";
|
||||||
import { IBlock } from "@Front/Components/DesignSystem/SearchBlockList/BlockList/Block";
|
import { IBlock } from "@Front/Components/DesignSystem/SearchBlockList/BlockList/Block";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import DefaultDashboardWithList from "../DefaultDashboardWithList";
|
import DefaultDashboardWithList, { IPropsDashboardWithList } from "../DefaultDashboardWithList";
|
||||||
|
|
||||||
type IProps = {
|
type IProps = IPropsDashboardWithList & {
|
||||||
title: string;
|
isArchived: boolean;
|
||||||
children?: ReactNode;
|
|
||||||
isArchived?: boolean;
|
|
||||||
hasBackArrow?: boolean;
|
|
||||||
backArrowUrl?: string;
|
|
||||||
mobileBackText?: string;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function DefaultNotaryDashboard(props: IProps) {
|
export default function DefaultNotaryDashboard(props: IProps) {
|
||||||
|
@ -0,0 +1,31 @@
|
|||||||
|
@import "@Themes/constants.scss";
|
||||||
|
|
||||||
|
.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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,23 @@
|
|||||||
|
import { useRouter } from "next/router";
|
||||||
|
import React from "react";
|
||||||
|
|
||||||
|
import DefaultLegalDashboard, { ELegalOptions } from "@Front/Components/LayoutTemplates/DefaultLegalDashboard";
|
||||||
|
|
||||||
|
const pdfLinks: Record<ELegalOptions, string> = {
|
||||||
|
"mentions-legales": "https://s3.fr-par.scw.cloud/lecoffre.io-bucket/footer/mentions_legales.pdf",
|
||||||
|
"politique-de-confidentialite": "https://s3.fr-par.scw.cloud/lecoffre.io-bucket/footer/politique_confidentialite.pdf",
|
||||||
|
"politique-de-gestion-des-cookies": "https://s3.fr-par.scw.cloud/lecoffre.io-bucket/footer/politique_cookies.pdf",
|
||||||
|
cgs: "https://s3.fr-par.scw.cloud/lecoffre.io-bucket/footer/cgs.pdf",
|
||||||
|
cgu: "https://s3.fr-par.scw.cloud/lecoffre.io-bucket/footer/cgu.pdf",
|
||||||
|
};
|
||||||
|
|
||||||
|
export default function LegalInformations() {
|
||||||
|
const router = useRouter();
|
||||||
|
let { legalUid } = router.query;
|
||||||
|
const legalUidTyped = legalUid as ELegalOptions;
|
||||||
|
return (
|
||||||
|
<DefaultLegalDashboard>
|
||||||
|
<embed src={pdfLinks[legalUidTyped]} width="100%" height="100%" />
|
||||||
|
</DefaultLegalDashboard>
|
||||||
|
);
|
||||||
|
}
|
17
src/front/Components/Layouts/Legal/classes.module.scss
Normal file
17
src/front/Components/Layouts/Legal/classes.module.scss
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
@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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
26
src/front/Components/Layouts/Legal/index.tsx
Normal file
26
src/front/Components/Layouts/Legal/index.tsx
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
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";
|
||||||
|
|
||||||
|
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>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
@ -390,6 +390,22 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"Legal": {
|
||||||
|
"enabled": true,
|
||||||
|
"props": {
|
||||||
|
"path": "/legal",
|
||||||
|
"labelKey": "legal"
|
||||||
|
},
|
||||||
|
"pages": {
|
||||||
|
"LegalInformations": {
|
||||||
|
"enabled": true,
|
||||||
|
"props": {
|
||||||
|
"path": "/legal/[legalUid]",
|
||||||
|
"labelKey": "legal_informations"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -390,6 +390,22 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"Legal": {
|
||||||
|
"enabled": true,
|
||||||
|
"props": {
|
||||||
|
"path": "/legal",
|
||||||
|
"labelKey": "legal"
|
||||||
|
},
|
||||||
|
"pages": {
|
||||||
|
"LegalInformations": {
|
||||||
|
"enabled": true,
|
||||||
|
"props": {
|
||||||
|
"path": "/legal/[legalUid]",
|
||||||
|
"labelKey": "legal_informations"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -390,6 +390,22 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"Legal": {
|
||||||
|
"enabled": true,
|
||||||
|
"props": {
|
||||||
|
"path": "/legal",
|
||||||
|
"labelKey": "legal"
|
||||||
|
},
|
||||||
|
"pages": {
|
||||||
|
"LegalInformations": {
|
||||||
|
"enabled": true,
|
||||||
|
"props": {
|
||||||
|
"path": "/legal/[legalUid]",
|
||||||
|
"labelKey": "legal_informations"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -390,6 +390,22 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"Legal": {
|
||||||
|
"enabled": true,
|
||||||
|
"props": {
|
||||||
|
"path": "/legal",
|
||||||
|
"labelKey": "legal"
|
||||||
|
},
|
||||||
|
"pages": {
|
||||||
|
"LegalInformations": {
|
||||||
|
"enabled": true,
|
||||||
|
"props": {
|
||||||
|
"path": "/legal/[legalUid]",
|
||||||
|
"labelKey": "legal_informations"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
5
src/pages/legal/[legalUid]/index.tsx
Normal file
5
src/pages/legal/[legalUid]/index.tsx
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
import LegalInformations from "@Front/Components/Layouts/Legal/LegalInformations";
|
||||||
|
|
||||||
|
export default function Route() {
|
||||||
|
return <LegalInformations />;
|
||||||
|
}
|
5
src/pages/legal/index.tsx
Normal file
5
src/pages/legal/index.tsx
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
import Legal from "@Front/Components/Layouts/Legal";
|
||||||
|
|
||||||
|
export default function Route() {
|
||||||
|
return <Legal />;
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user