Skip to content

Commit

Permalink
Improvements in the test page.
Browse files Browse the repository at this point in the history
  • Loading branch information
TPReal committed Jan 20, 2025
1 parent 10d1463 commit 7934299
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions resources/js/dev-pages/TestPage.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import {Button} from "components/ui/Button";
import {Recreator} from "components/utils/Recreator";
import {AppTitlePrefix} from "features/root/AppTitleProvider";
import {VoidComponent} from "solid-js";
import {createSignal, VoidComponent} from "solid-js";

export const TestComponent: VoidComponent = () => {
console.info("%cTestComponent create", "background: white; color: green; padding: 5px; border-radius: 5px;");
// TEST CODE HERE:

return (
Expand All @@ -15,15 +18,21 @@ export default (() => {
// During development, this place can be used to create a fake page and test components.
// It is available at /dev/test-page, also via the "Test page" link in the menu (DEV mode only).
// Don't submit the changes to this file.
const [recreatorSignal, setRecreatorSignal] = createSignal(1);
return (
<>
<AppTitlePrefix prefix="TestPage" />
<div class="flex flex-col gap-1">
<div class="w-fit bg-purple-100 m-2 p-4 rounded-md">
Test your components here during development by creating a test page in TestPage.tsx.
<div class="w-full flex flex-col items-stretch gap-1">
<div class="bg-purple-100 m-2 p-4 rounded-md flex items-center justify-between">
<div>Test your components here during development by creating a test page in TestPage.tsx.</div>
<Button class="secondary small !bg-white" onClick={[setRecreatorSignal, recreatorSignal() + 1]}>
Reload
</Button>
</div>
<div class="p-2 flex flex-col items-start gap-1">
<TestComponent />
<Recreator signal={recreatorSignal()}>
<TestComponent />
</Recreator>
</div>
</div>
</>
Expand Down

0 comments on commit 7934299

Please sign in to comment.