present mode issue solved
This commit is contained in:
parent
ec13c593d7
commit
abe4226147
6 changed files with 9 additions and 16 deletions
|
|
@ -4,7 +4,7 @@ import path from "path"
|
|||
export const localhost = "http://0.0.0.0"
|
||||
|
||||
|
||||
export const isDev = false;
|
||||
export const isDev = true;
|
||||
export const baseDir = app.getAppPath();
|
||||
export const fastapiDir = isDev ? path.join(baseDir, "servers/fastapi") : path.join(baseDir, "resources/fastapi");
|
||||
export const nextjsDir = isDev ? path.join(baseDir, "servers/nextjs") : path.join(baseDir, "resources/nextjs");
|
||||
|
|
|
|||
|
|
@ -11,16 +11,8 @@ import { Button } from "@/components/ui/button";
|
|||
import { renderSlideContent } from "./slide_config";
|
||||
import { Slide } from "../types/slide";
|
||||
|
||||
interface SlideContent {
|
||||
title: string;
|
||||
body: string | Array<{ heading: string; description: string }>;
|
||||
description?: string;
|
||||
image_prompts?: string[];
|
||||
icon_queries?: Array<{ queries: string[] }>;
|
||||
}
|
||||
|
||||
interface PresentationModeProps {
|
||||
presentationId: string;
|
||||
slides: Slide[];
|
||||
currentSlide: number;
|
||||
currentTheme: string;
|
||||
|
|
@ -32,7 +24,7 @@ interface PresentationModeProps {
|
|||
}
|
||||
|
||||
const PresentationMode: React.FC<PresentationModeProps> = ({
|
||||
presentationId,
|
||||
|
||||
slides,
|
||||
currentSlide,
|
||||
currentTheme,
|
||||
|
|
|
|||
|
|
@ -269,7 +269,7 @@ const Header = ({
|
|||
<div className="flex flex-col lg:flex-row items-center gap-4">
|
||||
{/* Present Button */}
|
||||
<Button
|
||||
onClick={() => router.push(`?mode=present&slide=${currentSlide || 0}`)}
|
||||
onClick={() => router.push(`?id=${presentation_id}&mode=present&slide=${currentSlide || 0}`)}
|
||||
variant="ghost"
|
||||
className="border border-white font-bold text-white rounded-[32px] transition-all duration-300 group"
|
||||
>
|
||||
|
|
|
|||
|
|
@ -309,14 +309,14 @@ const PresentationPage = ({ presentation_id }: { presentation_id: string }) => {
|
|||
// Function to handle present exit
|
||||
const handlePresentExit = () => {
|
||||
setIsFullscreen(false);
|
||||
router.push(`/presentation/${presentation_id}`);
|
||||
router.push(`/presentation?id=${presentation_id}`);
|
||||
};
|
||||
// Function to handle slide change for presentation mode
|
||||
const handleSlideChange = (newSlide: number) => {
|
||||
if (newSlide >= 0 && newSlide < presentationData?.slides.length!) {
|
||||
setSelectedSlide(newSlide);
|
||||
router.push(
|
||||
`/presentation/${presentation_id}?mode=present&slide=${newSlide}`,
|
||||
`/presentation?id=${presentation_id}&mode=present&slide=${newSlide}`,
|
||||
{ scroll: false }
|
||||
);
|
||||
}
|
||||
|
|
@ -333,7 +333,7 @@ const PresentationPage = ({ presentation_id }: { presentation_id: string }) => {
|
|||
if (isPresentMode) {
|
||||
return (
|
||||
<PresentationMode
|
||||
presentationId={presentation_id}
|
||||
|
||||
slides={presentationData?.slides!}
|
||||
currentSlide={currentSlide}
|
||||
currentTheme={currentTheme}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import PresentationPage from "./components/PresentationPage";
|
|||
import { Button } from "@/components/ui/button";
|
||||
import { useRouter, useSearchParams } from "next/navigation";
|
||||
const page = () => {
|
||||
console.log("presentation page", window.location.href);
|
||||
const router = useRouter();
|
||||
const params = useSearchParams();
|
||||
const queryId = params.get("id");
|
||||
|
|
@ -12,7 +13,7 @@ const page = () => {
|
|||
return (
|
||||
<div className="flex flex-col items-center justify-center h-screen">
|
||||
<h1 className="text-2xl font-bold">No presentation id found</h1>
|
||||
<p className="text-gray-500">Please try again</p>
|
||||
<p className="text-gray-500 pb-4">Please try again</p>
|
||||
<Button onClick={() => router.push("/dashboard")}>Go to home</Button>
|
||||
</div>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ export const defaultColors = {
|
|||
slideBox: "#29136C",
|
||||
iconBg: "#5E8CF0",
|
||||
chartColors: ["#5E8CF0", "#496CEB", "#f051b5", "#F7A8FF", "#FCD8FF"],
|
||||
fontFamily: "var(--font-instrument_sans)",
|
||||
fontFamily: "var(--font-instrument-sans)",
|
||||
},
|
||||
light_red: {
|
||||
background: "#F8E9E8",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue