Skip to content

Privacy-first password manager with built-in email aliasing. Fully encrypted and self-hostable.

Add bottom navigation bar (#541)

Leendert de Borst72a3975a5895
diff --git a/browser-extensions/chrome/src/App.tsx b/browser-extensions/chrome/src/App.tsx
index 089eed6c0..c4b1e86f3 100644
--- a/browser-extensions/chrome/src/App.tsx
+++ b/browser-extensions/chrome/src/App.tsx
@@ -11,6 +11,7 @@ import './styles/app.css';
import EncryptionUtility from './utils/EncryptionUtility';
import { VaultResponse } from './types/webapi/VaultResponse';
import { useWebApi } from './context/WebApiContext';
+import EmailsList from './pages/EmailsList';
/**
* Main application component
@@ -32,6 +33,9 @@ const App: React.FC = () => {
*/
const [isLoading, setIsLoading] = useMinDurationLoading(true, 200);
+ // Add new state for navigation
+ const [currentTab, setCurrentTab] = useState<'credentials' | 'emails'>('credentials');
+
/**
* Check if the user needs to unlock the vault.
*/
@@ -286,7 +290,7 @@ const App: React.FC = () => {
// TODO: refactor logo print so we dont duplicate it for both loading screen and normal screen.
return (
- <div className="min-h-screen min-w-[350px] bg-white dark:bg-gray-900">
+ <div className="min-h-screen min-w-[350px] bg-white dark:bg-gray-900 flex flex-col">
<div className="border-b border-gray-200 dark:border-gray-700 dark:bg-gray-800">
<div className="flex justify-between items-center px-4 py-3">
<div className="flex items-center">
@@ -321,23 +325,55 @@ const App: React.FC = () => {
</div>
</div>
- <div className="p-4 dark:bg-gray-900">
- {authContext.isLoggedIn ? (
- <div className="mt-4">
- {needsUnlock ? (
- <Unlock />
- ) : isInlineUnlockMode ? (
- <UnlockSuccess />
- ) : (
- <div>
- <CredentialsList />
- </div>
- )}
- </div>
- ) : (
- <Login />
- )}
+ <div className="flex-1 overflow-y-auto pb-20" style={{ height: 'calc(100vh - 120px)' }}>
+ <div className="p-4 dark:bg-gray-900">
+ {authContext.isLoggedIn ? (
+ <div>
+ {needsUnlock ? (
+ <Unlock />
+ ) : isInlineUnlockMode ? (
+ <UnlockSuccess />
+ ) : (
+ <div>
+ {currentTab === 'credentials' ? <CredentialsList /> : <EmailsList />}
+ </div>
+ )}
+ </div>
+ ) : (
+ <Login />
+ )}
+ </div>
</div>
+
+ {/* Bottom Navigation Bar */}
+ {authContext.isLoggedIn && !needsUnlock && !isInlineUnlockMode && (
+ <div className="fixed bottom-0 left-0 right-0 bg-white dark:bg-gray-800 border-t border-gray-200 dark:border-gray-700">
+ <div className="flex justify-around items-center h-14">
+ <button
+ onClick={() => setCurrentTab('credentials')}
+ className={`flex flex-col items-center justify-center w-1/2 h-full ${
+ currentTab === 'credentials' ? 'text-primary-600 dark:text-primary-500' : 'text-gray-500 dark:text-gray-400'
+ }`}
+ >
+ <svg className="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
+ <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z" />
+ </svg>
+ <span className="text-xs mt-1">Credentials</span>
+ </button>
+ <button
+ onClick={() => setCurrentTab('emails')}
+ className={`flex flex-col items-center justify-center w-1/2 h-full ${
+ currentTab === 'emails' ? 'text-primary-600 dark:text-primary-500' : 'text-gray-500 dark:text-gray-400'
+ }`}
+ >
+ <svg className="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
+ <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z" />
+ </svg>
+ <span className="text-xs mt-1">Emails</span>
+ </button>
+ </div>
+ </div>
+ )}
</div>
);
};
diff --git a/browser-extensions/chrome/src/contentScript.ts b/browser-extensions/chrome/src/contentScript.ts
index bf940a4f2..961546f8c 100644
--- a/browser-extensions/chrome/src/contentScript.ts
+++ b/browser-extensions/chrome/src/contentScript.ts
@@ -235,7 +235,7 @@ function createPopup(input: HTMLInputElement, credentials: Credential[]) : void
<line x1="12" y1="5" x2="12" y2="19"></line>
<line x1="5" y1="12" x2="19" y2="12"></line>
</svg>
- Create New
+ New Alias
`;
createButton.addEventListener('click', () => {
chrome.runtime.sendMessage({ type: 'OPEN_NEW_CREDENTIAL' });
diff --git a/browser-extensions/chrome/src/pages/CredentialsList.tsx b/browser-extensions/chrome/src/pages/CredentialsList.tsx
index b4fed214b..6a4e75d88 100644
--- a/browser-extensions/chrome/src/pages/CredentialsList.tsx
+++ b/browser-extensions/chrome/src/pages/CredentialsList.tsx
@@ -4,7 +4,7 @@ import { Credential } from '../types/Credential';
import { Buffer } from 'buffer';
/**
- * Credentials list page
+ * Credentials list page.
*/
const CredentialsList: React.FC = () => {
const dbContext = useDb();
diff --git a/browser-extensions/chrome/src/pages/EmailsList.tsx b/browser-extensions/chrome/src/pages/EmailsList.tsx
new file mode 100644
index 000000000..bcf5a0d8f
--- /dev/null
+++ b/browser-extensions/chrome/src/pages/EmailsList.tsx
@@ -0,0 +1,15 @@
+import React from 'react';
+
+/**
+ * Emails list page.
+ */
+const EmailsList: React.FC = () => {
+ return (
+ <div>
+ <h2 className="text-gray-900 dark:text-white text-xl mb-4">Emails</h2>
+ <p className="text-gray-500 dark:text-gray-400">No emails found</p>
+ </div>
+ );
+};
+
+export default EmailsList;