Skip to content

Commit

Permalink
feat: add temporaty modal controls to root page
Browse files Browse the repository at this point in the history
  • Loading branch information
JaneMoroz committed Sep 23, 2023
1 parent b38f0b5 commit ec2c617
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// replace with dashboard page when that's completed

import TempModalControls from "@/components/modals/TempModalControls";

export default function Home() {
return null;
return <TempModalControls />;
}
26 changes: 26 additions & 0 deletions src/components/modals/TempModalControls.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
"use client";

import { useAppDispatch } from "@/store";
import { onOpen } from "@/store/features/modal";

export default function TempModalControls() {
const dispatch = useAppDispatch();
return (
<div className="flex flex-col p-6 gap-y-4">
<button
type="button"
onClick={() => dispatch(onOpen({ type: "example1" }))}
className="border-none btn bg-primary"
>
Modal 1
</button>
<button
type="button"
onClick={() => dispatch(onOpen({ type: "example2" }))}
className="border-none btn bg-primary"
>
Modal 2
</button>
</div>
);
}

0 comments on commit ec2c617

Please sign in to comment.