-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(web): add item class column to item lists
- Loading branch information
Showing
3 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
packages/spelunker-web/src/components/entities/Item/Class.jsx
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import React from 'react'; | ||
import { gql } from '@apollo/client'; | ||
|
||
const ItemClass = ({ itemClass }) => ( | ||
<div> | ||
{itemClass.name} | ||
</div> | ||
); | ||
|
||
ItemClass.fragment = gql` | ||
fragment ItemClass on Item { | ||
itemClass { | ||
id | ||
name | ||
} | ||
} | ||
`; | ||
|
||
export default ItemClass; |
14 changes: 14 additions & 0 deletions
14
packages/spelunker-web/src/components/entities/Item/columns/ClassColumn.jsx
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import React from 'react'; | ||
|
||
import ItemClass from '../Class'; | ||
|
||
const ItemClassColumn = ({ value: item }) => ( | ||
<ItemClass itemClass={item.itemClass} /> | ||
); | ||
|
||
ItemClassColumn.defaultProps = { | ||
id: 'itemClass', | ||
label: 'Item Class', | ||
}; | ||
|
||
export default ItemClassColumn; |
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