Files
tabler/shared/components/navbar/NavbarSide.astro
codecalm f27c70ad38 Fix Prettier formatting regression and Astro type-check errors
`Render Modal as real markup` (#2742) reformatted ~140 files back to
tabs/semicolons, breaking the Prettier config added by the Astro
quality gates (#2749). Re-run prettier --write to restore it, and fix
the type errors it had been masking: HTMLElement casts and `this`
typing in ChangePasswordModalContent/ConfirmDeleteModalContent
scripts, plain-JS syntax in the inline-injected progress.astro script,
narrowed prop unions in Button/Check/Spinner, nullable icon svg casts
in Icons/Rating, and a duplicate firstLetters/invalid `placeholder`
attribute in Select.astro. Also fix shared/vitest.config.mts's stale
`astro/lib/**/*.test.ts` include glob left over from the shared source
restructure, which made `pnpm test` report zero test files.
2026-08-03 01:26:19 +02:00

70 lines
2.0 KiB
Plaintext

---
import Button from '@ui/Button.astro'
import ButtonList from '@ui/ButtonList.astro'
import NavbarSideTheme from './NavbarSideTheme.astro'
import NavbarSideNotifications from './NavbarSideNotifications.astro'
import NavbarSideApps from './NavbarSideApps.astro'
import NavbarSideLanguage from './NavbarSideLanguage.astro'
import NavbarSideUser from './NavbarSideUser.astro'
interface Props {
class?: string
breakpoint?: string
condensed?: boolean
personId?: number
hideUsername?: boolean
dark?: boolean
showThemeToggle?: boolean
showNotifications?: boolean
showApps?: boolean
showLanguageSelector?: boolean
showUser?: boolean
}
const {
class: className,
breakpoint = 'md',
condensed = false,
personId = 1,
hideUsername = false,
dark = false,
// show-* flags default false — sidebar only shows the Sponsor button unless set.
showThemeToggle = false,
showNotifications = false,
showApps = false,
showLanguageSelector = false,
showUser = false,
} = Astro.props
// TODO: site.githubSponsorsUrl — add to src/lib/site.ts (out of scope for this
// task; value from /Users/chomik/htdocs/tabler/shared/data/site.json).
const githubSponsorsUrl = 'https://github.com/sponsors/codecalm'
---
<!-- BEGIN NAVBAR ACTIONS -->
<div class:list={['navbar-nav flex-row', className]}>
{
!condensed && (
<div class={`nav-item d-none d-${breakpoint}-flex me-3`}>
<ButtonList>
<Button icon="heart" iconColor="pink" outline text="Sponsor" href={githubSponsorsUrl} external />
</ButtonList>
</div>
)
}
{
(showThemeToggle || showNotifications || showApps || showLanguageSelector) && (
<div class={`d-none d-${breakpoint}-flex me-3`}>
{showThemeToggle && <NavbarSideTheme />}
{showNotifications && <NavbarSideNotifications />}
{showApps && <NavbarSideApps />}
{showLanguageSelector && <NavbarSideLanguage />}
</div>
)
}
{showUser && <NavbarSideUser personId={personId} hideUsername={hideUsername} dark={dark} />}
</div>
<!-- END NAVBAR ACTIONS -->