feat: implement script edition and loading on the frontend

This commit is contained in:
swve 2025-06-08 19:27:11 +02:00
parent 1b35e1cbb3
commit cc1894cd9c
7 changed files with 544 additions and 3 deletions

View file

@ -1,7 +1,7 @@
'use client'
import BreadCrumbs from '@components/Dashboard/Misc/BreadCrumbs'
import { getUriWithOrg } from '@services/config/config'
import { ImageIcon, Info, LockIcon, SearchIcon, TextIcon, LucideIcon, Share2Icon, LayoutDashboardIcon } from 'lucide-react'
import { ImageIcon, Info, LockIcon, SearchIcon, TextIcon, LucideIcon, Share2Icon, LayoutDashboardIcon, CodeIcon } from 'lucide-react'
import Link from 'next/link'
import React, { useEffect, use } from 'react';
import { motion } from 'framer-motion'
@ -9,6 +9,7 @@ import OrgEditGeneral from '@components/Dashboard/Pages/Org/OrgEditGeneral/OrgEd
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'
import OrgEditOther from '@components/Dashboard/Pages/Org/OrgEditOther/OrgEditOther'
export type OrgParams = {
subpage: string
@ -26,6 +27,7 @@ const SETTING_TABS: TabItem[] = [
{ id: 'landing', label: 'Landing Page', icon: LayoutDashboardIcon },
{ id: 'previews', label: 'Images & Previews', icon: ImageIcon },
{ id: 'socials', label: 'Socials', icon: Share2Icon },
{ id: 'other', label: 'Other', icon: CodeIcon },
]
function TabLink({ tab, isActive, orgslug }: {
@ -67,6 +69,9 @@ function OrgPage(props: { params: Promise<OrgParams> }) {
} else if (params.subpage == 'landing') {
setH1Label('Landing Page')
setH2Label('Customize your organization landing page')
} else if (params.subpage == 'other') {
setH1Label('Other')
setH2Label('Manage additional organization settings')
}
}
@ -111,6 +116,7 @@ function OrgPage(props: { params: Promise<OrgParams> }) {
{params.subpage == 'previews' ? <OrgEditImages /> : ''}
{params.subpage == 'socials' ? <OrgEditSocials /> : ''}
{params.subpage == 'landing' ? <OrgEditLanding /> : ''}
{params.subpage == 'other' ? <OrgEditOther /> : ''}
</motion.div>
</div>
)

View file

@ -5,6 +5,7 @@ import NextTopLoader from 'nextjs-toploader';
import Toast from '@components/Objects/StyledElements/Toast/Toast'
import '@styles/globals.css'
import Onboarding from '@components/Objects/Onboarding/Onboarding';
import Footer from "@components/Footer/Footer";
export default function RootLayout(
props: {
@ -25,6 +26,7 @@ export default function RootLayout(
<Toast />
<Onboarding />
{children}
<Footer />
</OrgProvider>
</div>
)