mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-18 20:09:25 +00:00
feat: init of landing page editor
This commit is contained in:
parent
44fb6b26b8
commit
f6f915c956
4 changed files with 1343 additions and 1 deletions
|
|
@ -1,13 +1,14 @@
|
|||
'use client'
|
||||
import BreadCrumbs from '@components/Dashboard/Misc/BreadCrumbs'
|
||||
import { getUriWithOrg } from '@services/config/config'
|
||||
import { ImageIcon, Info, LockIcon, SearchIcon, TextIcon, LucideIcon, Share2Icon } from 'lucide-react'
|
||||
import { ImageIcon, Info, LockIcon, SearchIcon, TextIcon, LucideIcon, Share2Icon, LayoutDashboardIcon } from 'lucide-react'
|
||||
import Link from 'next/link'
|
||||
import React, { useEffect } from 'react'
|
||||
import { motion } from 'framer-motion'
|
||||
import OrgEditGeneral from '@components/Dashboard/Pages/Org/OrgEditGeneral/OrgEditGeneral'
|
||||
import OrgEditImages from '@components/Dashboard/Pages/Org/OrgEditImages/OrgEditImages'
|
||||
import OrgEditSocials from '@components/Dashboard/Pages/Org/OrgEditSocials/OrgEditSocials'
|
||||
import OrgEditLanding from '@components/Dashboard/Pages/Org/OrgEditLanding/OrgEditLanding'
|
||||
|
||||
export type OrgParams = {
|
||||
subpage: string
|
||||
|
|
@ -22,6 +23,7 @@ interface TabItem {
|
|||
|
||||
const SETTING_TABS: TabItem[] = [
|
||||
{ id: 'general', label: 'General', icon: TextIcon },
|
||||
{ id: 'landing', label: 'Landing Page', icon: LayoutDashboardIcon },
|
||||
{ id: 'previews', label: 'Images & Previews', icon: ImageIcon },
|
||||
{ id: 'socials', label: 'Socials', icon: Share2Icon },
|
||||
]
|
||||
|
|
@ -61,6 +63,9 @@ function OrgPage({ params }: { params: OrgParams }) {
|
|||
} else if (params.subpage == 'socials') {
|
||||
setH1Label('Socials')
|
||||
setH2Label('Manage your organization social media links')
|
||||
} else if (params.subpage == 'landing') {
|
||||
setH1Label('Landing Page')
|
||||
setH2Label('Customize your organization landing page')
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -103,6 +108,7 @@ function OrgPage({ params }: { params: OrgParams }) {
|
|||
{params.subpage == 'general' ? <OrgEditGeneral /> : ''}
|
||||
{params.subpage == 'previews' ? <OrgEditImages /> : ''}
|
||||
{params.subpage == 'socials' ? <OrgEditSocials /> : ''}
|
||||
{params.subpage == 'landing' ? <OrgEditLanding /> : ''}
|
||||
</motion.div>
|
||||
</div>
|
||||
)
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -0,0 +1,83 @@
|
|||
export interface LandingBackground {
|
||||
type: 'solid' | 'gradient' | 'image';
|
||||
color?: string;
|
||||
colors?: Array<string>;
|
||||
direction?: string;
|
||||
image?: string;
|
||||
}
|
||||
|
||||
export interface LandingTestimonialContent {
|
||||
text: string;
|
||||
author: string;
|
||||
}
|
||||
|
||||
export interface LandingImage {
|
||||
url: string;
|
||||
alt: string;
|
||||
}
|
||||
|
||||
export interface LandingHeading {
|
||||
text: string;
|
||||
color: string;
|
||||
size: string;
|
||||
}
|
||||
|
||||
export interface LandingButton {
|
||||
text: string;
|
||||
link: string;
|
||||
color: string;
|
||||
background: string;
|
||||
}
|
||||
|
||||
export interface LandingLogos {
|
||||
type: 'logos';
|
||||
logos: LandingImage[];
|
||||
}
|
||||
|
||||
export interface LandingUsers {
|
||||
user_uuid: string;
|
||||
name: string;
|
||||
description: string;
|
||||
image_url: string;
|
||||
}
|
||||
|
||||
export interface LandingPeople {
|
||||
type: 'people';
|
||||
title: string;
|
||||
people: LandingUsers[];
|
||||
}
|
||||
|
||||
export interface LandingTextAndImageSection {
|
||||
type: 'text-and-image';
|
||||
title: string;
|
||||
text: string;
|
||||
flow: 'left' | 'right';
|
||||
image: LandingImage;
|
||||
buttons: LandingButton[];
|
||||
}
|
||||
|
||||
export interface LandingCourse {
|
||||
course_uuid: string;
|
||||
}
|
||||
|
||||
export interface LandingFeaturedCourses {
|
||||
type: 'featured-courses';
|
||||
courses: LandingCourse[];
|
||||
title: string;
|
||||
}
|
||||
|
||||
export interface LandingHeroSection {
|
||||
type: 'hero';
|
||||
title: string;
|
||||
background: LandingBackground;
|
||||
heading: LandingHeading;
|
||||
subheading: LandingHeading;
|
||||
buttons: LandingButton[];
|
||||
}
|
||||
|
||||
export type LandingSection = LandingTextAndImageSection | LandingHeroSection | LandingLogos | LandingPeople | LandingFeaturedCourses;
|
||||
|
||||
export interface LandingObject {
|
||||
sections: LandingSection[];
|
||||
enabled?: boolean;
|
||||
}
|
||||
|
|
@ -101,6 +101,19 @@ export async function updateUserRole(
|
|||
return res
|
||||
}
|
||||
|
||||
export async function updateOrgLanding(
|
||||
org_id: any,
|
||||
landing_object: any,
|
||||
access_token: string
|
||||
) {
|
||||
const result = await fetch(
|
||||
`${getAPIUrl()}orgs/${org_id}/landing`,
|
||||
RequestBodyWithAuthHeader('PUT', landing_object, null, access_token)
|
||||
)
|
||||
const res = await getResponseMetadata(result)
|
||||
return res
|
||||
}
|
||||
|
||||
export async function removeUserFromOrg(
|
||||
org_id: any,
|
||||
user_id: any,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue