mirror of
https://github.com/tabler/tabler.git
synced 2026-08-29 13:21:29 +04:00
Add quality gates: Prettier for Astro, astro check for shared, unused SCSS variable lint (#2749)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -3,42 +3,27 @@
|
||||
// (like {% modals %}).
|
||||
// NOTE: registration must be synchronous (a promise, not an awaited string) —
|
||||
// see the comment in src/lib/page-modals.ts.
|
||||
import { addPageModal } from '@shared/lib/page-modals';
|
||||
import { addPageModal } from '@shared/lib/page-modals'
|
||||
|
||||
interface Props {
|
||||
modalId?: string;
|
||||
size?: string;
|
||||
top?: boolean;
|
||||
scrollable?: boolean;
|
||||
class?: string;
|
||||
show?: boolean;
|
||||
style?: string;
|
||||
modalId?: string
|
||||
size?: string
|
||||
top?: boolean
|
||||
scrollable?: boolean
|
||||
class?: string
|
||||
show?: boolean
|
||||
style?: string
|
||||
}
|
||||
|
||||
const {
|
||||
modalId = 'simple',
|
||||
size,
|
||||
top,
|
||||
scrollable,
|
||||
class: className,
|
||||
show,
|
||||
style,
|
||||
} = Astro.props;
|
||||
const { modalId = 'simple', size, top, scrollable, class: className, show, style } = Astro.props
|
||||
|
||||
const modalClass = ['modal modal-blur fade', className, show && 'show'].filter(Boolean).join(' ');
|
||||
const dialogClass = [
|
||||
'modal-dialog',
|
||||
size && `modal-${size}`,
|
||||
!top && 'modal-dialog-centered',
|
||||
scrollable && 'modal-dialog-scrollable',
|
||||
]
|
||||
.filter(Boolean)
|
||||
.join(' ');
|
||||
const modalClass = ['modal modal-blur fade', className, show && 'show'].filter(Boolean).join(' ')
|
||||
const dialogClass = ['modal-dialog', size && `modal-${size}`, !top && 'modal-dialog-centered', scrollable && 'modal-dialog-scrollable'].filter(Boolean).join(' ')
|
||||
|
||||
addPageModal(
|
||||
Astro.slots.render('default').then(
|
||||
(content) =>
|
||||
`<!-- BEGIN MODAL -->
|
||||
Astro.slots.render('default').then(
|
||||
(content) =>
|
||||
`<!-- BEGIN MODAL -->
|
||||
<div class="${modalClass}"${style ? ` style="${style}"` : ''} id="modal-${modalId}" tabindex="-1" role="dialog" aria-hidden="${show ? 'false' : 'true'}">
|
||||
<div class="${dialogClass}" role="document">
|
||||
<div class="modal-content">
|
||||
@@ -47,6 +32,6 @@ ${content}
|
||||
</div>
|
||||
</div>
|
||||
<!-- END MODAL -->`,
|
||||
),
|
||||
);
|
||||
),
|
||||
)
|
||||
---
|
||||
|
||||
Reference in New Issue
Block a user