From ee8a7dcef0ed7573c61ab8e842d1e6d62d677ed7 Mon Sep 17 00:00:00 2001 From: David Inga Date: Thu, 21 Mar 2024 11:49:56 +0100 Subject: [PATCH] update blog posts --- .../src/components/blog-card/component.tsx | 17 +++++++++++------ .../src/containers/blog-posts/component.tsx | 1 - marketing/src/hooks/posts/index.ts | 2 +- marketing/src/utils/subscribers-spreadsheet.ts | 7 +------ 4 files changed, 13 insertions(+), 14 deletions(-) diff --git a/marketing/src/components/blog-card/component.tsx b/marketing/src/components/blog-card/component.tsx index 66663cb53..827f1d88f 100644 --- a/marketing/src/components/blog-card/component.tsx +++ b/marketing/src/components/blog-card/component.tsx @@ -5,10 +5,10 @@ export interface BlogProps { title: string; description: string; url: string; - image: string; + image?: string; } -const BlogCard: FC = ({ title, description, url, image }: BlogProps) => { +const BlogCard: FC = ({ title, description, url }: BlogProps) => { return (
= ({ title, description, url, image }: BlogProps) >
- {title} + ]+src="([^">]+)"/)[1]} + alt={title} + className="w-full h-[178px] object-cover" + />
-

- {title} -

+

{ const { data, isFetched } = usePosts(); const posts = data?.items?.slice(0, 4); // Taking the first 4 posts - console.log(posts); return (
diff --git a/marketing/src/hooks/posts/index.ts b/marketing/src/hooks/posts/index.ts index a409b7ba0..7fa2026f0 100644 --- a/marketing/src/hooks/posts/index.ts +++ b/marketing/src/hooks/posts/index.ts @@ -28,7 +28,7 @@ type PostsResponse = { function usePosts() { const getPosts = async () => { const { data } = await axios.get( - 'https://api.rss2json.com/v1/api.json?rss_url=https://medium.com/feed/@landgriffon', + 'https://api.rss2json.com/v1/api.json?rss_url=https://medium.com/feed/vizzuality-blog/tagged/sustainable-supply-chain', ); return data; }; diff --git a/marketing/src/utils/subscribers-spreadsheet.ts b/marketing/src/utils/subscribers-spreadsheet.ts index 853de73ab..fb40660e7 100644 --- a/marketing/src/utils/subscribers-spreadsheet.ts +++ b/marketing/src/utils/subscribers-spreadsheet.ts @@ -20,12 +20,7 @@ export const saveContactToSubscribersSpreadsheet = async (data: SubscriberContac docData.append('entry.1734344997', data.newsletter || 'No'); // TO-DO: solve CORS issue with google forms - return ( - axios - .post(SCRIPT_URL, docData) - // .then((response) => console.log(response)) - .catch((error) => console.error(error)) - ); + return axios.post(SCRIPT_URL, docData).catch((error) => console.error(error)); }; export default saveContactToSubscribersSpreadsheet;