Merge branch 'dev' of github.com:smart-chain-fr/leCoffre-front into dev
This commit is contained in:
commit
95e57d1e59
@ -1,17 +1,16 @@
|
||||
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 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 { AnchorStatus } from "../..";
|
||||
import classes from "./classes.module.scss";
|
||||
import DeleteCustomerModal from "./DeleteCustomerModal";
|
||||
import Link from "next/link";
|
||||
import Module from "@Front/Config/Module";
|
||||
import { useCallback } from "react";
|
||||
import { Note } from "le-coffre-resources/dist/Customer";
|
||||
import ButtonWithSubMenu from "@Front/Components/Elements/ButtonWithSubMenu";
|
||||
|
||||
type IProps = {
|
||||
customer: ICustomer;
|
||||
@ -33,6 +32,16 @@ export default function ClientBox(props: IProps) {
|
||||
[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 (
|
||||
<div className={classes["root"]}>
|
||||
<div className={classes["header"]}>
|
||||
@ -40,13 +49,30 @@ export default function ClientBox(props: IProps) {
|
||||
{customer.contact?.first_name} {customer.contact?.last_name}
|
||||
</Typography>
|
||||
{anchorStatus === AnchorStatus.NOT_ANCHORED && (
|
||||
<Link
|
||||
href={Module.getInstance()
|
||||
<ButtonWithSubMenu
|
||||
icon={<PencilSquareIcon />}
|
||||
openingSide="right"
|
||||
subElements={[
|
||||
{
|
||||
icon: <UsersIcon />,
|
||||
text: "Modifier les informations",
|
||||
link: Module.getInstance()
|
||||
.get()
|
||||
.modules.pages.Folder.pages.EditClient.props.path.replace("[folderUid]", folderUid ?? "")
|
||||
.replace("[customerUid]", customer.uid ?? "")}>
|
||||
<IconButton variant={EIconButtonVariant.NEUTRAL} icon={<PencilSquareIcon />} />
|
||||
</Link>
|
||||
.replace("[customerUid]", customer.uid ?? ""),
|
||||
hasSeparator: true,
|
||||
},
|
||||
{
|
||||
icon: <PencilSquareIcon />,
|
||||
text: "Modifier la note",
|
||||
link: createOrUpdateNotePath,
|
||||
},
|
||||
]}
|
||||
/>
|
||||
// <Link
|
||||
// href={}>
|
||||
// <IconButton variant={EIconButtonVariant.NEUTRAL} />
|
||||
// </Link>
|
||||
)}
|
||||
</div>
|
||||
<div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user