diff --git a/packages/gui/src/components/News/News.svelte b/packages/gui/src/components/News/News.svelte
new file mode 100644
index 0000000..67f838f
--- /dev/null
+++ b/packages/gui/src/components/News/News.svelte
@@ -0,0 +1,34 @@
+
+
+
+ OPEN-SOURCE NEWS
+ Read more articles >
+
+
+
+ {#each news as article}
+ -
+
+
+
+
+
+ {article.title}
+ {article.short_description}
+ Read more ...
+
+
+
+ {/each}
+
diff --git a/packages/gui/src/libs/api/mock.ts b/packages/gui/src/libs/api/mock.ts
index c89f576..3a1a375 100644
--- a/packages/gui/src/libs/api/mock.ts
+++ b/packages/gui/src/libs/api/mock.ts
@@ -5,7 +5,7 @@
* TODO:
* * make cors work with api.tea.xyz/v1
*/
-import type { Package, Review } from '@tea/ui/types';
+import type { Package, Review, AirtablePost } from '@tea/ui/types';
import type { GUIPackage, Course } from '../types';
import { PackageStates } from '../types';
import { loremIpsum } from 'lorem-ipsum';
@@ -251,3 +251,49 @@ export async function getTopPackages(): Promise {
};
});
}
+
+export async function getAllPosts(): Promise {
+ const posts: AirtablePost[] = [
+ {
+ airtable_record_id: 'a',
+ link: 'https://google.com',
+ title: 'Tea Inc releases game changing api!',
+ sub_title: 'lorem ipsum dolor sit amet',
+ short_description: 'lorem ipsum dolor sit amet',
+ thumb_image_url: '/images/bored-ape.png',
+ thumb_image_name: 'borred-api.png',
+ created_at: new Date(),
+ updated_at: new Date(),
+ published_at: new Date(),
+ tags: ['news']
+ },
+ {
+ airtable_record_id: 'b',
+ link: 'https://google.com',
+ title: 'Bored Ape not bored anymore',
+ sub_title: 'lorem ipsum dolor sit amet',
+ short_description: 'lorem ipsum dolor sit amet',
+ thumb_image_url: '/images/bored-ape.png',
+ thumb_image_name: 'borred-api.png',
+ created_at: new Date(),
+ updated_at: new Date(),
+ published_at: new Date(),
+ tags: ['news']
+ },
+ {
+ airtable_record_id: 'c',
+ link: 'https://google.com',
+ title: 'Markdown can be executed! hoohah!',
+ sub_title: 'lorem ipsum dolor sit amet',
+ short_description: 'lorem ipsum dolor sit amet',
+ thumb_image_url: '/images/bored-ape.png',
+ thumb_image_name: 'borred-api.png',
+ created_at: new Date(),
+ updated_at: new Date(),
+ published_at: new Date(),
+ tags: ['news']
+ }
+ ];
+
+ return posts;
+}
diff --git a/packages/gui/src/libs/api/tauri.ts b/packages/gui/src/libs/api/tauri.ts
index c57bf4c..6a94953 100644
--- a/packages/gui/src/libs/api/tauri.ts
+++ b/packages/gui/src/libs/api/tauri.ts
@@ -19,6 +19,7 @@ import type { Package, Review } from '@tea/ui/types';
import type { GUIPackage, Course } from '../types';
import * as mock from './mock';
import { PackageStates } from '../types';
+import { AirtablePost } from '../../../../ui/src/types';
const username = 'user';
const password = 'password';
@@ -147,3 +148,9 @@ export async function getTopPackages(): Promise {
const packages = await mock.getTopPackages();
return packages;
}
+
+export async function getAllPosts(): Promise {
+ // add filter here someday: type = news | course
+ const posts = await mock.getAllPosts();
+ return posts;
+}
diff --git a/packages/gui/src/routes/+page.svelte b/packages/gui/src/routes/+page.svelte
index ccd3e10..b7b8a6d 100644
--- a/packages/gui/src/routes/+page.svelte
+++ b/packages/gui/src/routes/+page.svelte
@@ -6,6 +6,7 @@
import FeaturedPackages from '$components/FeaturedPackages/FeaturedPackages.svelte';
import GettingStarted from '$components/GettingStarted/GettingStarted.svelte';
import TopPackages from '$components/TopPackages/TopPackages.svelte';
+ import News from '$components/News/News.svelte';
backLink.set('');
@@ -20,6 +21,9 @@
+