-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
♻️ - refactor: migrate detail process review to BaseListView
- Loading branch information
1 parent
554acf1
commit 666f0f0
Showing
14 changed files
with
334 additions
and
863 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 3 additions & 13 deletions
16
frontend/src/pages/destructionlist/detail/DestructionListDetail.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,21 @@ | ||
import { CardBaseTemplate } from "@maykin-ui/admin-ui"; | ||
import React from "react"; | ||
import { useLoaderData } from "react-router-dom"; | ||
|
||
import { DestructionListDetailContext } from "./DestructionListDetail.loader"; | ||
import { DestructionListEdit } from "./components/DestructionListEdit/DestructionListEdit"; | ||
import { DestructionListProcessReview } from "./components/DestructionListProcessReview/DestructionListProcessReview"; | ||
import { DestructionListToolbar } from "./components/DestructionListToolbar/DestructionListToolbar"; | ||
import { useSecondaryNavigation } from "./hooks/useSecondaryNavigation"; | ||
|
||
/** | ||
* Destruction list detail page | ||
*/ | ||
export function DestructionListDetailPage() { | ||
const { destructionList } = useLoaderData() as DestructionListDetailContext; | ||
const isInReview = destructionList.status === "changes_requested"; | ||
const secondaryNavigationItems = useSecondaryNavigation(); | ||
|
||
// TODO: SEPARATE ROUTE? | ||
// TODO: SEPARATE ROUTES? | ||
if (!isInReview) { | ||
return <DestructionListEdit />; | ||
} else { | ||
return <DestructionListProcessReview />; | ||
} | ||
|
||
// FIXME: MIGRATE TO NEW APPROACH (NEW URL?) | ||
return ( | ||
<CardBaseTemplate secondaryNavigationItems={secondaryNavigationItems}> | ||
<DestructionListToolbar /> | ||
<DestructionListProcessReview /> | ||
</CardBaseTemplate> | ||
); | ||
} |
Oops, something went wrong.