-
Notifications
You must be signed in to change notification settings - Fork 150
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP: Page builder ported to Dashboard 4
- Loading branch information
Rajat Saxena
committed
Oct 29, 2024
1 parent
69d3a35
commit 98487d1
Showing
68 changed files
with
599 additions
and
352 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { AppSidebar } from "@components/admin/dashboard-skeleton/app-sidebar"; | ||
import { SidebarInset, SidebarProvider } from "@/components/ui/sidebar"; | ||
|
||
export default async function Layout({ | ||
children, | ||
}: { | ||
children: React.ReactNode; | ||
}) { | ||
return ( | ||
<SidebarProvider> | ||
<AppSidebar /> | ||
<SidebarInset>{children}</SidebarInset> | ||
</SidebarProvider> | ||
); | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
"use client"; | ||
|
||
import DashboardContent from "@components/admin/dashboard-content"; | ||
import { AddressContext } from "@components/contexts"; | ||
import { | ||
MANAGE_PAGES_PAGE_HEADING, | ||
NEW_PAGE_HEADING, | ||
} from "@ui-config/strings"; | ||
import dynamic from "next/dynamic"; | ||
import { useContext } from "react"; | ||
const NewPage = dynamic(() => import("@components/admin/pages/new-page")); | ||
|
||
const breadcrumbs = [ | ||
{ label: MANAGE_PAGES_PAGE_HEADING, href: "/dashboard4/pages" }, | ||
{ label: NEW_PAGE_HEADING, href: "#" }, | ||
]; | ||
|
||
export default function Page() { | ||
const address = useContext(AddressContext); | ||
|
||
return ( | ||
<DashboardContent breadcrumbs={breadcrumbs}> | ||
<NewPage address={address} prefix="/dashboard4" /> | ||
</DashboardContent> | ||
); | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
"use client"; | ||
|
||
import PageEditor from "@components/admin/page-editor"; | ||
import { | ||
AddressContext, | ||
ProfileContext, | ||
SiteInfoContext, | ||
TypefacesContext, | ||
} from "@components/contexts"; | ||
import { Profile } from "@courselit/common-models"; | ||
import { useSearchParams } from "next/navigation"; | ||
import { useContext } from "react"; | ||
|
||
export default function Page({ params }: { params: { id: string } }) { | ||
const { id } = params; | ||
const searchParams = useSearchParams(); | ||
const redirectTo = searchParams?.get("redirectTo"); | ||
const address = useContext(AddressContext); | ||
const siteInfo = useContext(SiteInfoContext); | ||
const typefaces = useContext(TypefacesContext); | ||
const profile = useContext(ProfileContext); | ||
|
||
return ( | ||
<PageEditor | ||
id={id as string} | ||
address={address} | ||
siteInfo={siteInfo} | ||
typefaces={typefaces} | ||
profile={profile as Profile} | ||
redirectTo={ | ||
redirectTo | ||
? typeof redirectTo === "string" | ||
? redirectTo | ||
: redirectTo[0] | ||
: "" | ||
} | ||
prefix="/dashboard4" | ||
state={{ | ||
siteinfo: siteInfo, | ||
address: address, | ||
profile: profile as Profile, | ||
auth: { | ||
guest: profile ? false : true, | ||
checked: profile ? true : false, | ||
}, | ||
networkAction: false, | ||
theme: { | ||
name: "dummy", | ||
active: false, | ||
styles: {}, | ||
}, | ||
typefaces: [ | ||
{ | ||
section: "default", | ||
typeface: "", | ||
fontWeights: [100], | ||
fontSize: 0, | ||
lineHeight: 0, | ||
letterSpacing: 0, | ||
case: "captilize", | ||
}, | ||
], | ||
message: { | ||
message: "", | ||
open: false, | ||
action: null, | ||
}, | ||
}} | ||
dispatch={() => {}} | ||
/> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.