mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 17:36:08 +08:00
ui-next: refactor plugin loader (#1190)
This commit is contained in:
1 parent
0e688f77b7
commit
f9cd5bcb40
12 files changed
+181
-17
No files matched your search
@@ -0,0 +1,12 @@
|
||||
import { Link } from '@hydrooj/ui-next';
|
||||
import styles from '../styles.module.css'; // (1) CSS module — scoped class names
|
||||
|
||||
export default function ExampleCss() {
|
||||
return (
|
||||
<div className={styles.card}>
|
||||
<span className={styles.badge}>CSS module</span>
|
||||
<h2 className={styles.title}>Scoped class names</h2>
|
||||
<p><Link to="example_home">← Back</Link></p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
import '../styles.css'; // (3) plain CSS import — applied globally when this page loads
|
||||
|
||||
import { Link, usePageData } from '@hydrooj/ui-next';
|
||||
|
||||
export default function ExampleHome() {
|
||||
const { args } = usePageData(); // args carries the handler's response.body
|
||||
return (
|
||||
<div className="example-page">
|
||||
<h1>ui-next example plugin</h1>
|
||||
<p>{args.message as string}</p>
|
||||
<Link to="example_css">See the CSS-module demo →</Link>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user