@timpel/forumkit-sdk-react-native 0.2.7 → 0.2.10

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.
package/dist/index.js CHANGED
@@ -2592,8 +2592,10 @@ function ComposerOverlay({ onClose, onOpenDrafts, onPosted, initialDraft }) {
2592
2592
  if (!token || !canPost) return;
2593
2593
  setSubmitting(true);
2594
2594
  setError(null);
2595
- const rawBody = tab === "link" ? body.trim() ? `${body.trim()}
2596
- ${linkUrl.trim()}` : linkUrl.trim() : body;
2595
+ const hasLink = linkTrimmed.length > 0 && isValidUrl(linkTrimmed);
2596
+ const linkMarkdown = hasLink ? `[${linkTrimmed}](${linkTrimmed})` : "";
2597
+ const rawBody = hasLink ? body.trim() ? `${body.trim()}
2598
+ ${linkMarkdown}` : linkMarkdown : body;
2597
2599
  const postBody = rawBody.trim().length > 0 ? rawBody : " ";
2598
2600
  try {
2599
2601
  const thread = await createThread(apiUrl, forumId, {
@@ -5957,8 +5959,7 @@ function ProfileBody() {
5957
5959
  activityLoading ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_react_native46.View, { style: { alignItems: "center", paddingVertical: 30 }, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Mascot, { size: 36 }) }) : activity.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_react_native46.View, { style: styles38.empty, children: [
5958
5960
  /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Mascot, { size: 88, animated: false, badge: false }),
5959
5961
  /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_react_native46.Text, { style: [styles38.emptyTitle, { color: tokens.text }], children: copy.title }),
5960
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_react_native46.Text, { style: [styles38.emptyDesc, { color: tokens.muted }], children: copy.description }),
5961
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_react_native46.Pressable, { onPress: () => setEditOpen(true), style: [styles38.settingsBtn, { backgroundColor: tokens.text }], children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_react_native46.Text, { style: { color: tokens.bg, fontSize: 13.5, fontWeight: "700" }, children: "Update Settings" }) })
5962
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_react_native46.Text, { style: [styles38.emptyDesc, { color: tokens.muted }], children: copy.description })
5962
5963
  ] }) : /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_react_native46.View, { style: { paddingHorizontal: 16 }, children: activity.map((a, i) => a.kind === "thread" ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
5963
5964
  PostRow,
5964
5965
  {
@@ -6036,8 +6037,7 @@ var styles38 = import_react_native46.StyleSheet.create({
6036
6037
  divider: { height: 1, marginTop: 10 },
6037
6038
  empty: { alignItems: "center", paddingTop: 40, paddingHorizontal: 24 },
6038
6039
  emptyTitle: { fontSize: 17, fontWeight: "800", marginTop: 16, textAlign: "center" },
6039
- emptyDesc: { fontSize: 13.5, textAlign: "center", marginTop: 8, maxWidth: 280, lineHeight: 20 },
6040
- settingsBtn: { borderRadius: 999, paddingVertical: 10, paddingHorizontal: 20, marginTop: 18 }
6040
+ emptyDesc: { fontSize: 13.5, textAlign: "center", marginTop: 8, maxWidth: 280, lineHeight: 20 }
6041
6041
  });
6042
6042
 
6043
6043
  // src/screens/SearchScreen.tsx