Skip to content

Commit

Permalink
feat: Enable Fullscreen Mode for LoginPage #45
Browse files Browse the repository at this point in the history
This change implements a fullscreen experience specifically for the login page. Upon loading, the login page will seamlessly transition to fullscreen mode, providing a more immersive and focused login process. Once the login process is completed, the application will gracefully revert to its default windowed mode. This enhancement aims to create a more user-friendly and visually appealing login experience.
  • Loading branch information
RajeshTechForge committed Jul 5, 2024
1 parent d9c90eb commit 5fbf876
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
9 changes: 9 additions & 0 deletions electron/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,3 +159,12 @@ ipcMain.on("reload-app", () => {
}
win?.reload();
});

// Listen for toggling FullScreen
ipcMain.on("setFullScreen", () => {
win?.setFullScreen(true);
});

ipcMain.on("escFullScreen", () => {
win?.setFullScreen(false);
});
10 changes: 9 additions & 1 deletion frontend/pages/LogInPage.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState } from "react";
import React, { useEffect, useState } from "react";
import "./style/LogInPage.css";

interface LogInPagePrompt {
Expand All @@ -12,6 +12,12 @@ export const LogInPage: React.FC<LogInPagePrompt> = ({ changeLogInStatus }) => {
const [openaiKey, setOpenaiKey] = useState<string>("");
const [geminiKey, setGeminiKey] = useState<string>("");

//
// switch to full screen for LoginPage
useEffect(() => {
window.ipcRenderer.send("setFullScreen");
}, []);

//
const submit = () => {
window.ipcRenderer.send("request-to-backend", {
Expand All @@ -31,6 +37,8 @@ export const LogInPage: React.FC<LogInPagePrompt> = ({ changeLogInStatus }) => {
request_type: "start-server",
});
changeLogInStatus();
// escape full screen for LoginPage
window.ipcRenderer.send("escFullScreen");
};

return (
Expand Down

0 comments on commit 5fbf876

Please sign in to comment.