From a8cab390b585df3a3a7f20d59e5163c8a4028dcf Mon Sep 17 00:00:00 2001 From: WaDadidou Date: Wed, 11 Dec 2024 20:04:56 -0500 Subject: [PATCH] fix(article): fix CI --- .../navigation/getNormalModeScreens.tsx | 2 +- .../FeedNewArticle/FeedNewArticleScreen.tsx | 18 +++++++++++------- .../components/FeedPostArticleMarkdownView.tsx | 2 +- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/packages/components/navigation/getNormalModeScreens.tsx b/packages/components/navigation/getNormalModeScreens.tsx index d19e32342..c7145bb14 100644 --- a/packages/components/navigation/getNormalModeScreens.tsx +++ b/packages/components/navigation/getNormalModeScreens.tsx @@ -9,7 +9,7 @@ import { CoreDAOScreen } from "@/screens/CoreDAO/CoreDAOScreen"; import { DAppStoreScreen } from "@/screens/DAppStore/DAppStoreScreen"; import { ToriPunks } from "@/screens/DAppStore/apps/toripunks/HomeScreen"; import { FeedScreen } from "@/screens/Feed/FeedScreen"; -import { FeedNewArticleScreen } from "@/screens/FeedNewArticle/FeedNewArticleScreen.tsx"; +import { FeedNewArticleScreen } from "@/screens/FeedNewArticle/FeedNewArticleScreen"; import { FeedPostViewScreen } from "@/screens/FeedPostView/FeedPostViewScreen"; import { GovernanceProposalScreen } from "@/screens/Governance/GovernanceProposal/GovernanceProposalScreen"; import { GovernanceScreen } from "@/screens/Governance/GovernanceScreen"; diff --git a/packages/screens/FeedNewArticle/FeedNewArticleScreen.tsx b/packages/screens/FeedNewArticle/FeedNewArticleScreen.tsx index b76d78998..8abfa7e6f 100644 --- a/packages/screens/FeedNewArticle/FeedNewArticleScreen.tsx +++ b/packages/screens/FeedNewArticle/FeedNewArticleScreen.tsx @@ -33,6 +33,7 @@ import { ArticleContentEditor } from "@/screens/FeedNewArticle/components/Articl import { NewArticleLocationButton } from "@/screens/FeedNewArticle/components/NewArticleLocationButton"; import { selectNFTStorageAPI } from "@/store/slices/settings"; import { feedPostingStep, FeedPostingStepId } from "@/utils/feed/posting"; +import { generateArticleMetadata } from "@/utils/feed/queries"; import { generateIpfsKey } from "@/utils/ipfs"; import { IMAGE_MIME_TYPES } from "@/utils/mime"; import { ScreenFC, useAppNavigation } from "@/utils/navigation"; @@ -129,6 +130,8 @@ export const FeedNewArticleScreen: ScreenFC<"FeedNewArticle"> = () => { mentions: [], }; + const navigateBack = () => navigation.navigate("Feed"); + const onPublish = async () => { const action = "Publish an Article"; if (!wallet?.address || !wallet.connected) { @@ -177,15 +180,16 @@ export const FeedNewArticleScreen: ScreenFC<"FeedNewArticle"> = () => { )[0] : undefined; - const metadata: SocialFeedArticleMetadata = { + const metadata = generateArticleMetadata({ + ...formValues, thumbnailImage: remoteThumbnail, - title: formValues.title, - shortDescription: formValues.shortDescription || "", + gifs: [], + files: [], + mentions: [], + hashtags: [], message: formValues.message, location, - hashtags: [], - mentions: [], - }; + }); await makePost(JSON.stringify(metadata)); } catch (err) { @@ -208,7 +212,7 @@ export const FeedNewArticleScreen: ScreenFC<"FeedNewArticle"> = () => { mobileTitle="NEW ARTICLE" fullWidth headerChildren={New Article} - onBackPress={() => navigation.navigate("Feed")} + onBackPress={navigateBack} footerChildren noMargin noScroll diff --git a/packages/screens/FeedPostView/components/FeedPostArticleMarkdownView.tsx b/packages/screens/FeedPostView/components/FeedPostArticleMarkdownView.tsx index 328077b97..56cc6fc7e 100644 --- a/packages/screens/FeedPostView/components/FeedPostArticleMarkdownView.tsx +++ b/packages/screens/FeedPostView/components/FeedPostArticleMarkdownView.tsx @@ -163,7 +163,7 @@ export const FeedPostArticleMarkdownView: FC<{ isNextPageAvailable.value = hasNextPage; }, [hasNextPage, isNextPageAvailable]); - if (!articleMetadata) return null; + if (!articleMetadata || !message) return null; return (