mirror of
https://github.com/tinyhumansai/openhuman.git
synced 2026-07-30 06:32:24 +00:00
Reorganize settings menu with delete all data and logout options
- Add "Delete All Data" option to settings modal with proper dangerous styling - Logout option already existed in settings modal - Remove "Delete All Data" and "Logout" buttons from home page - Update home page to have only Settings button with clean styling - Increase modal height from 600px to 800px for better spacing - All account management actions now centralized in settings modal 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Generated
+2554
-6
File diff suppressed because it is too large
Load Diff
@@ -18,6 +18,11 @@ const SettingsHome = () => {
|
||||
console.log('View encryption key');
|
||||
};
|
||||
|
||||
const handleDeleteAllData = () => {
|
||||
// TODO: Show confirmation dialog and delete all data
|
||||
console.log('Delete all data');
|
||||
};
|
||||
|
||||
const menuItems = [
|
||||
{
|
||||
id: 'connections',
|
||||
@@ -96,6 +101,18 @@ const SettingsHome = () => {
|
||||
</svg>
|
||||
),
|
||||
onClick: () => navigateToSettings('billing')
|
||||
},
|
||||
{
|
||||
id: 'delete',
|
||||
title: 'Delete All Data',
|
||||
description: 'Permanently delete all your data and reset your account',
|
||||
icon: (
|
||||
<svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16" />
|
||||
</svg>
|
||||
),
|
||||
onClick: handleDeleteAllData,
|
||||
dangerous: true
|
||||
}
|
||||
];
|
||||
|
||||
@@ -113,6 +130,7 @@ const SettingsHome = () => {
|
||||
title={item.title}
|
||||
description={item.description}
|
||||
onClick={item.onClick}
|
||||
dangerous={item.dangerous}
|
||||
isFirst={index === 0}
|
||||
/>
|
||||
))}
|
||||
|
||||
@@ -55,7 +55,7 @@ const SettingsLayout = ({ children, onClose }: SettingsLayoutProps) => {
|
||||
>
|
||||
<div
|
||||
ref={modalRef}
|
||||
className="glass rounded-3xl shadow-large w-full max-w-[520px] h-[600px] overflow-hidden animate-fade-up focus:outline-none focus:ring-0"
|
||||
className="glass rounded-3xl shadow-large w-full max-w-[520px] h-[800px] overflow-hidden animate-fade-up focus:outline-none focus:ring-0"
|
||||
style={{
|
||||
animationDuration: '200ms',
|
||||
animationTimingFunction: 'ease-out',
|
||||
|
||||
+5
-43
@@ -39,16 +39,6 @@ const Home = () => {
|
||||
navigate('/settings');
|
||||
};
|
||||
|
||||
const handleDeleteAllData = () => {
|
||||
// TODO: Show confirmation dialog and delete all data
|
||||
console.log('Delete all data');
|
||||
};
|
||||
|
||||
|
||||
const handleLogout = () => {
|
||||
dispatch(clearToken());
|
||||
navigate('/');
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="min-h-screen relative overflow-hidden">
|
||||
@@ -86,44 +76,16 @@ const Home = () => {
|
||||
{/* Settings */}
|
||||
<button
|
||||
onClick={handleManageConnections}
|
||||
className="w-full flex items-start justify-between p-3 bg-black/50 border-b border-stone-700 hover:bg-stone-800/30 transition-all duration-200 text-left first:rounded-t-3xl focus:outline-none"
|
||||
className="w-full flex items-center justify-between p-3 bg-black/50 hover:bg-stone-800/30 transition-all duration-200 text-left rounded-3xl focus:outline-none"
|
||||
>
|
||||
<svg className="w-5 h-5 opacity-60 flex-shrink-0 mr-3" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z" />
|
||||
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" />
|
||||
</svg>
|
||||
<div className="flex-1">
|
||||
<div className="font-medium text-sm mb-1">Settings</div>
|
||||
<p className="opacity-70 text-xs">Manage connections, privacy, profile, and app settings</p>
|
||||
</div>
|
||||
<svg className="w-5 h-5 opacity-60 flex-shrink-0 ml-3" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z" />
|
||||
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" />
|
||||
</svg>
|
||||
</button>
|
||||
|
||||
{/* Delete All Data */}
|
||||
<button
|
||||
onClick={handleDeleteAllData}
|
||||
className="w-full flex items-start justify-between p-3 bg-black/50 border-b border-coral-500/30 hover:bg-stone-800/30 transition-all duration-200 text-left focus:outline-none"
|
||||
>
|
||||
<div className="flex-1">
|
||||
<div className="font-medium text-sm mb-1 text-coral-400">Delete All Data</div>
|
||||
<p className="opacity-70 text-xs">Permanently delete all your data and reset your account</p>
|
||||
</div>
|
||||
<svg className="w-5 h-5 opacity-60 flex-shrink-0 ml-3 text-coral-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16" />
|
||||
</svg>
|
||||
</button>
|
||||
|
||||
{/* Logout */}
|
||||
<button
|
||||
onClick={handleLogout}
|
||||
className="w-full flex items-start justify-between p-3 bg-black/50 hover:bg-stone-800/30 transition-all duration-200 text-left last:rounded-b-3xl focus:outline-none"
|
||||
>
|
||||
<div className="flex-1">
|
||||
<div className="font-medium text-sm mb-1 text-amber-400">Logout</div>
|
||||
<p className="opacity-70 text-xs">Sign out of your account</p>
|
||||
</div>
|
||||
<svg className="w-5 h-5 opacity-60 flex-shrink-0 ml-3 text-amber-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1" />
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user