diff --git a/app/components/Login.tsx b/app/components/Login.tsx index 2152891..24e4a27 100644 --- a/app/components/Login.tsx +++ b/app/components/Login.tsx @@ -11,7 +11,7 @@ const Login: React.FC = () => { // Credentials state const [email, setEmail] = useState(''); const [password, setPassword] = useState(''); - const [accountName, setAccountName] = useState(''); // Set the account name + const [accountName, setAccountName] = useState(''); const [newAccountEmail, setNewAccountEmail] = useState(''); const [newAccountPassword, setNewAccountPassword] = useState(''); const [newAccountName, setNewAccountName] = useState(''); @@ -27,7 +27,7 @@ const Login: React.FC = () => { // Function to toggle the sign-up popup const toggleSignUpPopup = () => { setShowSignUpPopup(!showSignUpPopup); - setShowLoginPopup(false); // Hide login popup when opening the sign-up popup + setShowLoginPopup(false); }; // Function to handle login @@ -40,6 +40,11 @@ const Login: React.FC = () => { } }; + const handleLogout = () => { + setIsLoggedIn(false); + setShowSettingsPopup(false); // Optionally close settings popup on logout + }; + // Function to handle account creation const handleCreateAccount = () => { console.log('New Account Created:', newAccountEmail, newAccountPassword); @@ -53,7 +58,6 @@ const Login: React.FC = () => { return (
{/* Login or Settings Button */} - @@ -124,13 +128,13 @@ const Login: React.FC = () => { />
- {/* New Account Name Input */} -
+ {/* New Account Name Input */} +
setAccountName(e.target.value)} + onChange={(e) => setNewAccountName(e.target.value)} />
@@ -153,12 +157,12 @@ const Login: React.FC = () => { -
+ )} {/* Conditional rendering of the Settings Popup */} - {showSettingsPopup && } + {showSettingsPopup && } ); }; diff --git a/app/components/Settings.tsx b/app/components/Settings.tsx index 3a86df3..ce04d71 100644 --- a/app/components/Settings.tsx +++ b/app/components/Settings.tsx @@ -19,6 +19,12 @@ const Settings: React.FC<{ closeSettings: () => void; accountName: string }> = ( return false; // Default to false if item is null or empty }; + interface SettingsProps { + closeSettings: () => void; + accountName: string; + handleLogout: () => void; // Add this line to accept handleLogout as a prop + } + // Active section const [activeSection, setActiveSection] = useState(() => localStorage.getItem('activeSection') || 'general'); @@ -842,6 +848,16 @@ const Settings: React.FC<{ closeSettings: () => void; accountName: string }> = ( onChange={(e) => setNewPassword(e.target.value)} /> +
+ +
); diff --git a/app/components/settingUtils.ts b/app/components/settingUtils.ts index e327524..ead2c20 100644 --- a/app/components/settingUtils.ts +++ b/app/components/settingUtils.ts @@ -19,4 +19,5 @@ export const exportSettings = (settings: any) => { }; reader.readAsText(file); }; + \ No newline at end of file diff --git a/app/layout.tsx b/app/layout.tsx index 994a18a..8070a08 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -1,18 +1,19 @@ -import Header from "./components/Header"; - +import { ReactNode } from 'react'; export const metadata = { title: 'AI Assistant | Interstellar Development', description: 'A little AI chat that is able to assist you in little tasks', -} +}; -export default function RootLayout({ - children, -}: { - children: React.ReactNode -}) { +export default function RootLayout({ children }: { children: ReactNode }) { return ( + + {metadata.title} + + {/* Tried adding the favicon here */} + +
{children}
diff --git a/app/page.tsx b/app/page.tsx index 387bb1a..0f74ba5 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -7,6 +7,7 @@ import Documentation from './components/Documentation'; // Ensure the import pat import History from './components/History'; import Models from './components/Models'; import Credits from './components/Credits'; +import Head from 'next/head'; import './styles/master.css'; const LandingPage: React.FC = () => { @@ -51,29 +52,31 @@ const LandingPage: React.FC = () => { }; return ( -
-
-
- {showDivs && ( -
- - -
- )} + <> +
+
+
+ {showDivs && ( +
+ + +
+ )} +
+
+ {view === 'AI' && } + {view === 'FAQ' && } + {view === 'Documentation' && } + {view === 'Credits' && } {/* Now Credits will render properly */} +
-
- {view === 'AI' && } - {view === 'FAQ' && } - {view === 'Documentation' && } - {view === 'Credits' && } {/* Now Credits will render properly */} -
-
+ ); }; diff --git a/public/favicon.ico b/public/favicon.ico new file mode 100644 index 0000000..6653ed4 Binary files /dev/null and b/public/favicon.ico differ