@blocklet/discuss-kit 1.6.174 → 1.6.176

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.
@@ -9,7 +9,6 @@ const Session = require("@arcblock/did-connect/lib/Session");
9
9
  const Button = require("@arcblock/ux/lib/Button");
10
10
  const Box = require("@mui/material/Box");
11
11
  const CircularProgress = require("@mui/material/CircularProgress");
12
- const ButtonGroup = require("@mui/material/ButtonGroup");
13
12
  const context = require("@arcblock/ux/lib/Locale/context");
14
13
  const reactErrorBoundary = require("react-error-boundary");
15
14
  const discussKitUx = require("@blocklet/discuss-kit-ux");
@@ -200,34 +199,21 @@ const DiscussKitComments = react.forwardRef(
200
199
  ) })
201
200
  ] }),
202
201
  !!total && showTopbar && /* @__PURE__ */ jsxRuntime.jsxs(Box, { display: "flex", justifyContent: "space-between", mt: 3, children: [
203
- /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
202
+ /* @__PURE__ */ jsxRuntime.jsxs(Box, { sx: { fontWeight: "medium" }, children: [
204
203
  total > 0 ? `${total} ${t("comments")}` : t("comment"),
205
204
  " "
206
205
  ] }),
207
- /* @__PURE__ */ jsxRuntime.jsxs(ButtonGroup, { children: [
208
- /* @__PURE__ */ jsxRuntime.jsx(
209
- Button,
210
- {
211
- variant: "contained",
212
- color: order !== "desc" ? "primary" : "inherit",
213
- size: "small",
214
- onClick: () => sort("asc"),
215
- className: order !== "desc" ? "" : "unselected-button",
216
- children: t("oldest")
217
- }
218
- ),
219
- /* @__PURE__ */ jsxRuntime.jsx(
220
- Button,
221
- {
222
- variant: "contained",
223
- color: order === "desc" ? "primary" : "inherit",
224
- size: "small",
225
- onClick: () => sort("desc"),
226
- className: order === "desc" ? "" : "unselected-button",
227
- children: t("newest")
228
- }
229
- )
230
- ] })
206
+ /* @__PURE__ */ jsxRuntime.jsx(
207
+ discussKitUx.SegmentedControl,
208
+ {
209
+ value: order,
210
+ options: [
211
+ { value: "desc", label: t("newest") },
212
+ { value: "asc", label: t("oldest") }
213
+ ],
214
+ onChange: (value) => sort(value)
215
+ }
216
+ )
231
217
  ] }),
232
218
  /* @__PURE__ */ jsxRuntime.jsx(discussKitUx.CommentList, { className: "comment-list" }),
233
219
  session.user && interactive && commentInputPosition === "bottom" && /* @__PURE__ */ jsxRuntime.jsx(Box, { mt: 6, children: /* @__PURE__ */ jsxRuntime.jsx(
@@ -8,10 +8,9 @@ import { SessionContext } from "@arcblock/did-connect/lib/Session";
8
8
  import Button from "@arcblock/ux/lib/Button";
9
9
  import Box from "@mui/material/Box";
10
10
  import CircularProgress from "@mui/material/CircularProgress";
11
- import ButtonGroup from "@mui/material/ButtonGroup";
12
11
  import { useLocaleContext, LocaleProvider } from "@arcblock/ux/lib/Locale/context";
13
12
  import { ErrorBoundary } from "react-error-boundary";
14
- import { useDefaultApiErrorHandler, useCommentsContext, useSubscription, GithubReaction, CommentInput, CommentList, getWsClient, UploaderProvider, InternalThemeProvider, ConfirmProvider, DefaultEditorConfigProvider, CommentsProvider } from "@blocklet/discuss-kit-ux";
13
+ import { useDefaultApiErrorHandler, useCommentsContext, useSubscription, GithubReaction, CommentInput, SegmentedControl, CommentList, getWsClient, UploaderProvider, InternalThemeProvider, ConfirmProvider, DefaultEditorConfigProvider, CommentsProvider } from "@blocklet/discuss-kit-ux";
15
14
  import { useRequest } from "ahooks";
16
15
  import ErrorFallback from "./components/error-fallback";
17
16
  import { translations } from "./locales";
@@ -199,34 +198,21 @@ const DiscussKitComments = forwardRef(
199
198
  ) })
200
199
  ] }),
201
200
  !!total && showTopbar && /* @__PURE__ */ jsxs(Box, { display: "flex", justifyContent: "space-between", mt: 3, children: [
202
- /* @__PURE__ */ jsxs("span", { children: [
201
+ /* @__PURE__ */ jsxs(Box, { sx: { fontWeight: "medium" }, children: [
203
202
  total > 0 ? `${total} ${t("comments")}` : t("comment"),
204
203
  " "
205
204
  ] }),
206
- /* @__PURE__ */ jsxs(ButtonGroup, { children: [
207
- /* @__PURE__ */ jsx(
208
- Button,
209
- {
210
- variant: "contained",
211
- color: order !== "desc" ? "primary" : "inherit",
212
- size: "small",
213
- onClick: () => sort("asc"),
214
- className: order !== "desc" ? "" : "unselected-button",
215
- children: t("oldest")
216
- }
217
- ),
218
- /* @__PURE__ */ jsx(
219
- Button,
220
- {
221
- variant: "contained",
222
- color: order === "desc" ? "primary" : "inherit",
223
- size: "small",
224
- onClick: () => sort("desc"),
225
- className: order === "desc" ? "" : "unselected-button",
226
- children: t("newest")
227
- }
228
- )
229
- ] })
205
+ /* @__PURE__ */ jsx(
206
+ SegmentedControl,
207
+ {
208
+ value: order,
209
+ options: [
210
+ { value: "desc", label: t("newest") },
211
+ { value: "asc", label: t("oldest") }
212
+ ],
213
+ onChange: (value) => sort(value)
214
+ }
215
+ )
230
216
  ] }),
231
217
  /* @__PURE__ */ jsx(CommentList, { className: "comment-list" }),
232
218
  session.user && interactive && commentInputPosition === "bottom" && /* @__PURE__ */ jsx(Box, { mt: 6, children: /* @__PURE__ */ jsx(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/discuss-kit",
3
- "version": "1.6.174",
3
+ "version": "1.6.176",
4
4
  "description": "A react component for Discuss Kit blocklet.",
5
5
  "main": "./lib/cjs/index.js",
6
6
  "module": "./lib/es/index.js",
@@ -37,8 +37,8 @@
37
37
  "@arcblock/did-connect": "^2.9.52",
38
38
  "@arcblock/ux": "^2.9.52",
39
39
  "@arcblock/ws": "^1.18.113",
40
- "@blocklet/discuss-kit-ux": "1.6.174",
41
- "@blocklet/editor": "1.6.174",
40
+ "@blocklet/discuss-kit-ux": "1.6.176",
41
+ "@blocklet/editor": "1.6.176",
42
42
  "@blocklet/ui-react": "^2.9.52",
43
43
  "@emotion/react": "^11.10.5",
44
44
  "@emotion/styled": "^11.10.5",
@@ -77,5 +77,5 @@
77
77
  "vite-plugin-build": "^0.10.0",
78
78
  "vite-plugin-svgr": "^4.2.0"
79
79
  },
80
- "gitHead": "9b83dcf0a862c283cc7c926fb8bbe4f49caeff2e"
80
+ "gitHead": "83c2397ed6c3f8ed577de50cd0868642c9212f4b"
81
81
  }