diff --git a/web/src/components/Icon.astro b/web/src/components/Icon.astro new file mode 100644 index 00000000..005afb5c --- /dev/null +++ b/web/src/components/Icon.astro @@ -0,0 +1,35 @@ +--- +// Icons (Lucide, ISC licence; https://lucide.dev): drawn with currentColor, so they take the colour of their button +// or link. Decorative: the button or link carries the words (aria-label/title, or its text). +const { name, size = 20 } = Astro.props as { name: keyof typeof PATHS; size?: number }; +const PATHS = { + admin: '', + edit: '', + bookmark: '', + words: '', + user: '', + login: '', + logout: '', + theme: '', + font: '', + tag: '', + arrange: '', + history: '', + upload: '', + download: '', + check: '', + close: '', + undo: '', + send: '', + save: '', + full: '', + next: '', // points left: forward in a right-to-left page + prev: '', + trash: '', + key: '', + image: '', + plus: '', + external: '', +}; +--- + diff --git a/web/src/components/LibraryNav.astro b/web/src/components/LibraryNav.astro index 9afb2990..47f30db2 100644 --- a/web/src/components/LibraryNav.astro +++ b/web/src/components/LibraryNav.astro @@ -1,9 +1,10 @@ --- -// tabs between the reader's bookmarks and their word book (kept separate) -const { current } = Astro.props as { current: 'bookmarks' | 'words' }; +// tabs of the reader's own space: saved texts, favourite writers, the word book (kept separate), profile +const { current } = Astro.props as { current: 'bookmarks' | 'writers' | 'words' }; --- diff --git a/web/src/components/Seg.astro b/web/src/components/Seg.astro index 95275948..4576db74 100644 --- a/web/src/components/Seg.astro +++ b/web/src/components/Seg.astro @@ -3,4 +3,4 @@ const { s } = Astro.props as { s: [string, string, string?][] }; --- {s.map(([t, k, d]) => (k === 'mark' ? {t} : k === 'pen' ? {t} - : k === 'bmk' ? {t} : t))} + : k === 'bmk' ? {t} : t))} diff --git a/web/src/layouts/Base.astro b/web/src/layouts/Base.astro index 5fb512d6..3aafe70d 100644 --- a/web/src/layouts/Base.astro +++ b/web/src/layouts/Base.astro @@ -8,6 +8,7 @@ import '../styles/global.css'; interface Props { title?: string; description?: string; q?: string } const { title, description = 'اردو کی کلاسیکی شاعری اور نثر', q = '' } = Astro.props; const fullTitle = title ? `${title} · دیوان` : 'دیوان · اردو کی کلاسیکی شاعری اور نثر'; +import Icon from '../components/Icon.astro'; --- @@ -43,17 +44,23 @@ const fullTitle = title ? `${title} · دیوان` : 'دیوان · اردو ک -
- {Astro.locals.user?.role === 'admin' && } - {['mod-l2', 'mod-l1', 'admin'].includes(Astro.locals.user?.role ?? '') && } - {Astro.locals.user && } - {Astro.locals.user && } +
+ ? + : } + + + {Astro.locals.user && ( +
+ + +
+ )} + @@ -88,7 +95,7 @@ const fullTitle = title ? `${title} · دیوان` : 'دیوان · اردو ک