refactor: migrate UI to Preact components and remove legacy Astro/JS
- Replaced all .astro components with .jsx Preact components and added corresponding CSS modules. - Updated index.astro to use the new App Preact component; removed legacy script and Astro imports. - Deleted obsolete .astro component files and main JS logic (src/scripts/index.js, public/scripts/index.js). - Updated astro.config.mjs for Preact integration. - Updated package.json and package-lock.json to include @astrojs/preact and preact. - Updated tsconfig.json for Preact JSX support. - Refactored index.css to keep only global resets and utility styles. - All changes relate to Gitea issue #1 (refactor to astro app). Migrates the UI from Astro/vanilla JS to a modular Preact component architecture, removing all legacy code and aligning the project with modern best practices. Refs #1
This commit is contained in:
22
src/components/ValidationModal.jsx
Normal file
22
src/components/ValidationModal.jsx
Normal file
@@ -0,0 +1,22 @@
|
||||
import { h } from 'preact';
|
||||
import styles from './ValidationModal.module.css';
|
||||
|
||||
export default function ValidationModal({ open, message, onClose }) {
|
||||
if (!open) return null;
|
||||
return (
|
||||
<div className={styles['modal'] + ' ' + styles['show']} id="validation-modal">
|
||||
<div className={styles['modal-content']}>
|
||||
<div className={styles['modal-header']}>
|
||||
<span className={styles['modal-title']}>Fehler</span>
|
||||
<button className={styles['close-button']} onClick={onClose}>×</button>
|
||||
</div>
|
||||
<div className={styles['modal-body']}>
|
||||
<div className={styles['modal-message']}>{message}</div>
|
||||
</div>
|
||||
<div className={styles['modal-footer']}>
|
||||
<button className={styles['modal-button'] + ' ' + styles['cancel']} onClick={onClose}>OK</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user