Skip to content

Commit

Permalink
update blog posts
Browse files Browse the repository at this point in the history
  • Loading branch information
davidsingal committed Mar 21, 2024
1 parent bfa8ac1 commit ee8a7dc
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 14 deletions.
17 changes: 11 additions & 6 deletions marketing/src/components/blog-card/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,28 @@ export interface BlogProps {
title: string;
description: string;
url: string;
image: string;
image?: string;
}

const BlogCard: FC<BlogProps> = ({ title, description, url, image }: BlogProps) => {
const BlogCard: FC<BlogProps> = ({ title, description, url }: BlogProps) => {
return (
<div
data-testid="blog-card-item"
className="bg-blue-900 h-96 w-96 border-1 border-solid border-blue-900"
>
<a href={url} target="_blank" rel="noreferrer noopener">
<div className="w-full overflow-hidden">
<img src={image} alt={title} className="w-full h-[178px] object-cover" />
<img
src={description.toString().match(/<img[^>]+src="([^">]+)"/)[1]}
alt={title}
className="w-full h-[178px] object-cover"
/>
</div>
<div className="p-5">
<h3 className="text-white font-light text-2xl tracking-tight mb-2 line-clamp-2">
{title}
</h3>
<h3
className="text-white font-light text-2xl tracking-tight mb-2 line-clamp-2"
dangerouslySetInnerHTML={{ __html: title }}
/>
<div
className="font-light text-base text-white mb-3 line-clamp-4"
dangerouslySetInnerHTML={{ __html: description }}
Expand Down
1 change: 0 additions & 1 deletion marketing/src/containers/blog-posts/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ const BlogPosts: FC = () => {
const { data, isFetched } = usePosts();

const posts = data?.items?.slice(0, 4); // Taking the first 4 posts
console.log(posts);

return (
<section className="relative py-12 bg-blue-600 border-t border-white/10 md:py-32">
Expand Down
2 changes: 1 addition & 1 deletion marketing/src/hooks/posts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ type PostsResponse = {
function usePosts() {
const getPosts = async () => {
const { data } = await axios.get<PostsResponse>(
'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;
};
Expand Down
7 changes: 1 addition & 6 deletions marketing/src/utils/subscribers-spreadsheet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

0 comments on commit ee8a7dc

Please sign in to comment.