-
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.
frontend : production creation polish, production view first draft
- Loading branch information
1 parent
f94b457
commit 6d4d029
Showing
15 changed files
with
222 additions
and
73 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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: 12 additions & 4 deletions
16
frontend/app/src/domains/production/ProductionController.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,24 +1,32 @@ | ||
import React from 'react' | ||
import { useState } from 'react' | ||
import BeefProductionCreator from './views/beefProductionCreator/BeefProductionCreator.tsx' | ||
import PackageLotsCreator from './views/PackageLotsCreator.js' | ||
import PackageLotsCreator from './views/PackageLotsCreator.tsx' | ||
import ProductionsList from './views/ProductionsList.tsx' | ||
import BeefProductionView from './views/BeefProductionView.tsx' | ||
|
||
export default function ProductionController() { | ||
|
||
const BEEF_PRODUCTION_CREATION = 'BEEF_PRODUCTION_CREATION' | ||
const BEEF_PRODUCTION_PACKAGE_MODIFICATION = 'BEEF_PRODUCTION_PACKAGE_MODIFICATION' | ||
const BEEF_PRODUCTION_VIEW = 'BEEF_PRODUCTION_VIEW' | ||
const PRODUCTIONS_LIST = 'PRODUCTIONS_LIST' | ||
|
||
const [currentAction, setCurrentAction] = useState(PRODUCTIONS_LIST) | ||
const [context, setContext] = useState(undefined) | ||
|
||
return <>{getContent()}</> | ||
|
||
function getContent() { | ||
switch (currentAction) { | ||
case PRODUCTIONS_LIST: return <ProductionsList createBeefProductionCallback={() => setCurrentAction(BEEF_PRODUCTION_CREATION)}></ProductionsList> | ||
case PRODUCTIONS_LIST: return <ProductionsList | ||
createBeefProductionCallback={() => setCurrentAction(BEEF_PRODUCTION_CREATION)} | ||
viewBeefProductionCallback={(production) => { | ||
setContext(production) | ||
setCurrentAction(BEEF_PRODUCTION_VIEW)}}/> | ||
case BEEF_PRODUCTION_CREATION: return <BeefProductionCreator callback={(action) => {setCurrentAction(action)}} /> | ||
case BEEF_PRODUCTION_PACKAGE_MODIFICATION: return <PackageLotsCreator></PackageLotsCreator> | ||
case BEEF_PRODUCTION_VIEW: return <BeefProductionView beefProduction={context} backCallback={() => { | ||
setCurrentAction(PRODUCTIONS_LIST) | ||
setContext(undefined)}}/> | ||
} | ||
} | ||
} |
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
Oops, something went wrong.