feat(nav): surface Data in the primary app menu (IMP-IA-01)
Import/export/backups (/data) was only reachable from the account overflow dropdown + command palette — buried for how central it is. Move it into the main Tracker nav menu alongside Bills/Categories/Spending/… so it appears in both the desktop dropdown and the mobile nav. Preserves the existing gate: Data stays hidden for the default-admin account (new `accountToolsOnly` flag on the nav item, filtered by the same `!user.is_default_admin` check the account dropdown used). Removed the now -redundant account-dropdown entry; command palette entry unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
54484ec8a0
commit
0b1c6a8322
|
|
@ -46,6 +46,7 @@ const trackerItems = [
|
|||
{ to: '/bank-transactions', icon: Landmark, label: 'Banking', simplefinOnly: true },
|
||||
{ to: '/snowball', icon: TrendingDown, label: 'Snowball' },
|
||||
{ to: '/payoff', icon: Calculator, label: 'Payoff' },
|
||||
{ to: '/data', icon: Database, label: 'Data', accountToolsOnly: true },
|
||||
];
|
||||
|
||||
function TrackerMenu({ onNavigate, badge, badgeNames = [], items = trackerItems }) {
|
||||
|
|
@ -164,10 +165,6 @@ function UserMenu({ adminMode = false }) {
|
|||
<Settings className="h-4 w-4" />
|
||||
Settings
|
||||
</DropdownMenuItem>
|
||||
<DropdownMenuItem onSelect={() => navigate('/data')}>
|
||||
<Database className="h-4 w-4" />
|
||||
Data
|
||||
</DropdownMenuItem>
|
||||
<DropdownMenuSeparator />
|
||||
</>
|
||||
)}
|
||||
|
|
@ -199,9 +196,13 @@ export default function Sidebar({ adminMode = false }) {
|
|||
const { data: overdueData } = useOverdueCount();
|
||||
const overdueCount = (!adminMode && overdueData?.count) ? overdueData.count : 0;
|
||||
const overdueNames = (!adminMode && overdueData?.names) ? overdueData.names : [];
|
||||
const accountToolsAllowed = !user?.is_default_admin;
|
||||
const trackerMenuItems = useMemo(
|
||||
() => trackerItems.filter(item => !item.simplefinOnly || simplefinReady),
|
||||
[simplefinReady],
|
||||
() => trackerItems.filter(item => (
|
||||
(!item.simplefinOnly || simplefinReady)
|
||||
&& (!item.accountToolsOnly || accountToolsAllowed)
|
||||
)),
|
||||
[simplefinReady, accountToolsAllowed],
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue