Skip to content

Commit

Permalink
Use new dialog components
Browse files Browse the repository at this point in the history
  • Loading branch information
joonashak committed May 24, 2024
1 parent ad2b7c9 commit 0110518
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 15 deletions.
3 changes: 1 addition & 2 deletions web/src/components/BigDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,13 @@ type BigDialogProps = Omit<DialogProps, "open">;
* Pass content as `children`.
*/
const BigDialog = ({ title, children, ...props }: BigDialogProps) => {
console.log(open);
const navigate = useNavigate();
const { t } = useTranslation();
const theme = useTheme();
const fullScreen = useMediaQuery(theme.breakpoints.down("md"));

const onClose = useCallback(() => {
navigate(".");
navigate("..");
}, [navigate]);

return (
Expand Down
17 changes: 4 additions & 13 deletions web/src/router.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { createBrowserRouter } from "react-router-dom";
import DefaultsDialog from "./components/defaults-dialog/DefaultsDialog";
import EntryDialog from "./components/entry-dialog/EntryDialog";
import Error from "./components/error/Error";
import HeaderGuard from "./components/error/HeaderGuard";
import Layout from "./components/layout/Layout";
import WorkdayBrowser from "./components/workday-browser/WorkdayBrowser";
import WorkdayBrowserRedirect from "./components/workday-browser/WorkdayBrowserRedirect";
import EntryForm from "./components/entry-dialog/EntryForm";
import DefaultsForm from "./components/entry-dialog/DefaultsForm";

const router = createBrowserRouter([
{
Expand Down Expand Up @@ -40,17 +39,9 @@ const router = createBrowserRouter([
element: <WorkdayBrowser />,
errorElement: <Error />,
children: [
{
element: <EntryDialog title="entryDialog.title" />,
children: [
{ path: "create", element: <EntryForm /> },
{ path: "edit", element: <EntryForm /> },
],
},
{
element: <EntryDialog title="entryDialog.setDefaultsTitle" />,
children: [{ path: "set-defaults", element: <DefaultsForm /> }],
},
{ path: "create", element: <EntryDialog /> },
{ path: "edit", element: <EntryDialog variant="edit" /> },
{ path: "set-defaults", element: <DefaultsDialog /> },
],
},
],
Expand Down

0 comments on commit 0110518

Please sign in to comment.