From 4a53e5536e26277de4a9f8e817b001b6742fbd49 Mon Sep 17 00:00:00 2001 From: Maxime Lalo Date: Thu, 20 Apr 2023 16:25:21 +0200 Subject: [PATCH] :sparkles: Documents working --- .../FilePreview/classes.module.scss | 4 + .../classes.module.scss | 44 ++++++++-- .../DefaultNotaryDashboard/index.tsx | 33 +++++++- .../Folder/ViewDocuments/classes.module.scss | 28 +++++++ .../Layouts/Folder/ViewDocuments/index.tsx | 81 +++++++++++++++++++ .../document/[documentUid]/index.tsx | 5 ++ 6 files changed, 186 insertions(+), 9 deletions(-) create mode 100644 src/front/Components/Layouts/Folder/ViewDocuments/classes.module.scss create mode 100644 src/front/Components/Layouts/Folder/ViewDocuments/index.tsx create mode 100644 src/pages/folder/[folderUid]/document/[documentUid]/index.tsx diff --git a/src/front/Components/DesignSystem/FilePreview/classes.module.scss b/src/front/Components/DesignSystem/FilePreview/classes.module.scss index 95b916b2..b359b71f 100644 --- a/src/front/Components/DesignSystem/FilePreview/classes.module.scss +++ b/src/front/Components/DesignSystem/FilePreview/classes.module.scss @@ -1,15 +1,19 @@ .root { height: inherit; + min-height: inherit; .file-container { height: inherit; + min-height: inherit; .image { width: 100%; height: inherit; + min-height: inherit; object-fit: contain; } .pdf { width: 100%; + min-height: inherit; height: inherit; } } diff --git a/src/front/Components/LayoutTemplates/DefaultNotaryDashboard/classes.module.scss b/src/front/Components/LayoutTemplates/DefaultNotaryDashboard/classes.module.scss index b9457cb1..7bd278e7 100644 --- a/src/front/Components/LayoutTemplates/DefaultNotaryDashboard/classes.module.scss +++ b/src/front/Components/LayoutTemplates/DefaultNotaryDashboard/classes.module.scss @@ -36,8 +36,8 @@ overflow: hidden; @media (max-width: ($screen-m - 1px)) { - width: 83px; - min-width: 83px; + width: 56px; + min-width: 56px; transform: translateX(-389px); &.opened { @@ -46,6 +46,16 @@ min-width: 389px; } } + + @media (max-width: $screen-s) { + width: 0px; + min-width: 0px; + + &.opened { + width: 100vw; + min-width: 100vw; + } + } } .closable-left-side { @@ -54,8 +64,8 @@ z-index: 0; display: flex; justify-content: center; - min-width: 83px; - max-width: 83px; + min-width: 56px; + max-width: 56px; height: calc(100vh - 83px); border-right: 1px $grey-medium solid; @@ -68,6 +78,10 @@ transform: rotate(180deg); cursor: pointer; } + + @media (max-width: $screen-s) { + display: none; + } } .right-side { @@ -76,8 +90,26 @@ overflow-y: auto; @media (max-width: ($screen-m - 1px)) { - min-width: calc(100vw - 83px); + min-width: calc(100vw - 56px); + } + + @media(max-width: $screen-s){ + flex: 1; + min-width: unset; + } + + .back-arrow-mobile{ + display: none; + @media (max-width: $screen-s) { + display: block; + } + } + + .back-arrow-desktop{ + @media (max-width: $screen-s) { + display: none; + } } } } -} \ No newline at end of file +} diff --git a/src/front/Components/LayoutTemplates/DefaultNotaryDashboard/index.tsx b/src/front/Components/LayoutTemplates/DefaultNotaryDashboard/index.tsx index 9e0ab383..556003c7 100644 --- a/src/front/Components/LayoutTemplates/DefaultNotaryDashboard/index.tsx +++ b/src/front/Components/LayoutTemplates/DefaultNotaryDashboard/index.tsx @@ -1,8 +1,11 @@ import "reflect-metadata"; + import ChevronIcon from "@Assets/Icons/chevron.svg"; +import Button, { EButtonVariant } from "@Front/Components/DesignSystem/Button"; import FolderListContainer from "@Front/Components/DesignSystem/FolderListContainer"; import Header from "@Front/Components/DesignSystem/Header"; import Version from "@Front/Components/DesignSystem/Version"; +import BackArrow from "@Front/Components/Elements/BackArrow"; import { folders } from "@Front/Components/Layouts/DesignSystem/dummyData"; import WindowStore from "@Front/Stores/WindowStore"; import classNames from "classnames"; @@ -12,10 +15,14 @@ import React, { ReactNode } from "react"; import classes from "./classes.module.scss"; + type IProps = { title: string; children?: ReactNode; onSelectedFolder: (folder: IDashBoardFolder) => void; + hasBackArrow: boolean; + backArrowUrl?: string; + mobileBackText?: string; }; type IState = { folders: IDashBoardFolder[]; @@ -35,8 +42,8 @@ export type IDashBoardFolder = { }; export default class DefaultNotaryDashboard extends React.Component { private onWindowResize = () => {}; - public static defaultProps = { - scrollTop: 0, + public static defaultProps: Partial = { + hasBackArrow: false, }; public constructor(props: IProps) { @@ -66,7 +73,27 @@ export default class DefaultNotaryDashboard extends React.Component open side menu -
{this.props.children}
+ +
+ {this.props.hasBackArrow && ( + <> +
+ +
+
+ +
+ + )} + {this.props.children} +
diff --git a/src/front/Components/Layouts/Folder/ViewDocuments/classes.module.scss b/src/front/Components/Layouts/Folder/ViewDocuments/classes.module.scss new file mode 100644 index 00000000..2e179117 --- /dev/null +++ b/src/front/Components/Layouts/Folder/ViewDocuments/classes.module.scss @@ -0,0 +1,28 @@ +@import "@Themes/constants.scss"; + +.root { + .title { + margin-top: 24px; + } + + .subtitle { + margin-top: 32px; + } + + .file-container { + min-height: 700px; + margin-top: 32px; + @media (max-width: $screen-s) { + } + } + + .buttons-container { + display: flex; + gap: 24px; + justify-content: center; + margin-top: 32px; + @media (max-width: $screen-s) { + flex-direction: column-reverse; + } + } +} diff --git a/src/front/Components/Layouts/Folder/ViewDocuments/index.tsx b/src/front/Components/Layouts/Folder/ViewDocuments/index.tsx new file mode 100644 index 00000000..798a7f72 --- /dev/null +++ b/src/front/Components/Layouts/Folder/ViewDocuments/index.tsx @@ -0,0 +1,81 @@ +import Button, { EButtonVariant } from "@Front/Components/DesignSystem/Button"; +import FilePreview from "@Front/Components/DesignSystem/FilePreview"; +import Confirm from "@Front/Components/DesignSystem/Modal/Confirm"; +import Typography, { ITypo, ITypoColor } from "@Front/Components/DesignSystem/Typography"; +import DefaultNotaryDashboard from "@Front/Components/LayoutTemplates/DefaultNotaryDashboard"; +import React from "react"; + +import BasePage from "../../Base"; +import classes from "./classes.module.scss"; + +type IProps = {}; +type IState = { + isRefuseModalVisible: boolean; + isValidateModalVisible: boolean; +}; + +export default class ViewDocuments extends BasePage { + public constructor(props: IProps) { + super(props); + + this.state = { + isValidateModalVisible: false, + isRefuseModalVisible: false, + }; + + this.closeModals = this.closeModals.bind(this); + this.openValidateModal = this.openValidateModal.bind(this); + this.openRefuseModal = this.openRefuseModal.bind(this); + } + + public override render(): JSX.Element { + return ( + {}} hasBackArrow mobileBackText="Retour aux documents"> +
+ + App 23 rue Torus Toulon + + + Diagnostic électricité + +
+ +
+
+ + + +
+ +
+
+
+
+ ); + } + + private openValidateModal() { + this.setState({ + isValidateModalVisible: true, + }); + } + + private openRefuseModal() { + this.setState({ + isRefuseModalVisible: true, + }); + } + + private closeModals() { + this.setState({ + isValidateModalVisible: false, + isRefuseModalVisible: false, + }); + } +} diff --git a/src/pages/folder/[folderUid]/document/[documentUid]/index.tsx b/src/pages/folder/[folderUid]/document/[documentUid]/index.tsx new file mode 100644 index 00000000..634e89a1 --- /dev/null +++ b/src/pages/folder/[folderUid]/document/[documentUid]/index.tsx @@ -0,0 +1,5 @@ +import ViewDocuments from "@Front/Components/Layouts/Folder/ViewDocuments"; + +export default function Route() { + return ; +}