ui: polish navbar visibility and home page greetings
Hide My Schedule link from admin users (they have dashboard instead). Add 60+ randomized greeting strings split between returning and new users. Update dev script admin seed name. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
const links = [
|
||||
{ href: '/', label: 'Home', showWhen: 'always', width: 'w-12' },
|
||||
{ href: '/prices', label: 'Price List', showWhen: 'guest', width: 'w-20' },
|
||||
{ href: '/schedule', label: 'My Schedule', showWhen: 'auth', width: 'w-24' },
|
||||
{ href: '/schedule', label: 'My Schedule', showWhen: 'auth-not-admin', width: 'w-24' },
|
||||
{ href: '/book', label: 'Book an appointment', showWhen: 'auth', width: 'w-36' },
|
||||
{ href: '/portfolio', label: 'Portfolio', showWhen: 'always', width: 'w-20' },
|
||||
{ href: '/admin', label: 'Admin Dashboard', showWhen: 'admin', width: 'w-28' },
|
||||
@@ -40,13 +40,18 @@
|
||||
if (link.showWhen === 'always') return true;
|
||||
if (link.showWhen === 'guest' && !authStore.isAuthenticated) return true;
|
||||
if (link.showWhen === 'auth' && authStore.isAuthenticated) return true;
|
||||
if (
|
||||
link.showWhen === 'auth-not-admin' &&
|
||||
authStore.isAuthenticated &&
|
||||
authStore.currentUser?.role !== 'admin'
|
||||
)
|
||||
return true;
|
||||
if (link.showWhen === 'admin' && authStore.currentUser?.role === 'admin') return true;
|
||||
return false;
|
||||
};
|
||||
|
||||
// Derived values for auth state - ensures reactivity
|
||||
let isAuthenticated = $derived(authStore.isAuthenticated);
|
||||
let currentUserRole = $derived(authStore.currentUser?.role);
|
||||
let isLoading = $derived(authStore.isLoading);
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user