- Rekomendasi Terbaik
+
+ {featured.label}
- Kursus Lengkap Web Development
+ {featured.title}
- Pelajari HTML, CSS, JavaScript, React, dan Node.js dalam satu
- kursus komprehensif yang dirancang untuk pemula hingga tingkat
- menengah.
+ {featured.description}
@@ -26,7 +29,7 @@ export default async function Page() {
-
+
diff --git a/apps/landing/src/collections/LearningResourcesSection.ts b/apps/landing/src/collections/LearningResourcesSection.ts
new file mode 100644
index 0000000..2689245
--- /dev/null
+++ b/apps/landing/src/collections/LearningResourcesSection.ts
@@ -0,0 +1,124 @@
+import { GlobalConfig } from 'payload';
+
+export const LearningResourcesSection: GlobalConfig = {
+ slug: 'learning-resources-section',
+ label: 'Learning Resources Section',
+ fields: [
+ {
+ name: 'title',
+ type: 'text',
+ required: true,
+ defaultValue: 'Sumber Belajar',
+ },
+ {
+ name: 'description',
+ type: 'textarea',
+ required: true,
+ defaultValue:
+ 'Akses berbagai materi belajar yang akan membantu kamu menguasai konsep programming dengan cara yang menyenangkan.',
+ },
+ {
+ name: 'resources',
+ type: 'array',
+ required: true,
+ fields: [
+ {
+ name: 'icon',
+ type: 'text',
+ required: true,
+ },
+ {
+ name: 'title',
+ type: 'text',
+ required: true,
+ },
+ {
+ name: 'description',
+ type: 'textarea',
+ required: true,
+ },
+ {
+ name: 'buttonText',
+ type: 'text',
+ required: true,
+ },
+ {
+ name: 'buttonLink',
+ type: 'text',
+ required: true,
+ },
+ ],
+ defaultValue: [
+ {
+ icon: 'tabler:video',
+ title: 'Video Tutorial',
+ description:
+ 'Belajar melalui tutorial video dari langkah awal hingga mahir.',
+ buttonText: 'Lihat Semua Video',
+ buttonLink: '#',
+ },
+ {
+ icon: 'tabler:article',
+ title: 'Artikel & Tutorial',
+ description:
+ 'Pelajari konsep programming melalui artikel yang disusun secara terstruktur.',
+ buttonText: 'Baca Artikel',
+ buttonLink: '#',
+ },
+ {
+ icon: 'tabler:brand-vscode',
+ title: 'Tantangan Koding',
+ description:
+ 'Uji kemampuan koding kamu dengan tantangan yang menyenangkan dan menantang.',
+ buttonText: 'Mulai Tantangan',
+ buttonLink: '#',
+ },
+ {
+ icon: 'tabler:device-desktop-share',
+ title: 'Sharing Session',
+ description:
+ 'Ikuti sesi berbagi pengalaman dari programmer berpengalaman dan belajar dari pengalaman mereka.',
+ buttonText: 'Jadwal Session',
+ buttonLink: '#',
+ },
+ ],
+ },
+ {
+ name: 'featured',
+ type: 'group',
+ fields: [
+ {
+ name: 'label',
+ type: 'text',
+ required: true,
+ defaultValue: 'Rekomendasi Terbaik',
+ },
+ {
+ name: 'title',
+ type: 'text',
+ required: true,
+ defaultValue: 'Kursus Lengkap Web Development',
+ },
+ {
+ name: 'description',
+ type: 'textarea',
+ required: true,
+ defaultValue:
+ 'Pelajari HTML, CSS, JavaScript, React, dan Node.js dalam satu kursus komprehensif yang dirancang untuk pemula hingga tingkat menengah.',
+ },
+ {
+ name: 'primaryButtonText',
+ type: 'text',
+ required: true,
+ defaultValue: 'Mulai Kursus',
+ },
+ {
+ name: 'secondaryButtonText',
+ type: 'text',
+ required: true,
+ defaultValue: 'Lihat Silabus',
+ },
+ ],
+ },
+ ],
+};
diff --git a/apps/landing/src/payload-types.ts b/apps/landing/src/payload-types.ts
index 3e3c26a..e172913 100644
--- a/apps/landing/src/payload-types.ts
+++ b/apps/landing/src/payload-types.ts
@@ -88,11 +88,13 @@ export interface Config {
'hero-section': HeroSection;
'features-section': FeaturesSection;
'communities-section': CommunitiesSection;
+ 'learning-resources-section': LearningResourcesSection;
};
globalsSelect: {
'hero-section': HeroSectionSelect | HeroSectionSelect;
'features-section': FeaturesSectionSelect | FeaturesSectionSelect;
'communities-section': CommunitiesSectionSelect | CommunitiesSectionSelect;
+ 'learning-resources-section': LearningResourcesSectionSelect | LearningResourcesSectionSelect;
};
locale: null;
user: User & {
@@ -347,6 +349,32 @@ export interface CommunitiesSection {
updatedAt?: string | null;
createdAt?: string | null;
}
+/**
+ * This interface was referenced by `Config`'s JSON-Schema
+ * via the `definition` "learning-resources-section".
+ */
+export interface LearningResourcesSection {
+ id: number;
+ title: string;
+ description: string;
+ resources: {
+ icon: string;
+ title: string;
+ description: string;
+ buttonText: string;
+ buttonLink: string;
+ id?: string | null;
+ }[];
+ featured: {
+ label: string;
+ title: string;
+ description: string;
+ primaryButtonText: string;
+ secondaryButtonText: string;
+ };
+ updatedAt?: string | null;
+ createdAt?: string | null;
+}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "hero-section_select".
@@ -421,6 +449,36 @@ export interface CommunitiesSectionSelect {
createdAt?: T;
globalType?: T;
}
+/**
+ * This interface was referenced by `Config`'s JSON-Schema
+ * via the `definition` "learning-resources-section_select".
+ */
+export interface LearningResourcesSectionSelect {
+ title?: T;
+ description?: T;
+ resources?:
+ | T
+ | {
+ icon?: T;
+ title?: T;
+ description?: T;
+ buttonText?: T;
+ buttonLink?: T;
+ id?: T;
+ };
+ featured?:
+ | T
+ | {
+ label?: T;
+ title?: T;
+ description?: T;
+ primaryButtonText?: T;
+ secondaryButtonText?: T;
+ };
+ updatedAt?: T;
+ createdAt?: T;
+ globalType?: T;
+}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "auth".
diff --git a/apps/landing/src/payload.config.ts b/apps/landing/src/payload.config.ts
index b9c0b88..c53a388 100644
--- a/apps/landing/src/payload.config.ts
+++ b/apps/landing/src/payload.config.ts
@@ -11,6 +11,7 @@ import { fileURLToPath } from 'url';
import { CommunitiesSection } from './collections/CommunitiesSection';
import { FeaturesSection } from './collections/FeaturesSection';
import { HeroSection } from './collections/HeroSection';
+import { LearningResourcesSection } from './collections/LearningResourcesSection';
import { Media } from './collections/Media';
import { Users } from './collections/Users';
@@ -31,7 +32,12 @@ export default buildConfig({
},
},
collections: [Users, Media],
- globals: [HeroSection, FeaturesSection, CommunitiesSection],
+ globals: [
+ HeroSection,
+ FeaturesSection,
+ CommunitiesSection,
+ LearningResourcesSection,
+ ],
editor: lexicalEditor(),
secret: process.env.CMS_SECRET || '',
typescript: {
diff --git a/apps/landing/src/services/get-globals-learning-resources-section.ts b/apps/landing/src/services/get-globals-learning-resources-section.ts
new file mode 100644
index 0000000..9a42e8a
--- /dev/null
+++ b/apps/landing/src/services/get-globals-learning-resources-section.ts
@@ -0,0 +1,7 @@
+import { payload } from '../lib/payload';
+
+export async function getGlobalsLearningResourcesSection() {
+ return await payload.findGlobal({
+ slug: 'learning-resources-section',
+ });
+}