trackers: lock icon after owner-only tracker names (header dropdown, mobile menu, home, /trackers, /start, error suggestions) from one locked flag in #lib/projects; drop the private: subtitle prefix
All checks were successful
Deploy production / deploy (push) Successful in 1m7s
All checks were successful
Deploy production / deploy (push) Successful in 1m7s
This commit is contained in:
@@ -43,6 +43,8 @@ type Tracker = {
|
||||
icon?: string;
|
||||
/** Shown on group tiles before the "more" chip (main and actively played games). */
|
||||
featured?: boolean;
|
||||
/** Owner-only (needs login): every listing shows a small lock after the name. */
|
||||
locked?: boolean;
|
||||
};
|
||||
|
||||
// The spotting trackers: pokedexes of things I can spot in the wild. Grouped under one
|
||||
@@ -110,11 +112,12 @@ export const gameTrackers: readonly Tracker[] = [
|
||||
// Trackers, in display order. Names are short single nouns. Most keep their existing
|
||||
// /projects/... URLs (no moves, so no redirects needed). `private` trackers are shown in the
|
||||
// header, home page and /trackers only to the logged-in owner (layout data `isOwner`), never
|
||||
// in the sitemap; their routes 404 for everyone else.
|
||||
// in the sitemap; their routes 404 for everyone else. Private trackers, and listed ones that
|
||||
// still need a login (`locked`, e.g. money), get a lock icon next to their name everywhere.
|
||||
const allTrackers: readonly (Tracker & { private: boolean })[] = [
|
||||
{
|
||||
name: 'tasks',
|
||||
subtitle: 'private: to-dos, goals and my TickTick history',
|
||||
subtitle: 'to-dos, goals and my TickTick history',
|
||||
href: '/trackers/tasks',
|
||||
external: false,
|
||||
private: true
|
||||
@@ -124,6 +127,7 @@ const allTrackers: readonly (Tracker & { private: boolean })[] = [
|
||||
subtitle: 'a manual ledger for accounts, bills and utilities',
|
||||
href: '/trackers/money',
|
||||
external: false,
|
||||
locked: true,
|
||||
private: false
|
||||
},
|
||||
{
|
||||
@@ -157,28 +161,28 @@ const allTrackers: readonly (Tracker & { private: boolean })[] = [
|
||||
},
|
||||
{
|
||||
name: 'health',
|
||||
subtitle: 'private: body, workouts, sleep, meds and vaccinations',
|
||||
subtitle: 'body, workouts, sleep, meds and vaccinations',
|
||||
href: '/trackers/health',
|
||||
external: false,
|
||||
private: true
|
||||
},
|
||||
{
|
||||
name: 'groceries',
|
||||
subtitle: 'private: supermarket products, favorites and prices per store',
|
||||
subtitle: 'supermarket products, favorites and prices per store',
|
||||
href: '/trackers/groceries',
|
||||
external: false,
|
||||
private: true
|
||||
},
|
||||
{
|
||||
name: 'houses',
|
||||
subtitle: 'private: rentals around Gouda, applications and alerts',
|
||||
subtitle: 'rentals around Gouda, applications and alerts',
|
||||
href: '/trackers/houses',
|
||||
external: false,
|
||||
private: true
|
||||
},
|
||||
{
|
||||
name: 'holders',
|
||||
subtitle: 'private: who has my address, email, phone and bank details, and a moving checklist',
|
||||
subtitle: 'who has my address, email, phone and bank details, and a moving checklist',
|
||||
href: '/trackers/data-holders',
|
||||
external: false,
|
||||
private: true
|
||||
@@ -221,8 +225,22 @@ const allTrackers: readonly (Tracker & { private: boolean })[] = [
|
||||
}
|
||||
];
|
||||
|
||||
const strip = ({ name, subtitle, href, external, children }: Tracker): Tracker =>
|
||||
children ? { name, subtitle, href, external, children } : { name, subtitle, href, external };
|
||||
const strip = ({
|
||||
name,
|
||||
subtitle,
|
||||
href,
|
||||
external,
|
||||
children,
|
||||
locked,
|
||||
private: hidden
|
||||
}: Tracker & { private: boolean }): Tracker => ({
|
||||
name,
|
||||
subtitle,
|
||||
href,
|
||||
external,
|
||||
...(children ? { children } : {}),
|
||||
...(locked || hidden ? { locked: true } : {})
|
||||
});
|
||||
/** Public trackers (sitemap, logged-out navigation). */
|
||||
export const trackers: readonly Tracker[] = allTrackers.filter((t) => !t.private).map(strip);
|
||||
/** Owner-only trackers. */
|
||||
|
||||
Reference in New Issue
Block a user