Skip to content

Commit

Permalink
Update subsocial packages and use parse twitter from utils
Browse files Browse the repository at this point in the history
  • Loading branch information
teodorus-nathaniel committed Mar 6, 2023
1 parent 45bbc07 commit 4a941ad
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 12 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
"@polkadot/wasm-crypto": "^6.4.1",
"@polkadot/wasm-crypto-wasm": "6.4.1",
"@polkadot/wasm-util": "6.4.1",
"@subsocial/api": "^0.7.9",
"@subsocial/api": "0.8.2",
"@subsocial/utils": "0.8.2",
"@tailwindcss/forms": "^0.5.3",
"@talisman-connect/ui": "^1.1.1",
"@talisman-connect/wallets": "^1.1.3",
Expand Down
4 changes: 2 additions & 2 deletions src/components/render/TweetBody.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ import React, { useMemo } from "react";
import ReactMarkdown from "react-markdown";
import remarkGfm from "remark-gfm";

import { parseTextToMarkdown } from "src/utils/string";
import { parseTwitterTextToMarkdown } from "@subsocial/utils";

type TweetBodyProps = {
text: string;
};

const TweetBody = ({ text }: TweetBodyProps) => {
const parsedMD = useMemo(() => {
const result = parseTextToMarkdown(text);
const result = parseTwitterTextToMarkdown(text);
return result;
}, [text]);

Expand Down
6 changes: 1 addition & 5 deletions src/hooks/use-subsocial-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,11 +240,7 @@ export const useSubSocialApiHook = () => {

if (!myOwnSpaceIds && !editableSpaceIds) return null;

const convertedAllSpaceIds = [
getP4ESpace(),
...bnsToIds(myOwnSpaceIds),
...(editableSpaceIds || []),
];
const convertedAllSpaceIds = [getP4ESpace(), ...myOwnSpaceIds, ...(editableSpaceIds || [])];

const spaces = await subsocialApi.findPublicSpaces(convertedAllSpaceIds);
if (spaces) {
Expand Down
37 changes: 33 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2305,10 +2305,10 @@
dependencies:
"@sinonjs/commons" "^1.7.0"

"@subsocial/api@^0.7.9":
version "0.7.9"
resolved "https://registry.yarnpkg.com/@subsocial/api/-/api-0.7.9.tgz#96082337d67698ae95741c62392793333df9d6ce"
integrity sha512-/gABxlARl2yuvmncriWOkDeVr5/Idty4W1Lsm7lW1ag/+vwytS6q7jQ9pc1SxnLn2iseqXN2gkjLFF8HIeL0AQ==
"@subsocial/api@0.8.2":
version "0.8.2"
resolved "https://registry.yarnpkg.com/@subsocial/api/-/api-0.8.2.tgz#82661576accce0fdf3e590d378bcc511a165b233"
integrity sha512-7eoUVwj0K4SVh9R+z356MDL4gvpOd4SoKqBPhLE4twg4oWtSDml2Y66EGOoFn6pSLdjcR7gvsmgB5KAM7CXxmg==
dependencies:
"@polkadot/api" latest
"@polkadot/types" latest
Expand All @@ -2327,6 +2327,28 @@
"@polkadot/api" latest
lodash.camelcase "^4.3.0"

"@subsocial/[email protected]":
version "0.8.2"
resolved "https://registry.yarnpkg.com/@subsocial/utils/-/utils-0.8.2.tgz#f7d25b45288b5bc121208564fab8f9aa52e1c6d9"
integrity sha512-S3fwkph4bdWrA5JyzUSogW/DxPxYXywpQJssu6yv9+rICUBikrXc/SLso1RMf4KXjlDDN2RVqNonBdIisqjvHw==
dependencies:
"@polkadot/util-crypto" latest
"@sindresorhus/slugify" "^1.1.0"
autolinker "^4.0.0"
bignumber.js "^9.0.1"
bn.js "^5.1.1"
chalk "^3.0.0"
dayjs "^1.10.7"
lodash.isempty "^4.4.0"
lodash.memoize "^4.1.2"
lodash.truncate "^4.4.2"
loglevel "^1.7.0"
loglevel-plugin-prefix "^0.8.4"
remark "^13.0.0"
remark-gfm "^1.0.0"
remark-html "^13.0.1"
strip-markdown "^4.0.0"

"@subsocial/utils@latest":
version "0.7.9"
resolved "https://registry.yarnpkg.com/@subsocial/utils/-/utils-0.7.9.tgz#7391812df03b8a324bde43776438611ee4116afb"
Expand Down Expand Up @@ -3067,6 +3089,13 @@ asynckit@^0.4.0:
resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79"
integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==

autolinker@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/autolinker/-/autolinker-4.0.0.tgz#aa1f9a52786b727b0ecee8cd7d4a97e0e3ef59f1"
integrity sha512-fl5Kh6BmEEZx+IWBfEirnRUU5+cOiV0OK7PEt0RBKvJMJ8GaRseIOeDU3FKf4j3CE5HVefcjHmhYPOcaVt0bZw==
dependencies:
tslib "^2.3.0"

autoprefixer@^10.4.12:
version "10.4.13"
resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-10.4.13.tgz#b5136b59930209a321e9fa3dca2e7c4d223e83a8"
Expand Down

0 comments on commit 4a941ad

Please sign in to comment.