gomtm 0.0.194 → 0.0.195
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import { AnyMessage, PlainMessage } from "@bufbuild/protobuf";
|
|
2
2
|
import { CommontListRes } from "../gomtmpb/mtm/sppb/mtm_pb";
|
|
3
|
-
export declare const curdDashPathPrefixAtom: import("jotai").PrimitiveAtom<string> & {
|
|
4
|
-
init: string;
|
|
5
|
-
};
|
|
6
3
|
export declare const curdActivateIdAtom: import("jotai").PrimitiveAtom<string> & {
|
|
7
4
|
init: string;
|
|
8
5
|
};
|
|
@@ -20,11 +20,10 @@ var __async = (__this, __arguments, generator) => {
|
|
|
20
20
|
});
|
|
21
21
|
};
|
|
22
22
|
import { atom } from "jotai";
|
|
23
|
-
import { CommontListRes } from "../gomtmpb/mtm/sppb/mtm_pb";
|
|
24
|
-
import { gomtmBaseUrlAtom } from "../providers/GomtmProvider";
|
|
25
23
|
import { usePathname } from "next/navigation";
|
|
26
24
|
import { useMemo } from "react";
|
|
27
|
-
|
|
25
|
+
import { CommontListRes } from "../gomtmpb/mtm/sppb/mtm_pb";
|
|
26
|
+
import { gomtmBaseUrlAtom } from "../providers/GomtmProvider";
|
|
28
27
|
const curdActivateIdAtom = atom("");
|
|
29
28
|
const curd3ListParamsAtom = atom({});
|
|
30
29
|
const curdPathAtom = atom("");
|
|
@@ -52,7 +51,6 @@ export {
|
|
|
52
51
|
curd3ItemsV2Atom,
|
|
53
52
|
curd3ListParamsAtom,
|
|
54
53
|
curdActivateIdAtom,
|
|
55
|
-
curdDashPathPrefixAtom,
|
|
56
54
|
curdPathAtom,
|
|
57
55
|
useCurdSlugName
|
|
58
56
|
};
|
|
@@ -4,16 +4,15 @@ import { useAtom } from "jotai";
|
|
|
4
4
|
import { MtLink } from "mtxuilib/common/mtlink";
|
|
5
5
|
import { cn } from "mtxuilib/lib/utils";
|
|
6
6
|
import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "mtxuilib/ui/card";
|
|
7
|
-
import { curdActivateIdAtom
|
|
7
|
+
import { curdActivateIdAtom } from "../curd.atoms";
|
|
8
8
|
import { Icons } from "mtxuilib/icons/icons";
|
|
9
9
|
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuTrigger } from "mtxuilib/ui/dropdown-menu";
|
|
10
|
-
import { MtButton } from "mtxuilib/ui/ui-mt/Button";
|
|
11
10
|
import { DropdownMenuItemLink } from "mtxuilib/ui/ui-mt/DropdownMenuItemLink";
|
|
12
11
|
import { curdSlugPathAtom } from "../CommonListViewV2";
|
|
13
12
|
const PostCardListItem = (props) => {
|
|
14
13
|
const { item } = props;
|
|
15
14
|
const [curdActivateId, setcurdActivateId] = useAtom(curdActivateIdAtom);
|
|
16
|
-
const [
|
|
15
|
+
const [curdSlugPath] = useAtom(curdSlugPathAtom);
|
|
17
16
|
return /* @__PURE__ */ jsxs(
|
|
18
17
|
Card,
|
|
19
18
|
{
|
|
@@ -26,18 +25,18 @@ const PostCardListItem = (props) => {
|
|
|
26
25
|
},
|
|
27
26
|
children: [
|
|
28
27
|
/* @__PURE__ */ jsxs(CardHeader, { children: [
|
|
29
|
-
/* @__PURE__ */ jsx(CardTitle, { children: /* @__PURE__ */ jsx(MtLink, { href: `${
|
|
28
|
+
/* @__PURE__ */ jsx(CardTitle, { children: /* @__PURE__ */ jsx(MtLink, { href: `${curdSlugPath}/${item.id}`, className: "pb-4 text-3xl font-bold hover:text-gray-700", children: item == null ? void 0 : item.title }) }),
|
|
30
29
|
/* @__PURE__ */ jsx(CardDescription, { children: "Deploy your new project in one-click." })
|
|
31
30
|
] }),
|
|
32
31
|
/* @__PURE__ */ jsx(CardContent, { children: /* @__PURE__ */ jsxs("article", { className: "my-4 flex flex-col", children: [
|
|
33
32
|
/* @__PURE__ */ jsx(MtLink, {
|
|
34
|
-
href:
|
|
33
|
+
href: `${curdSlugPath}/${item.id}`,
|
|
35
34
|
className: "hover:opacity-75",
|
|
36
35
|
// eslint-disable-next-line @next/next/no-img-element, jsx-a11y/alt-text
|
|
37
36
|
children: item.topImage && /* @__PURE__ */ jsx("img", { src: item.topImage, alt: item.title })
|
|
38
37
|
}),
|
|
39
38
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-col justify-start bg-white p-6", children: [
|
|
40
|
-
/* @__PURE__ */ jsx(MtLink, { href:
|
|
39
|
+
/* @__PURE__ */ jsx(MtLink, { href: `${curdSlugPath}/${item.id}`, className: "pb-4 text-sm font-bold uppercase text-blue-700", children: item.category || "news" }),
|
|
41
40
|
/* @__PURE__ */ jsxs("p", { className: "pb-3 text-sm", children: [
|
|
42
41
|
"By ",
|
|
43
42
|
/* @__PURE__ */ jsx(MtLink, { href: "#", children: item.author }),
|
|
@@ -47,32 +46,32 @@ const PostCardListItem = (props) => {
|
|
|
47
46
|
] })
|
|
48
47
|
] }) }),
|
|
49
48
|
/* @__PURE__ */ jsxs(CardFooter, { className: "flex justify-end", children: [
|
|
50
|
-
/* @__PURE__ */ jsx(MtLink, { variant: "ghost", href:
|
|
51
|
-
/* @__PURE__ */ jsx(PostCardItemActions, {
|
|
49
|
+
/* @__PURE__ */ jsx(MtLink, { variant: "ghost", href: `${curdSlugPath}/${item.id}`, children: "Show" }),
|
|
50
|
+
/* @__PURE__ */ jsx(PostCardItemActions, { id: item.id })
|
|
52
51
|
] })
|
|
53
52
|
]
|
|
54
53
|
}
|
|
55
54
|
);
|
|
56
55
|
};
|
|
57
56
|
const PostCardItemActions = (props) => {
|
|
58
|
-
const {
|
|
57
|
+
const { id } = props;
|
|
59
58
|
const [curdSlugPath] = useAtom(curdSlugPathAtom);
|
|
60
59
|
return /* @__PURE__ */ jsxs(DropdownMenu, { children: [
|
|
61
60
|
/* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
62
|
-
|
|
61
|
+
MtLink,
|
|
63
62
|
{
|
|
63
|
+
href: `${curdSlugPath}/${id}`,
|
|
64
64
|
variant: "ghost",
|
|
65
65
|
className: "data-[state=open]:bg-muted flex size-8 p-0",
|
|
66
66
|
children: [
|
|
67
67
|
/* @__PURE__ */ jsx(Icons.chevronRight, { className: "size-4" }),
|
|
68
|
-
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "
|
|
68
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "more" })
|
|
69
69
|
]
|
|
70
70
|
}
|
|
71
71
|
) }),
|
|
72
72
|
/* @__PURE__ */ jsxs(DropdownMenuContent, { align: "end", className: "w-[160px]", children: [
|
|
73
|
-
/* @__PURE__ */ jsx(DropdownMenuItemLink, { href:
|
|
74
|
-
/* @__PURE__ */ jsx(DropdownMenuItemLink, { href:
|
|
75
|
-
/* @__PURE__ */ jsx(DropdownMenuItemLink, { href: `${curdSlugPath}/edit`, children: "edit" }),
|
|
73
|
+
/* @__PURE__ */ jsx(DropdownMenuItemLink, { href: `${curdSlugPath}/create/${id}`, children: "create" }),
|
|
74
|
+
/* @__PURE__ */ jsx(DropdownMenuItemLink, { href: `${curdSlugPath}/edit/${id}`, children: "edit" }),
|
|
76
75
|
/* @__PURE__ */ jsx(DropdownMenuItemLink, { href: `${curdSlugPath}/listdebug`, children: "list debug" }),
|
|
77
76
|
/* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
|
|
78
77
|
/* @__PURE__ */ jsxs(DropdownMenuItem, { children: [
|