feat(courses): add type, search, and pricing filters to org landing page

- Add Types section to the Filter sidebar with all 4 course types
- Add full-text search input centered in the hero (title + description)
- Add Pricing section (Free / Paid) based on course cost
- Compact hero prop across all 10 themes to halve vertical padding
- Children snippet support in all hero themes for the search input
- All filters are URL-driven (?types=, ?search=, ?tags=, ?pricing=)
- Full-stack: validation schema, DB queries, service, API route, server load, UI
This commit is contained in:
Rotimi Best
2026-07-01 10:36:53 +01:00
parent 8d2f2a6d2d
commit 78a2b85ad3
27 changed files with 464 additions and 97 deletions
@@ -1,5 +1,6 @@
<script lang="ts">
import type { OrgLandingPageProps } from '../types';
import type { Snippet } from 'svelte';
import SecondaryActionButton from '../secondary-action-button.svelte';
import { Button } from '../../../base/button';
import EditableLandingSection from '../editable-section.svelte';
@@ -7,16 +8,25 @@
interface Props {
hero: OrgLandingPageProps['hero'];
showActions?: boolean;
compact?: boolean;
children?: Snippet;
}
let { hero, showActions = true }: Props = $props();
let { hero, showActions = true, compact = false, children }: Props = $props();
</script>
<EditableLandingSection sectionKey="hero">
<section class="ui:py-10 ui:px-6 ui:max-w-7xl ui:mx-auto ui:grid ui:lg:grid-cols-2 ui:gap-16 ui:items-center">
<section
class="{compact
? 'ui:py-5'
: 'ui:py-10'} ui:px-6 ui:max-w-7xl ui:mx-auto ui:grid ui:lg:grid-cols-2 ui:gap-16 ui:items-center"
>
<div>
<h1 class="ui:text-5xl ui:lg:text-7xl ui:font-black ui:leading-[1.1] ui:tracking-tighter">{hero.heading}</h1>
<p class="ui:text-xl ui:text-[var(--landing-fg-muted)] ui:mb-10 ui:leading-relaxed">{hero.subheading}</p>
{#if children}
<div class="ui:mt-6">{@render children()}</div>
{/if}
{#if showActions}
<div class="ui:flex ui:flex-wrap ui:gap-4">
<Button