Merge branch 'dev' into staging
This commit is contained in:
commit
727d03505e
@ -1,17 +1,16 @@
|
|||||||
import Button, { EButtonSize, EButtonstyletype, EButtonVariant } from "@Front/Components/DesignSystem/Button";
|
import Button, { EButtonSize, EButtonstyletype, EButtonVariant } from "@Front/Components/DesignSystem/Button";
|
||||||
import IconButton, { EIconButtonVariant } from "@Front/Components/DesignSystem/IconButton";
|
|
||||||
import Typography, { ETypo, ETypoColor } from "@Front/Components/DesignSystem/Typography";
|
import Typography, { ETypo, ETypoColor } from "@Front/Components/DesignSystem/Typography";
|
||||||
import useOpenable from "@Front/Hooks/useOpenable";
|
import useOpenable from "@Front/Hooks/useOpenable";
|
||||||
import { PencilSquareIcon, TrashIcon } from "@heroicons/react/24/outline";
|
import { PencilSquareIcon, TrashIcon, UsersIcon } from "@heroicons/react/24/outline";
|
||||||
|
|
||||||
import { ICustomer } from "..";
|
import { ICustomer } from "..";
|
||||||
import { AnchorStatus } from "../..";
|
import { AnchorStatus } from "../..";
|
||||||
import classes from "./classes.module.scss";
|
import classes from "./classes.module.scss";
|
||||||
import DeleteCustomerModal from "./DeleteCustomerModal";
|
import DeleteCustomerModal from "./DeleteCustomerModal";
|
||||||
import Link from "next/link";
|
|
||||||
import Module from "@Front/Config/Module";
|
import Module from "@Front/Config/Module";
|
||||||
import { useCallback } from "react";
|
import { useCallback } from "react";
|
||||||
import { Note } from "le-coffre-resources/dist/Customer";
|
import { Note } from "le-coffre-resources/dist/Customer";
|
||||||
|
import ButtonWithSubMenu from "@Front/Components/Elements/ButtonWithSubMenu";
|
||||||
|
|
||||||
type IProps = {
|
type IProps = {
|
||||||
customer: ICustomer;
|
customer: ICustomer;
|
||||||
@ -33,6 +32,16 @@ export default function ClientBox(props: IProps) {
|
|||||||
[props],
|
[props],
|
||||||
);
|
);
|
||||||
|
|
||||||
|
let createOrUpdateNotePath = Module.getInstance()
|
||||||
|
.get()
|
||||||
|
.modules.pages.Notes.pages.EditNote.props.path.replace("[noteUid]", customerNote?.uid ?? "");
|
||||||
|
if (!customerNote) {
|
||||||
|
createOrUpdateNotePath = Module.getInstance()
|
||||||
|
.get()
|
||||||
|
.modules.pages.Notes.pages.CreateNote.props.path.replace("[folderUid]", folderUid ?? "");
|
||||||
|
createOrUpdateNotePath = createOrUpdateNotePath.replace("[customerUid]", customer.uid ?? "");
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={classes["root"]}>
|
<div className={classes["root"]}>
|
||||||
<div className={classes["header"]}>
|
<div className={classes["header"]}>
|
||||||
@ -40,13 +49,30 @@ export default function ClientBox(props: IProps) {
|
|||||||
{customer.contact?.first_name} {customer.contact?.last_name}
|
{customer.contact?.first_name} {customer.contact?.last_name}
|
||||||
</Typography>
|
</Typography>
|
||||||
{anchorStatus === AnchorStatus.NOT_ANCHORED && (
|
{anchorStatus === AnchorStatus.NOT_ANCHORED && (
|
||||||
<Link
|
<ButtonWithSubMenu
|
||||||
href={Module.getInstance()
|
icon={<PencilSquareIcon />}
|
||||||
.get()
|
openingSide="right"
|
||||||
.modules.pages.Folder.pages.EditClient.props.path.replace("[folderUid]", folderUid ?? "")
|
subElements={[
|
||||||
.replace("[customerUid]", customer.uid ?? "")}>
|
{
|
||||||
<IconButton variant={EIconButtonVariant.NEUTRAL} icon={<PencilSquareIcon />} />
|
icon: <UsersIcon />,
|
||||||
</Link>
|
text: "Modifier les informations",
|
||||||
|
link: Module.getInstance()
|
||||||
|
.get()
|
||||||
|
.modules.pages.Folder.pages.EditClient.props.path.replace("[folderUid]", folderUid ?? "")
|
||||||
|
.replace("[customerUid]", customer.uid ?? ""),
|
||||||
|
hasSeparator: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
icon: <PencilSquareIcon />,
|
||||||
|
text: "Modifier la note",
|
||||||
|
link: createOrUpdateNotePath,
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
// <Link
|
||||||
|
// href={}>
|
||||||
|
// <IconButton variant={EIconButtonVariant.NEUTRAL} />
|
||||||
|
// </Link>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user