Skip to content

Commit

Permalink
fix: comment polkassembly relative link #5306 (#5335)
Browse files Browse the repository at this point in the history
* move `ensurePolkassemblyRelativeLink` to `utils/polkassembly`

* fix: comment polkassembly relative link #5306

* fix import

* extract

* revert [skip ci]
  • Loading branch information
2nthony authored Jan 7, 2025
1 parent 74898f9 commit 2bf5cf4
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,19 @@ import { useState } from "react";
import { useIsUniversalPostComments } from "next-common/hooks/usePostComments";
import { CommentProvider, useComment } from "./context";
import PolkassemblyCommentUser from "./polkassemblyUser";
import { useChain } from "next-common/context/chain";
import { ensurePolkassemblyRelativeLink } from "next-common/utils/polkassembly/ensurePolkassemblyRelativeLink";

function PolkassemblyCommentItemImpl({ isSecondLevel }) {
const chain = useChain();
const comment = useComment();
const type = useDetailType();
const post = usePost();
const [showReplies, setShowReplies] = useState(false);
const isUniversalComments = useIsUniversalPostComments();

comment.content = ensurePolkassemblyRelativeLink(comment.content, chain);

return (
<CommentItemTemplate
isSecondLevel={isSecondLevel}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import SecondaryButton from "next-common/lib/button/secondary";
import { sanitizeHtml } from "next-common/utils/post/sanitizeHtml";
import { Marked } from "marked";
import { useChain } from "next-common/context/chain";
import { ensurePolkassemblyRelativeLink } from "next-common/utils/post/ensurePolkassemblyRelativeLink";
import { ensurePolkassemblyRelativeLink } from "next-common/utils/polkassembly/ensurePolkassemblyRelativeLink";

const marked = new Marked();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { detailPageCategory } from "./consts/business/category";
import { detailPageCategory } from "../consts/business/category";
import { flatten } from "lodash-es";
import { encodeAddressToChain } from "next-common/services/address";
import { addressEllipsis } from "next-common/utils";
import { getMotionId } from "next-common/utils/motion";
import { getTitle } from "next-common/utils/post";
import { getPostLastActivityAt } from "next-common/utils/viewfuncs/postUpdatedTime";
import Chains from "./consts/chains";
import Chains from "../consts/chains";

export const PolkassemblyChains = [
Chains.kusama,
Expand Down

0 comments on commit 2bf5cf4

Please sign in to comment.