Implement GuidebooksGrid in WeaponGrid
This commit is contained in:
parent
a60630cdf1
commit
f2ba8ddbea
1 changed files with 13 additions and 3 deletions
|
|
@ -11,6 +11,8 @@ import classNames from 'classnames'
|
||||||
import Alert from '~components/common/Alert'
|
import Alert from '~components/common/Alert'
|
||||||
import WeaponUnit from '~components/weapon/WeaponUnit'
|
import WeaponUnit from '~components/weapon/WeaponUnit'
|
||||||
import ExtraWeaponsGrid from '~components/extra/ExtraWeaponsGrid'
|
import ExtraWeaponsGrid from '~components/extra/ExtraWeaponsGrid'
|
||||||
|
import ExtraContainer from '~components/extra/ExtraContainer'
|
||||||
|
import GuidebooksGrid from '~components/extra/GuidebooksGrid'
|
||||||
import WeaponConflictModal from '~components/weapon/WeaponConflictModal'
|
import WeaponConflictModal from '~components/weapon/WeaponConflictModal'
|
||||||
|
|
||||||
import api from '~utils/api'
|
import api from '~utils/api'
|
||||||
|
|
@ -25,8 +27,11 @@ interface Props {
|
||||||
new: boolean
|
new: boolean
|
||||||
editable: boolean
|
editable: boolean
|
||||||
weapons?: GridWeapon[]
|
weapons?: GridWeapon[]
|
||||||
|
guidebooks?: GuidebookList
|
||||||
createParty: (details: DetailsObject) => Promise<Party>
|
createParty: (details: DetailsObject) => Promise<Party>
|
||||||
pushHistory?: (path: string) => void
|
pushHistory?: (path: string) => void
|
||||||
|
updateExtra: (enabled: boolean) => void
|
||||||
|
updateGuidebook: (book: Guidebook, position: number) => void
|
||||||
}
|
}
|
||||||
|
|
||||||
const WeaponGrid = (props: Props) => {
|
const WeaponGrid = (props: Props) => {
|
||||||
|
|
@ -365,6 +370,13 @@ const WeaponGrid = (props: Props) => {
|
||||||
updateObject={receiveWeaponFromSearch}
|
updateObject={receiveWeaponFromSearch}
|
||||||
updateUncap={initiateUncapUpdate}
|
updateUncap={initiateUncapUpdate}
|
||||||
/>
|
/>
|
||||||
|
<GuidebooksGrid
|
||||||
|
grid={appState.party.guidebooks}
|
||||||
|
editable={props.editable}
|
||||||
|
offset={numWeapons}
|
||||||
|
removeGuidebook={removeGuidebook}
|
||||||
|
updateObject={receiveGuidebookFromSearch}
|
||||||
|
/>
|
||||||
</ExtraContainer>
|
</ExtraContainer>
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -418,9 +430,7 @@ const WeaponGrid = (props: Props) => {
|
||||||
<ul id="Weapons">{weaponGridElement}</ul>
|
<ul id="Weapons">{weaponGridElement}</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{(() => {
|
{extraElement}
|
||||||
return party.extra ? extraGridElement : ''
|
|
||||||
})()}
|
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue