This commit is contained in:
Hugo Lextrait 2023-04-17 16:50:26 +02:00
commit 7d5f367435
18 changed files with 234 additions and 81 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 191 KiB

View File

@ -15,11 +15,11 @@ type IProps = {
variant?: EButtonVariant;
fullwidth?: "true" | "false";
icon?: string;
iconStyle?: CSSProperties;
iconstyle?: CSSProperties;
disabled?: boolean;
type?: "button" | "submit";
isloading?: string;
iconPosition?: "left" | "right";
iconposition?: "left" | "right";
};
export default function Button(props: IProps) {
@ -29,11 +29,11 @@ export default function Button(props: IProps) {
type = "button",
isloading = "false",
fullwidth = "false",
iconPosition = "right",
iconposition = "right",
onClick,
children,
icon,
iconStyle,
iconstyle,
} = props;
const attributes = { ...props, variant, disabled, type, isloading, fullwidth };
@ -42,9 +42,9 @@ export default function Button(props: IProps) {
delete attributes.iconPosition;
return (
<button {...attributes} onClick={onClick} className={classes["root"]} type={type}>
{icon && iconPosition === "left" && <Image src={icon} style={iconStyle} alt={"button icon"} />}
{icon && iconposition === "left" && <Image src={icon} style={iconstyle} alt={"button icon"} />}
{children}
{icon && iconPosition === "right" && <Image src={icon} style={iconStyle} alt={"button icon"} />}
{icon && iconposition === "right" && <Image src={icon} style={iconstyle} alt={"button icon"} />}
</button>
);
}

View File

@ -1,7 +1,7 @@
@import "@Themes/constants.scss";
.root {
background-color: $grey-soft;
background-color: var(--grey-soft);
padding: 24px;
width: 100%;
display: flex;

View File

@ -26,31 +26,27 @@
border: 1px solid $grey-medium;
&:focus {
~.fake-placeholder {
~ .fake-placeholder {
transform: translateY(-35px);
transition: transform 0.3s ease-in-out;
}
}
&:not([value=""]) {
~.fake-placeholder {
&:not([data-value=""]) {
~ .fake-placeholder {
transform: translateY(-35px);
transition: transform;
}
}
&[type="number"] {
&:focus {
~.fake-placeholder {
~ .fake-placeholder {
transform: translateY(-35px);
transition: transform 0.3s ease-in-out;
}
}
&:not([value=""]) {
~.fake-placeholder {
&:not([data-value=""]) {
~ .fake-placeholder {
transform: translateY(-35px);
transition: transform;
}
}
@ -75,14 +71,13 @@
}
}
&:not([value=""]) {
~.fake-placeholder {
&:not([data-value=""]) {
~ .fake-placeholder {
transform: translateY(-35px);
transition: transform 0.3s ease-in-out;
}
}
~.fake-placeholder {
~ .fake-placeholder {
z-index: 2;
top: 35%;
margin-left: 8px;
@ -90,6 +85,7 @@
pointer-events: none;
position: absolute;
background: $white;
transition: transform 0.3s ease-in-out;
}
}
}
@ -106,7 +102,7 @@
height: 70px;
border: 1px solid $grey-medium;
~.fake-placeholder {
~ .fake-placeholder {
z-index: 2;
top: -12px;
margin-left: 8px;
@ -114,6 +110,19 @@
pointer-events: none;
position: absolute;
background: $white;
// transform: translateY(-35px);
transform: translateY(35px);
transition: transform 0.3s ease-in-out;
}
&:focus {
~ .fake-placeholder {
transform: translateY(0px);
}
}
&:not([data-value=""]) {
~ .fake-placeholder {
transform: translateY(0px);
}
}
}

View File

@ -40,7 +40,7 @@ export default class InputField extends BaseField<IProps> {
required={this.props.required}
ref={this.props.fieldRef}
rows={4}
value={value}
data-value={value}
onChange={this.onChange}
data-has-validation-errors={this.state.errors.length > 0}
className={
@ -61,7 +61,7 @@ export default class InputField extends BaseField<IProps> {
pattern={pattern}
onChange={this.onChange}
onBlur={this.onBlur}
value={value}
data-value={value}
data-has-validation-errors={this.state.errors.length > 0}
className={
this.props.className ? [classes["input"], classes[this.props.className]].join(" ") : classes["input"]

View File

@ -14,7 +14,7 @@ type IProps = {
export default class RadioBox extends React.Component<IProps> {
public override render(): JSX.Element {
return (
<Typography typo={ITypo.P_ERR_16} color={ITypoColor.BLACK}>
<Typography typo={ITypo.P_ERR_18} color={ITypoColor.BLACK}>
<label className={classes["root"]}>
<input type="radio" name={this.props.name} defaultChecked={this.props.defaultChecked} onChange={this.props.onChange} />
{this.props.children}

View File

@ -125,4 +125,8 @@
&.black {
color: $black;
}
&.purple-flash {
color: var(--purple-flash);
}
}

View File

@ -6,6 +6,7 @@ type IProps = {
typo: ITypo;
children: React.ReactNode;
color?: ITypoColor;
className?: string;
};
type IState = {};
@ -33,12 +34,19 @@ export enum ITypoColor {
RE_HOVER = "re-hover",
GREY = "grey",
BLACK = "black",
PURPLE_FLASH = "purple-flash",
}
export default class Typography extends React.Component<IProps, IState> {
public override render(): JSX.Element {
return (
<div className={classNames(classes["root"], classes[this.props.typo], classes[this.props.color ?? ""])}>
<div
className={classNames(
classes["root"],
classes[this.props.typo],
classes[this.props.color ?? ""],
this.props.className ?? "",
)}>
{this.props.children}
</div>
);

View File

@ -5,7 +5,7 @@
align-items: center;
justify-content: space-between;
padding: 24px;
background-color: $grey-soft;
background-color: var(--grey-soft);
width: 100%;
.content {

View File

@ -0,0 +1,28 @@
import Link from "next/link";
import React from "react";
import Button, { EButtonVariant } from "@Front/Components/DesignSystem/Button";
import ChevronIcon from "@Assets/icons/chevron.svg";
type IProps = {
url: string;
};
type IState = {};
export default class BackArrow extends React.Component<IProps, IState> {
public constructor(props: IProps) {
super(props);
}
public override render(): JSX.Element {
return (
<Link href={this.props.url}>
<Button
icon={ChevronIcon}
iconposition={"left"}
iconstyle={{ transform: "rotate(180deg)", width: "22px", height: "22px" }}
variant={EButtonVariant.LINE}>
Retour
</Button>
</Link>
);
}
}

View File

@ -7,31 +7,39 @@
.content {
display: flex;
align-items: center;
height: calc(100vh - 83px);
width: 100%;
.side-left {
max-height: 100vh;
overflow: auto;
}
.sides {
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
width: 50%;
&.image-container {
display: flex;
align-items: center;
justify-content: center;
@media (max-width: $screen-m) {
display: none;
}
background: var(--grey-soft);
.image {
height: 100%;
object-fit: contain;
}
}
.side-content {
max-width: 530px;
}
&.background-image-container {
display: flex;
align-items: center;
justify-content: center;
.image {
height: 100%;
width: 100%;
object-fit: cover;
.background-image {
height: 100%;
width: 100%;
object-fit: cover;
}
}
}
}

View File

@ -13,12 +13,15 @@ type IProps = {
*/
scrollTop: number | null;
image: StaticImageData;
type: "background" | "image";
};
type IState = {};
export default class DefaultDoubleSidePage extends React.Component<IProps, IState> {
public static defaultProps = {
scrollTop: 0,
type: "background",
};
public override render(): JSX.Element {
@ -26,12 +29,17 @@ export default class DefaultDoubleSidePage extends React.Component<IProps, IStat
<div className={classes["root"]}>
<Header isUserConnected={false} />
<div className={classes["content"]}>
<div className={classes["sides"]}>
<div className={classes["side-content"]}>{this.props.children}</div>
</div>
<div className={classNames(classes["sides"], classes["image-container"])}>
<Image alt={"right side image"} src={this.props.image} className={classes["image"]} />
</div>
<div className={classNames(classes["sides"], classes["side-left"])}>{this.props.children}</div>
{this.props.type === "image" && (
<div className={classNames(classes["sides"], classes["image-container"])}>
<Image alt={"right side image"} src={this.props.image} className={classes["image"]} />
</div>
)}
{this.props.type === "background" && (
<div className={classNames(classes["sides"], classes["background-image-container"])}>
<Image alt={"right side image"} src={this.props.image} className={classes["background-image"]} />
</div>
)}
</div>
<Version />
</div>

View File

@ -9,9 +9,8 @@ import { ActionMeta, MultiValue } from "react-select";
import { IOption } from "@Front/Components/DesignSystem/Select";
import InputField from "@Front/Components/DesignSystem/Form/Elements/InputField";
import Form from "@Front/Components/DesignSystem/Form";
import ChevonIcon from "@Assets/icons/chevron.svg";
import Link from "next/link";
import { useRouter } from "next/router";
import BackArrow from "@Front/Components/Elements/BackArrow";
type IProps = {
selectedFolderUid: string;
@ -45,15 +44,7 @@ class AddClientToFolderClass extends BasePage<IProps, IState> {
return (
<DefaultNotaryDashboard title={"Ajouter client(s)"} onSelectedFolder={this.onSelectedFolder}>
<div className={classes["root"]}>
<Link href={"/dossier/".concat(this.props.selectedFolderUid)}>
<Button
icon={ChevonIcon}
iconPosition={"left"}
iconStyle={{ transform: "rotate(180deg)", width: "22px", height: "22px" }}
variant={EButtonVariant.LINE}>
Retour
</Button>
</Link>
<BackArrow url={"/dossier/".concat(this.props.selectedFolderUid)} />
<Typography typo={ITypo.H1Bis}>Associer un ou plusieurs client(s)</Typography>
<Form>
<div className={classes["radiobox-container"]}>

View File

@ -0,0 +1,29 @@
.root {
margin: 64px 0 0 64px;
width: 530px;
.title {
margin-top: 24px;
}
.subtitle {
margin-top: 32px;
}
.form-container {
margin-top: 16px;
display: flex;
flex-direction: column;
gap: 24px;
}
.access-container {
margin-top: 16px;
.radio-container {
margin-top: 16px;
display: flex;
flex-direction: column;
gap: 16px;
}
}
}

View File

@ -0,0 +1,63 @@
import BasePage from "../../Base";
import Typography, { ITypo, ITypoColor } from "@Front/Components/DesignSystem/Typography";
import classes from "./classes.module.scss";
import DefaultDoubleSidePage from "@Front/Components/LayoutTemplates/DefaultDoubleSidePage";
import RightImage from "@Front/Assets/images/create-folder/right-image.png";
import BackArrow from "@Front/Components/Elements/BackArrow";
import Form from "@Front/Components/DesignSystem/Form";
import InputField from "@Front/Components/DesignSystem/Form/Elements/InputField";
import Select from "@Front/Components/DesignSystem/Select";
import RadioBox from "@Front/Components/DesignSystem/RadioBox";
type IProps = {};
type IState = {};
export default class CreateFolder extends BasePage<IProps, IState> {
public constructor(props: IProps) {
super(props);
}
// TODO: Message if the user has not created any folder yet
public override render(): JSX.Element {
return (
<DefaultDoubleSidePage title={"Dossier"} image={RightImage} type="image">
<div className={classes["root"]}>
<BackArrow url="/" />
<Typography typo={ITypo.H1} color={ITypoColor.BLACK} className={classes["title"]}>
Créer un dossier
</Typography>
<Typography typo={ITypo.H3} color={ITypoColor.PURPLE_FLASH} className={classes["subtitle"]}>
Informations dossier
</Typography>
<Form>
<div className={classes["form-container"]}>
<InputField name="folder_number" fakeplaceholder="Numéro de dossier" type="number" />
<InputField name="entitled" fakeplaceholder="Intitulé" />
<Select
options={[
{ label: "Divorce", value: "divorce" },
{ label: "Succession", value: "succession" },
{ label: "Vente immobilière", value: "vente_immobiliere" },
]}
onChange={() => {}}
placeholder={"Type dacte"}
/>
<InputField name="personal_note" fakeplaceholder="Note personnelle" textarea />
</div>
<div className={classes["access-container"]}>
<Typography typo={ITypo.H3} color={ITypoColor.PURPLE_FLASH}>
Accès au dossier
</Typography>
<div className={classes["radio-container"]}>
<RadioBox name="file_access" defaultChecked>
Sélectionner tout l'office
</RadioBox>
<RadioBox name="file_access">Sélectionner certains collaborateurs</RadioBox>
</div>
</div>
</Form>
</div>
</DefaultDoubleSidePage>
);
}
public override async componentDidMount() {}
}

View File

@ -9,26 +9,26 @@
--colormerdum: blue;
--green-flash: $green-flash;
--blue-flash: $blue-flash;
--turquoise-flash: $turquoise-flash;
--purple-flash: $purple-flash;
--purple-hover: $purple-hover;
--orange-flash: $orange-flash;
--red-flash: $red-flash;
--re-hover: $re-hover;
--pink-flash: $pink-flash;
--pink-hover: $pink-hover;
--green-flash: #{$green-flash};
--blue-flash: #{$blue-flash};
--turquoise-flash: #{$turquoise-flash};
--purple-flash: #{$purple-flash};
--purple-hover: #{$purple-hover};
--orange-flash: #{$orange-flash};
--red-flash: #{$red-flash};
--re-hover: #{$re-hover};
--pink-flash: #{$pink-flash};
--pink-hover: #{$pink-hover};
--green-soft: $green-soft;
--blue-soft: $blue-soft;
--turquoise-soft: $turquoise-soft;
--purple-soft: $purple-soft;
--orange-soft: $orange-soft;
--red-soft: $red-soft;
--pink-soft: $pink-soft;
--green-soft: #{$green-soft};
--blue-soft: #{$blue-soft};
--turquoise-soft: #{$turquoise-soft};
--purple-soft: #{$purple-soft};
--orange-soft: #{$orange-soft};
--red-soft: #{$red-soft};
--pink-soft: #{$pink-soft};
--grey: $grey;
--grey-medium: $grey-medium;
--grey-soft: $grey-soft;
--grey: #{$grey};
--grey-medium: #{$grey-medium};
--grey-soft: #{$grey-soft};
}

View File

@ -0,0 +1,5 @@
import CreateFolder from "@Front/Components/Layouts/Folder/CreateFolder";
export default function Route() {
return <CreateFolder />;
}